X-Git-Url: https://git.distorted.org.uk/~mdw/hippotat/blobdiff_plain/0dc32c3fe61d5ec54a3059080cc10c7c71d79c93..8c771381ce4cfa26901412997c266457b05921d4:/hippotatd diff --git a/hippotatd b/hippotatd index 834dc5d..cb86c2b 100755 --- a/hippotatd +++ b/hippotatd @@ -400,16 +400,15 @@ 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)', - '--id=%d' % mypid, + '-t','hippotat[%d](stderr)' % os.getpid(), '-p',opts.syslogfacility + '.err'], stdin=subprocess.PIPE, stdout=subprocess.DEVNULL,