Merge lp:~cmiller/desktopcouch/stale-pid-file-removal into lp:desktopcouch

Proposed by Chad Miller
Status: Merged
Approved by: Chad Miller
Approved revision: 92
Merged at revision: not available
Proposed branch: lp:~cmiller/desktopcouch/stale-pid-file-removal
Merge into: lp:desktopcouch
Diff against target: 14 lines
1 file modified
desktopcouch/start_local_couchdb.py (+4/-0)
To merge this branch: bzr merge lp:~cmiller/desktopcouch/stale-pid-file-removal
Reviewer Review Type Date Requested Status
Eric Casteleijn (community) Approve
Review via email: mp+13482@code.launchpad.net

Commit message

Couchdb does not check validity of PID files, and happily reports that it is already running if a process exists that is referred to by a stale file. (LP: #442120)

Now, remove PID file before we try starting couch, if we detect it is invalid.

To post a comment you must log in.
Revision history for this message
Eric Casteleijn (thisfred) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'desktopcouch/start_local_couchdb.py'
2--- desktopcouch/start_local_couchdb.py 2009-09-14 15:31:54 +0000
3+++ desktopcouch/start_local_couchdb.py 2009-10-16 15:35:18 +0000
4@@ -183,6 +183,10 @@
5
6 def run_couchdb():
7 """Actually start the CouchDB process. Return its PID."""
8+ pid = read_pidfile()
9+ if pid is not None and not process_is_couchdb(pid):
10+ print "Removing stale, deceptive pid file."
11+ os.remove(local_files.FILE_PID)
12 local_exec = local_files.COUCH_EXEC_COMMAND + ['-b']
13 try:
14 # subprocess is buggy. Chad patched, but that takes time to propagate.

Subscribers

People subscribed via source and target branches