parent
fba48b1d90
commit
417487e195
1 changed files with 5 additions and 3 deletions
|
|
@ -3,8 +3,9 @@ import sys
|
||||||
from octoprint.daemon import Daemon
|
from octoprint.daemon import Daemon
|
||||||
from octoprint.server import Server
|
from octoprint.server import Server
|
||||||
|
|
||||||
|
|
||||||
class Main(Daemon):
|
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)
|
Daemon.__init__(self, pidfile)
|
||||||
|
|
||||||
self._configfile = configfile
|
self._configfile = configfile
|
||||||
|
|
@ -12,9 +13,10 @@ class Main(Daemon):
|
||||||
self._host = host
|
self._host = host
|
||||||
self._port = port
|
self._port = port
|
||||||
self._debug = debug
|
self._debug = debug
|
||||||
|
self._allowRoot = allowRoot
|
||||||
|
|
||||||
def run(self):
|
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()
|
octoprint.run()
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
@ -50,7 +52,7 @@ def main():
|
||||||
print >> sys.stderr, "Sorry, daemon mode is only supported under Linux right now"
|
print >> sys.stderr, "Sorry, daemon mode is only supported under Linux right now"
|
||||||
sys.exit(2)
|
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:
|
if "start" == args.daemon:
|
||||||
daemon.start()
|
daemon.start()
|
||||||
elif "stop" == args.daemon:
|
elif "stop" == args.daemon:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue