##// END OF EJS Templates
exit notebook cleanly on SIGINT, SIGTERM...
MinRK -
Show More
@@ -449,11 +449,20 b' class NotebookApp(BaseIPythonApplication):'
449 449 self.port = port
450 450 break
451 451
452 def init_signal(self):
453 signal.signal(signal.SIGINT, self._handle_signal)
454 signal.signal(signal.SIGTERM, self._handle_signal)
455
456 def _handle_signal(self, sig, frame):
457 self.log.critical("received signal %s, stopping", sig)
458 ioloop.IOLoop.instance().stop()
459
452 460 @catch_config_error
453 461 def initialize(self, argv=None):
454 462 super(NotebookApp, self).initialize(argv)
455 463 self.init_configurables()
456 464 self.init_webapp()
465 self.init_signal()
457 466
458 467 def cleanup_kernels(self):
459 468 """shutdown all kernels
General Comments 0
You need to be logged in to leave comments. Login now