I installed OctoPrint inside my FreeBSD Jail and everything worked great. I have also applied this guide FreeBSD 12.1 Guide with rc.d script to start OctoPrint Automatically and as a Service - Get Help / Guides - OctoPrint Community Forum
The problem now is I couldn't restart OctoPrint using OctoPrint website regardless what command I tried.
I install doas (similar but lighter than sudo) and configure to allow octoprint user to restart service without password:
permit nopass octoprint as root cmd /usr/sbin/service args octoprint restart
If I'm inside jail and type command: doas /usr/sbin/service octoprint restart, everything works as expected: OctoPrint stops then starts. But if I use that command through OctoPrint website, OctoPrint stops but doesn't start.
browser.user_agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36 Edg/97.0.1072.62
FreeBSD 13.0-RELEASE Jail
My hypothesis is that, through the website, OctoPrint initialize the restart command "in process" (I'm not sure correct term) so when OctoPrint stops, it kills everything so the 2nd part of the command to start OctoPrint is not actually executing. I'm not 100% sure though but I'm looking for some recommendation/workaround (through OctoPrint site).