Close PID file

This commit is contained in:
Unrud 2015-12-22 06:49:33 +01:00 committed by Unrud
parent 53c3113b44
commit 0a09804821

View File

@ -105,7 +105,8 @@ def run():
if pid:
sys.exit()
elif config.get("server", "pid"):
open(config.get("server", "pid"), "w").write(str(os.getpid()))
with open(config.get("server", "pid"), "w") as pid_file:
pid_file.write(str(os.getpid()))
sys.stdout = sys.stderr = open(os.devnull, "w")
# Register exit function