X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=hippotat.git;a=blobdiff_plain;f=hippotatd;h=fe10eeca6166186c49af06ae6da93d8b45a35dde;hp=834dc5d473169631e3885426ada81f4dd7c2cb37;hb=a97e7215874070bbf794e9c21f51ff82fad2f86a;hpb=0dc32c3fe61d5ec54a3059080cc10c7c71d79c93 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,