Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failure when starting octoprint as daemon as root #337

Closed
morlac opened this issue Jan 3, 2014 · 2 comments · Fixed by UBCRapid/RapidPrint#4
Closed

failure when starting octoprint as daemon as root #337

morlac opened this issue Jan 3, 2014 · 2 comments · Fixed by UBCRapid/RapidPrint#4

Comments

@morlac
Copy link

morlac commented Jan 3, 2014

when starting octoprint as root (with --iknowwhatimdoing) it's not possible to also daemonize octoprint (with --daemon start) as the arg --iknowwhatimdooing is lost when forking ..

Edit: a possible solution could be the following patch:

--- run 2014-01-03 11:40:01.240498634 +0100
+++ run 2014-01-03 20:18:48.795684640 +0100
@@ -4,7 +4,7 @@ from octoprint.daemon import Daemon
 from octoprint.server import Server

 class Main(Daemon):
-   def __init__(self, pidfile, configfile, basedir, host, port, debug):
+   def __init__(self, pidfile, configfile, basedir, host, port, debug, allowRoot):
        Daemon.__init__(self, pidfile)

        self._configfile = configfile
@@ -12,9 +12,10 @@ class Main(Daemon):
        self._host = host
        self._port = port
        self._debug = debug
+                self._allowRoot = allowRoot

    def run(self):
-       octoprint = Server(self._configfile, self._basedir, self._host, self._port, self._debug)
+       octoprint = Server(self._configfile, self._basedir, self._host, self._port, self._debug, self._allowRoot)
        octoprint.run()

 def main():
@@ -50,7 +51,7 @@ def main():
            print >> sys.stderr, "Sorry, daemon mode is only supported under Linux right now"
            sys.exit(2)

-       daemon = Main(args.pidfile, args.config, args.basedir, args.host, args.port, args.debug)
+       daemon = Main(args.pidfile, args.config, args.basedir, args.host, args.port, args.debug, args.allowRoot)
        if "start" == args.daemon:
            daemon.start()
        elif "stop" == args.daemon:
@foosel
Copy link
Member

foosel commented Jan 9, 2014

Should be fixed now, on windows only right now, so a quick test would be much appreciated!

foosel added a commit that referenced this issue Jan 9, 2014
@morlac
Copy link
Author

morlac commented Jan 10, 2014

I re-installed octoprint-git (current master) on my Archlinux-RPi and it now works as expected =)
THX

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants