[Zope-Checkins] CVS: ZODB3/ZEO - start.py:1.50

Guido van Rossum guido@python.org
Fri, 11 Oct 2002 09:54:13 -0400


Update of /cvs-repository/ZODB3/ZEO
In directory cvs.zope.org:/tmp/cvs-serv11026

Modified Files:
	start.py 
Log Message:
When running under zdaemon, chdir into var directory.  Log success or
failure of chdir.


=== ZODB3/ZEO/start.py 1.49 => 1.50 ===
--- ZODB3/ZEO/start.py:1.49	Fri Oct 11 09:16:40 2002
+++ ZODB3/ZEO/start.py	Fri Oct 11 09:54:13 2002
@@ -95,7 +95,7 @@
     sys.path.insert(0, directory(me, 2))
 
     global LOG, INFO, ERROR
-    from zLOG import LOG, INFO, ERROR, PANIC
+    from zLOG import LOG, INFO, WARNING, ERROR, PANIC
     from ZEO.util import Environment
     env = Environment(me)
 
@@ -222,6 +222,15 @@
             zdaemon.run(sys.argv, env.zeo_pid)
 
     try:
+
+        if Z:
+            # Change current directory (for core dumps etc.)
+            try:
+                os.chdir(env.var)
+            except os.error:
+                LOG('ZEO/start.py', WARNING, "Couldn't chdir to %s" % env.var)
+            else:
+                LOG('ZEO/start.py', INFO, "Changed directory to %s" % env.var)
 
         import ZEO.StorageServer, asyncore