X-Git-Url: https://git.distorted.org.uk/~mdw/hippotat/blobdiff_plain/0dc32c3fe61d5ec54a3059080cc10c7c71d79c93..a97e7215874070bbf794e9c21f51ff82fad2f86a:/hippotatd diff --git a/hippotatd b/hippotatd index 834dc5d..fe10eec 100755 --- a/hippotatd +++ b/hippotatd @@ -296,7 +296,8 @@ def process_cfg(_opts, putative_servers, putative_clients): global c c = ConfigResults() - c.server = cfg.get('SERVER','server') + try: c.server = cfg.get('SERVER','server') + except NoOptionError: c.server = 'SERVER' cfg_process_common(c, c.server) cfg_process_saddrs(c, c.server) @@ -400,16 +401,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,