Merge "Exercise pidfile before daemonizing"

This commit is contained in:
Zuul 2018-02-09 06:53:24 +00:00 committed by Gerrit Code Review
commit 729406a965
1 changed files with 5 additions and 0 deletions

View File

@ -166,6 +166,11 @@ class NodepoolDaemonApp(NodepoolApp):
if is_pidfile_stale(pid):
pid.break_lock()
# Exercise the pidfile before we do anything else (including
# logging or daemonizing)
with pid:
pass
with daemon.DaemonContext(pidfile=pid):
return super(NodepoolDaemonApp, self)._do_run()