[Zope-Checkins] CVS: Zope/lib/python/Zope/Startup/nt - NTService.py:1.8

Chris McDonough chrism@zope.com
Sun, 6 Jul 2003 21:11:36 -0400


Update of /cvs-repository/Zope/lib/python/Zope/Startup/nt
In directory cvs.zope.org:/tmp/cvs-serv4419

Modified Files:
	NTService.py 
Log Message:
Set ZMANAGED envvar to allow Zope restart from control panel when running as service.


=== Zope/lib/python/Zope/Startup/nt/NTService.py 1.7 => 1.8 ===
--- Zope/lib/python/Zope/Startup/nt/NTService.py:1.7	Sun Jul  6 06:00:15 2003
+++ Zope/lib/python/Zope/Startup/nt/NTService.py	Sun Jul  6 21:11:31 2003
@@ -20,6 +20,7 @@
 import win32process
 import pywintypes
 import time
+import os
 
 # the max seconds we're allowed to spend backing off
 BACKOFF_MAX = 300
@@ -72,6 +73,9 @@
             win32process.STARTUPINFO())
 
     def SvcDoRun(self):
+        # indicate to Zope that the process is daemon managed (restartable)
+        os.environ['ZMANAGED'] = '1'
+
         # daemon behavior:  we want to to restart the process if it
         # dies, but if it dies too many times, we need to give up.