Skip to content

Instantly share code, notes, and snippets.

@kostyll
Created December 1, 2015 11:19
Show Gist options
  • Select an option

  • Save kostyll/7a6bef692f81791ec681 to your computer and use it in GitHub Desktop.

Select an option

Save kostyll/7a6bef692f81791ec681 to your computer and use it in GitHub Desktop.
sigterm handler
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