catch SIGTERM so that on_exit func is executed at this time too.

This commit is contained in:
Yann Leboulanger 2012-04-19 16:57:43 +02:00
parent eaa447c1e1
commit b716b9aa5b
1 changed files with 1 additions and 0 deletions

View File

@ -413,6 +413,7 @@ if __name__ == '__main__':
sys.exit(5) sys.exit(5)
# ^C exits the application normally to delete pid file # ^C exits the application normally to delete pid file
signal.signal(signal.SIGINT, sigint_cb) signal.signal(signal.SIGINT, sigint_cb)
signal.signal(signal.SIGTERM, sigint_cb)
log.info("Encodings: d:%s, fs:%s, p:%s", sys.getdefaultencoding(), \ log.info("Encodings: d:%s, fs:%s, p:%s", sys.getdefaultencoding(), \
sys.getfilesystemencoding(), locale.getpreferredencoding()) sys.getfilesystemencoding(), locale.getpreferredencoding())