X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-replicated;h=26f8695eb82d9916a720f5a2e5eca51b86992690;hb=b8723ee3aabc24e0fc9c9cfef1edb73b68b8a158;hp=ac83a4d805161db874ad3a1bb180b1459d770581;hpb=1b804762104088311ba80f34e174750adebf23a3;p=mirror%2Fuserdir-ldap.git diff --git a/ud-replicated b/ud-replicated old mode 100644 new mode 100755 index ac83a4d..26f8695 --- a/ud-replicated +++ b/ud-replicated @@ -63,7 +63,10 @@ FORMAT='%(asctime)s ud-replicated: %(levelname)s %(message)s' SFORMAT='ud-replicated[%(process)s]: %(message)s' logging.basicConfig(format=FORMAT, level=lvl) LOG = logging.getLogger(__name__) -syslog_handler = logging.handlers.SysLogHandler(address = '/dev/log') +logsock = '/dev/log' +if os.path.exists('/var/run/log'): # Kfreebsd randomly different + logsock = '/var/run/log' +syslog_handler = logging.handlers.SysLogHandler(address = logsock) formatter = logging.Formatter(SFORMAT) syslog_handler.setFormatter(formatter) LOG.addHandler(syslog_handler) @@ -84,7 +87,7 @@ def do_replicate(message): LOG.error('%s failed:', ' '.join(command)) else: LOG.debug('%s finished with ret: 0' % ' '.join(command)) - finally: + finally: os.environ['TERM'] = old_term LOG.debug(message)