diff options
| author | bwarsaw | 2002-01-11 00:57:25 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-01-11 00:57:25 +0000 |
| commit | bf6472e86fe49989c7557724a524c46f6190d552 (patch) | |
| tree | c9016eb4747e4f02ad85f4a73f297ced10518257 | |
| parent | 26010ab00d9b9dfaa615d3a3c653513bac2f175e (diff) | |
| download | mailman-bf6472e86fe49989c7557724a524c46f6190d552.tar.gz mailman-bf6472e86fe49989c7557724a524c46f6190d552.tar.zst mailman-bf6472e86fe49989c7557724a524c46f6190d552.zip | |
acquire_lock_1(): Unset the failing non-force lock's private `owned'
flag so that when it's garbage collected, the lock files won't be
removed. Since they're the same as the forced lock's files, we'd be
removing the files at the wrong time.
acquire_lock(): Rearrange the return values so the logic is a little
easier to follow. Move the "return lock" into the try stanza.
| -rw-r--r-- | bin/mailmanctl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/mailmanctl b/bin/mailmanctl index e41f75aa0..673deb6f1 100644 --- a/bin/mailmanctl +++ b/bin/mailmanctl @@ -1,6 +1,6 @@ #! @PYTHON@ -# Copyright (C) 2001 by the Free Software Foundation, Inc. +# Copyright (C) 2001,2002 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -190,6 +190,7 @@ def acquire_lock_1(force): if not force: raise # Force removal of lock first + lock._disown() hostname, pid, tempfile = get_lock_data() os.unlink(LOCKFILE) os.unlink(tempfile) @@ -199,6 +200,7 @@ def acquire_lock_1(force): def acquire_lock(force): try: lock = acquire_lock_1(force) + return lock except LockFile.TimeOutError: status = qrunner_state() if status == 1: @@ -225,8 +227,6 @@ Lock file: %(LOCKFILE)s Lock host: %(status)s Exiting.""") - return None - return lock @@ -364,7 +364,6 @@ def main(): lock._transfer_to(pid) return # child - # lock._take_possession() # First, save our pid in a file for "mailmanctl stop" rendezvous fp = open(mm_cfg.PIDFILE, 'w') |
