[Zope-Checkins] CVS: Packages/ZEO - runzeo.py:1.15.6.7

Tim Peters tim.one at comcast.net
Thu Apr 14 10:44:15 EDT 2005


Update of /cvs-repository/Packages/ZEO
In directory cvs.zope.org:/tmp/cvs-serv30645

Modified Files:
      Tag: Zope-2_7-branch
	runzeo.py 
Log Message:
Add platform idea of line terminator to pid file.
Compute the pidfile path only once.


=== Packages/ZEO/runzeo.py 1.15.6.6 => 1.15.6.7 ===
--- Packages/ZEO/runzeo.py:1.15.6.6	Wed Apr 13 01:37:34 2005
+++ Packages/ZEO/runzeo.py	Thu Apr 14 10:44:14 2005
@@ -279,12 +279,13 @@
                       "environment variable could not be found. "
                       "Cannot guess pidfile location.")
                 return
-            pidfile = os.path.join(instance_home, "var", "ZEO.pid")
-        return pidfile
+            self.options.pid_file = os.path.join(instance_home,
+                                                 "var", "ZEO.pid")
 
     def make_pidfile(self):
         if not self.options.read_only:
-            pidfile = self._get_pidfile()
+            self._get_pidfile()
+            pidfile = self.options.pid_file
             if pidfile is None:
                 return
             try:
@@ -292,7 +293,7 @@
                     os.unlink(pidfile)
                 pid = os.getpid()
                 f = open(pidfile, 'w')
-                f.write(`pid`)
+                print >> f, pid
                 f.close()
                 info("created PID file '%s'" % pidfile)
             except IOError:
@@ -302,7 +303,7 @@
 
     def remove_pidfile(self):
         if not self.options.read_only:
-            pidfile = self._get_pidfile()
+            pidfile = self.options.pid_file
             if pidfile is None:
                 return
             try:



More information about the Zope-Checkins mailing list