Skip to content

Commit

Permalink
Fix lock file cleanup if there's an error early in startup.
Browse files Browse the repository at this point in the history
  • Loading branch information
rpatterson committed Jun 8, 2012
1 parent 2a58c32 commit 28213fd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions doc/CHANGES.rst
Expand Up @@ -8,6 +8,8 @@ http://docs.zope.org/zope2/releases/.
2.13.15 (unreleased)
--------------------

- Fix lock file cleanup if there's an error early in startup.


2.13.14 (2012-05-31)
--------------------
Expand Down
2 changes: 1 addition & 1 deletion src/Zope2/Startup/__init__.py
Expand Up @@ -303,7 +303,7 @@ def unlinkPidFile(self):
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)
Expand Down
3 changes: 2 additions & 1 deletion src/Zope2/Startup/run.py
Expand Up @@ -20,8 +20,9 @@ def run():
starter.setConfiguration(opts.configroot)
try:
starter.prepare()
finally:
except:
starter.shutdown()
raise
starter.run()

def configure(configfile):
Expand Down

0 comments on commit 28213fd

Please sign in to comment.