fork download
  1. import signal
  2. import sys
  3. import time
  4. import os
  5.  
  6. def signal_handler(signum, stack):
  7. print "This message SHOULD appear"
  8. sys.exit(1)
  9. signal.signal(signal.SIGUSR1, signal_handler)
  10.  
  11. print "Please run 'kill -USR1 %d' in another window"%os.getpid()
  12. time.sleep(3600)
  13. print "This message SHOULD NOT appear"
  14.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty