raise RuntimeError('did not die due to signal %s !' % name)
for sig in (signal.SIGINT, signal.SIGTERM):
- signal.signal(sig, partial(signal_handler, sig.name))
+ try: signame = sig.name
+ except AttributeError: signame = "signal %d" % sig
+ signal.signal(sig, partial(signal_handler, signame))
def daemonise():
global syslogfacility
facility=facilnum,
logoption=syslog.LOG_PID)
def emit(event):
+ if logevent_is_boringtwisted(event): return
m = twisted.logger.formatEvent(event)
#print(repr(event), m, file=org_stderr)
level = event.get('log_level')
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)',