[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Updates to run server on win32.



Update of /home/minion/cvsroot/src/minion/lib/mixminion/server
In directory moria.mit.edu:/tmp/cvs-serv14156/lib/mixminion/server

Modified Files:
	ServerMain.py 
Log Message:
Updates to run server on win32.

Index: ServerMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/ServerMain.py,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -d -r1.107 -r1.108
--- ServerMain.py	8 Dec 2003 02:22:56 -0000	1.107
+++ ServerMain.py	8 Dec 2003 06:37:15 -0000	1.108
@@ -476,14 +476,15 @@
 
 GOT_HUP = 0 # Set to one if we get SIGHUP.
 def _sigHupHandler(signal_num, _):
-    '''(Signal handler for SIGTERM)'''
+    '''(Signal handler for SIGHUP)'''
     signal.signal(signal_num, _sigHupHandler)
     global GOT_HUP
     GOT_HUP = 1
 
 def installSignalHandlers():
     """Install signal handlers for sigterm and sighup."""
-    signal.signal(signal.SIGHUP, _sigHupHandler)
+    if hasattr(signal, 'SIGHUP'):
+        signal.signal(signal.SIGHUP, _sigHupHandler)
     signal.signal(signal.SIGTERM, _sigTermHandler)
 
 #----------------------------------------------------------------------
@@ -955,6 +956,8 @@
 #----------------------------------------------------------------------
 def daemonize():
     """Put the server into daemon mode with the standard trickery."""
+    if sys.platform == 'win32':
+        raise UIError("Daemon mode is not supported on win32.")
 
     # This logic is more-or-less verbatim from Stevens's _Advanced
     # Programming in the Unix Environment_: