Commit f64fe66c authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

fix daemonizing server on Unix

parent 9e6b0066
......@@ -691,8 +691,12 @@ def launch_server(callback, debug):
command += opts
subprocess.Popen(command, close_fds=True)
else:
import daemon
pid = os.fork()
if not pid:
command = [callback, callback]
command += opts
os.execlp(*command)
with daemon.DaemonContext():
command = [callback, callback]
command += opts
os.execlp(*command)
else:
os.wait()
......@@ -43,6 +43,9 @@ INSTALL_REQUIRES = [
'certifi',
]
if not sys.platform.startswith("win"):
INSTALL_REQUIRES.append("python-daemon")
EXTRAS_REQUIRES = {
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment