[Zope-Checkins] CVS: Zope/lib/python/Signals - Signals.py:1.5.10.1
Andreas Jung
andreas@andreas-jung.com
Sat, 9 Nov 2002 03:43:27 -0500
Update of /cvs-repository/Zope/lib/python/Signals
In directory cvs.zope.org:/tmp/cvs-serv26094/lib/python/Signals
Modified Files:
Tag: ajung-restructuredtext-integration-branch
Signals.py
Log Message:
merge from trunk
=== Zope/lib/python/Signals/Signals.py 1.5 => 1.5.10.1 ===
--- Zope/lib/python/Signals/Signals.py:1.5 Thu Oct 10 10:08:14 2002
+++ Zope/lib/python/Signals/Signals.py Sat Nov 9 03:42:56 2002
@@ -21,9 +21,18 @@
import zLOG
import sys
import ZLogger
+import Lifetime
+
+def shutdownFastHandler():
+ """Shutdown cleanly on SIGTERM. This is registered first,
+ so it should be called after all other handlers."""
+ closeall()
+ zLOG.LOG('Z2', zLOG.INFO , "Shutting down fast")
+ Lifetime.shutdown(0,fast=1)
+
def shutdownHandler():
- """Shutdown cleanly on SIGTERM, SIGINT. This is registered first,
+ """Shutdown cleanly on SIGINT. This is registered first,
so it should be called after all other handlers."""
closeall()
zLOG.LOG('Z2', zLOG.INFO , "Shutting down")
@@ -34,7 +43,7 @@
should be called after all other SIGHUP handlers."""
closeall()
zLOG.LOG('Z2', zLOG.INFO , "Restarting")
- sys.exit(1)
+ Lifetime.shutdown(1)
def logfileReopenHandler():
"""Reopen log files on SIGUSR2. This is registered first, so it
@@ -83,7 +92,7 @@
def registerZopeSignals():
import signal
- SignalHandler.registerHandler(signal.SIGTERM, shutdownHandler)
+ SignalHandler.registerHandler(signal.SIGTERM, shutdownFastHandler)
SignalHandler.registerHandler(signal.SIGINT, shutdownHandler)
SignalHandler.registerHandler(signal.SIGHUP, restartHandler)
SignalHandler.registerHandler(signal.SIGUSR2, logfileReopenHandler)