aboutsummaryrefslogtreecommitdiffstats
path: root/bin/mailmanctl
diff options
context:
space:
mode:
Diffstat (limited to 'bin/mailmanctl')
-rw-r--r--bin/mailmanctl9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/mailmanctl b/bin/mailmanctl
index 613f909f..2c482221 100644
--- a/bin/mailmanctl
+++ b/bin/mailmanctl
@@ -1,6 +1,6 @@
#! @PYTHON@
-# Copyright (C) 2001-2010 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 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
@@ -117,7 +117,7 @@ COMMASPACE = ', '
DOT = '.'
# Locking contantsa
-LOCKFILE = os.path.join(mm_cfg.LOCK_DIR, 'master-qrunner')
+LOCKFILE = os.path.join(mm_cfg.LOCK_DIR, mm_cfg.MASTER_LOCK_FILE)
# Since we wake up once per day and refresh the lock, the LOCK_LIFETIME
# needn't be (much) longer than SNOOZE. We pad it 6 hours just to be safe.
LOCK_LIFETIME = mm_cfg.days(1) + mm_cfg.hours(6)
@@ -199,7 +199,8 @@ def acquire_lock_1(force):
lock.lock(0.1)
return lock
except LockFile.TimeOutError:
- if not force:
+ # If we're not forcing or the lock can't be determined to be stale.
+ if not force or qrunner_state():
raise
# Force removal of lock first
lock._disown()
@@ -287,7 +288,7 @@ def check_privs():
# the uid/gid.
gid = grp.getgrnam(mm_cfg.MAILMAN_GROUP)[2]
uid = pwd.getpwnam(mm_cfg.MAILMAN_USER)[2]
- myuid = os.getuid()
+ myuid = os.geteuid()
if myuid == 0:
# Set the process's supplimental groups.
groups = [x[2] for x in grp.getgrall() if mm_cfg.MAILMAN_USER in x[3]]