Created
December 1, 2015 11:19
-
-
Save kostyll/7a6bef692f81791ec681 to your computer and use it in GitHub Desktop.
sigterm handler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import signal | |
| import sys | |
| def sigterm_handler(_signo, _stack_frame): | |
| # Raises SystemExit(0): | |
| sys.exit(0) | |
| signal.signal(signal.SIGTERM, sigterm_handler) | |
| signal.signal(signal.SIGINT, sigterm_handler) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment