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"))
|
raise OSError("PID file exists: %s" % config.get("server", "pid"))
|
||||||
pid = os.fork()
|
pid = os.fork()
|
||||||
if pid:
|
if pid:
|
||||||
try:
|
sys.exit()
|
||||||
|
else:
|
||||||
if config.get("server", "pid"):
|
if config.get("server", "pid"):
|
||||||
open(config.get("server", "pid"), "w").write(str(pid))
|
open(config.get("server", "pid"), "w").write(str(pid))
|
||||||
finally:
|
|
||||||
sys.exit()
|
|
||||||
sys.stdout = sys.stderr = open(os.devnull, "w")
|
sys.stdout = sys.stderr = open(os.devnull, "w")
|
||||||
|
|
||||||
# Register exit function
|
# Register exit function
|
||||||
|
Loading…
Reference in New Issue
Block a user