diff options
| author | Barry Warsaw | 2007-11-17 17:38:50 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2007-11-17 17:38:50 -0500 |
| commit | 8a7be9204a9170f9d9b0eb79c2726df0c7a1b4a9 (patch) | |
| tree | 401197ca63700b9b4d30b00bcd1e6cbad881a8bc /Mailman/bin | |
| parent | 12ace359ccceb507ac2e55c1333f63d3d92af6f7 (diff) | |
| parent | 02f3861eae46de1b6e580e257d25aa9a4c73a687 (diff) | |
| download | mailman-8a7be9204a9170f9d9b0eb79c2726df0c7a1b4a9.tar.gz mailman-8a7be9204a9170f9d9b0eb79c2726df0c7a1b4a9.tar.zst mailman-8a7be9204a9170f9d9b0eb79c2726df0c7a1b4a9.zip | |
Merge cleanup branch
Diffstat (limited to 'Mailman/bin')
| -rw-r--r-- | Mailman/bin/arch.py | 3 | ||||
| -rw-r--r-- | Mailman/bin/gate_news.py | 2 | ||||
| -rw-r--r-- | Mailman/bin/mailmanctl.py | 22 | ||||
| -rw-r--r-- | Mailman/bin/testall.py | 1 |
4 files changed, 16 insertions, 12 deletions
diff --git a/Mailman/bin/arch.py b/Mailman/bin/arch.py index 6227482ad..dd65071cc 100644 --- a/Mailman/bin/arch.py +++ b/Mailman/bin/arch.py @@ -25,7 +25,6 @@ import optparse from locknix.lockfile import Lock -from Mailman import Errors from Mailman import Version from Mailman import i18n from Mailman.Archiver.HyperArch import HyperArchive @@ -93,7 +92,7 @@ numbers.""")) def main(): parser, opts, args = parseargs() - config.load(opts.config) + initialize(opts.config) i18n.set_language(config.DEFAULT_SERVER_LANGUAGE) diff --git a/Mailman/bin/gate_news.py b/Mailman/bin/gate_news.py index 9402504dc..e0c1d981a 100644 --- a/Mailman/bin/gate_news.py +++ b/Mailman/bin/gate_news.py @@ -235,7 +235,7 @@ def main(): try: with lockfile.Lock(GATENEWS_LOCK_FILE, # It's okay to hijack this - lifetime=LOCK_LIFETIME): + lifetime=LOCK_LIFETIME) as lock: process_lists(lock) clearcache() except lockfile.TimeOutError: diff --git a/Mailman/bin/mailmanctl.py b/Mailman/bin/mailmanctl.py index 8b7eeb5d2..d07bb40b0 100644 --- a/Mailman/bin/mailmanctl.py +++ b/Mailman/bin/mailmanctl.py @@ -28,8 +28,6 @@ import optparse from locknix import lockfile from Mailman import Defaults -from Mailman import Errors -from Mailman import Utils from Mailman import Version from Mailman import loginit from Mailman.configuration import config @@ -49,6 +47,10 @@ BIN_DIR = os.path.abspath(os.path.dirname(sys.argv[0])) LOCK_LIFETIME = Defaults.days(1) + Defaults.hours(6) SNOOZE = Defaults.days(1) +elog = None +qlog = None +opts = None + def parseargs(): @@ -133,7 +135,7 @@ error.""")) print >> sys.stderr, _('No command given.') sys.exit(1) if len(args) > 1: - parse.print_help() + parser.print_help() commands = COMMASPACE.join(args) print >> sys.stderr, _('Bad command: $commands') sys.exit(1) @@ -157,7 +159,8 @@ def kill_watcher(sig): try: os.kill(pid, sig) except OSError, e: - if e.errno <> errno.ESRCH: raise + if e.errno <> errno.ESRCH: + raise print >> sys.stderr, _('No child with pid: $pid') print >> sys.stderr, e print >> sys.stderr, _('Stale pid file removed.') @@ -279,7 +282,7 @@ def start_all_runners(): -def check_privs(): +def check_privs(parser): # If we're running as root (uid == 0), coerce the uid and gid to that # which Mailman was configured for, and refuse to run if we didn't coerce # the uid/gid. @@ -295,8 +298,8 @@ def check_privs(): os.setuid(uid) elif myuid <> uid: name = config.MAILMAN_USER - usage(1, _( - 'Run this program as root or as the $name user, or use -u.')) + parser.error( + _('Run this program as root or as the $name user, or use -u.')) @@ -310,7 +313,7 @@ def main(): qlog = logging.getLogger('mailman.qrunner') if opts.checkprivs: - check_privs() + check_privs(parser) else: print _('Warning! You may encounter permission problems.') @@ -417,7 +420,8 @@ def main(): try: os.kill(pid, signal.SIGTERM) except OSError, e: - if e.errno <> errno.ESRCH: raise + if e.errno <> errno.ESRCH: + raise qlog.info('Master watcher caught SIGTERM. Exiting.') signal.signal(signal.SIGTERM, sigterm_handler) # Finally, we need a SIGINT handler which will cause the sub-qrunners diff --git a/Mailman/bin/testall.py b/Mailman/bin/testall.py index 9be591253..81735d024 100644 --- a/Mailman/bin/testall.py +++ b/Mailman/bin/testall.py @@ -37,6 +37,7 @@ from Mailman.configuration import config from Mailman.i18n import _ from Mailman.initialize import initialize_1, initialize_2 +basedir = None __i18n_templates__ = True |
