[Zope-Checkins] SVN: Zope/branches/2.13/ Fix lock file cleanup if there's an error early in startup.

Ross Patterson cvs-admin at zope.org
Fri Jun 8 00:41:22 UTC 2012


Log message for revision 126683:
  Fix lock file cleanup if there's an error early in startup.
  

Changed:
  U   Zope/branches/2.13/doc/CHANGES.rst
  U   Zope/branches/2.13/src/Zope2/Startup/__init__.py
  U   Zope/branches/2.13/src/Zope2/Startup/run.py

-=-
Modified: Zope/branches/2.13/doc/CHANGES.rst
===================================================================
--- Zope/branches/2.13/doc/CHANGES.rst	2012-06-07 21:34:23 UTC (rev 126682)
+++ Zope/branches/2.13/doc/CHANGES.rst	2012-06-08 00:41:18 UTC (rev 126683)
@@ -8,7 +8,9 @@
 2.13.15 (unreleased)
 --------------------
 
+- Fix lock file cleanup if there's an error early in startup.
 
+
 2.13.14 (2012-05-31)
 --------------------
 

Modified: Zope/branches/2.13/src/Zope2/Startup/__init__.py
===================================================================
--- Zope/branches/2.13/src/Zope2/Startup/__init__.py	2012-06-07 21:34:23 UTC (rev 126682)
+++ Zope/branches/2.13/src/Zope2/Startup/__init__.py	2012-06-08 00:41:18 UTC (rev 126683)
@@ -303,7 +303,7 @@
                 pass
 
     def unlinkLockFile(self):
-        if not self.cfg.zserver_read_only_mode:
+        if not self.cfg.zserver_read_only_mode and hasattr(self, 'lockfile'):
             try:
                 self.lockfile.close()
                 os.unlink(self.cfg.lock_filename)

Modified: Zope/branches/2.13/src/Zope2/Startup/run.py
===================================================================
--- Zope/branches/2.13/src/Zope2/Startup/run.py	2012-06-07 21:34:23 UTC (rev 126682)
+++ Zope/branches/2.13/src/Zope2/Startup/run.py	2012-06-08 00:41:18 UTC (rev 126683)
@@ -20,8 +20,9 @@
     starter.setConfiguration(opts.configroot)
     try:
         starter.prepare()
-    finally:
+    except:
         starter.shutdown()
+        raise
     starter.run()
 
 def configure(configfile):



More information about the Zope-Checkins mailing list