mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-28 12:22:59 +02:00
Similarly do a clean shutdown on SIGHUP unless daemonized
This commit is contained in:
parent
2854665e78
commit
9a6fba244a
1 changed files with 2 additions and 0 deletions
|
|
@ -129,4 +129,6 @@ def main(args=sys.argv):
|
|||
with lopen(opts.pidfile, 'wb') as f:
|
||||
f.write(str(os.getpid()))
|
||||
signal.signal(signal.SIGTERM, lambda s,f: server.stop())
|
||||
if not opts.daemonize:
|
||||
signal.signal(signal.SIGHUP, lambda s,f: server.stop())
|
||||
server.serve_forever()
|
||||
|
|
|
|||
Loading…
Reference in a new issue