From: Ian Jackson Date: Mon, 10 Apr 2017 00:46:54 +0000 (+0100) Subject: fix pidfile handling X-Git-Url: https://git.distorted.org.uk/~mdw/hippotat/commitdiff_plain/e6bec44d1f87f5094effda2643fc878900f25a02 fix pidfile handling Signed-off-by: Ian Jackson --- diff --git a/hippotatd b/hippotatd index 834dc5d..123943a 100755 --- a/hippotatd +++ b/hippotatd @@ -400,12 +400,12 @@ def daemonise(): if grandchildpid: # we are the intermediate child if opts.pidfile is not None: - print(grandchildpid, file=pfh) - pfh.close() + print(grandchildpid, file=pidfile_h) + pidfile_h.close() os._exit(0) - mypid = os.getpid() - pfh.close() + if opts.pidfile is not None: + pidfile_h.close() logger = subprocess.Popen(['logger','-d', '-t','hippotat(stderr)',