deplace pid file creation in child process
This commit is contained in:
parent
6854cd0ee3
commit
4643112511
@ -103,11 +103,10 @@ def run():
|
||||
raise OSError("PID file exists: %s" % config.get("server", "pid"))
|
||||
pid = os.fork()
|
||||
if pid:
|
||||
try:
|
||||
sys.exit()
|
||||
else:
|
||||
if config.get("server", "pid"):
|
||||
open(config.get("server", "pid"), "w").write(str(pid))
|
||||
finally:
|
||||
sys.exit()
|
||||
sys.stdout = sys.stderr = open(os.devnull, "w")
|
||||
|
||||
# Register exit function
|
||||
|
Loading…
Reference in New Issue
Block a user