Don't forget to exit() on SIGTERM

This commit is contained in:
XANTRONIX Development 2024-12-03 17:00:49 -05:00
parent 07689f87cb
commit 6944f3f898

View file

@ -23,4 +23,8 @@ class Daemon():
with open(pidfile, 'w') as fh:
print(str(os.getpid()), file=fh)
signal.signal(signal.SIGTERM, lambda s, f: os.unlink(pidfile))
def stop(sig, trace):
os.unlink(pidfile)
exit(0)
signal.signal(signal.SIGTERM, stop)