summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2003-02-04 04:33:10 +0000
committerbwarsaw2003-02-04 04:33:10 +0000
commit8430c09965aa215653819b75cfea4b6d9a3d7e4d (patch)
treef3bc154ec7a47530654c8ac869457c8aaecae39b
parent03eb149b2f7385c2b45d8b6cfd529a19515f9a3b (diff)
downloadmailman-8430c09965aa215653819b75cfea4b6d9a3d7e4d.tar.gz
mailman-8430c09965aa215653819b75cfea4b6d9a3d7e4d.tar.zst
mailman-8430c09965aa215653819b75cfea4b6d9a3d7e4d.zip
check_for_site_list(), main(): Complain loudly and refuse to start if
the site list doesn't exist.
-rw-r--r--bin/mailmanctl16
1 files changed, 15 insertions, 1 deletions
diff --git a/bin/mailmanctl b/bin/mailmanctl
index 0292e1f38..1243dbd41 100644
--- a/bin/mailmanctl
+++ b/bin/mailmanctl
@@ -1,6 +1,6 @@
#! @PYTHON@
-# Copyright (C) 2001,2002 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2003 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
@@ -105,6 +105,8 @@ import paths
from Mailman import mm_cfg
from Mailman import Utils
from Mailman import LockFile
+from Mailman import Errors
+from Mailman.MailList import MailList
from Mailman.i18n import _
from Mailman.Logging.Syslog import syslog
from Mailman.Logging.Utils import LogStdErr
@@ -267,6 +269,16 @@ def start_all_runners():
+def check_for_site_list():
+ sitelistname = mm_cfg.MAILMAN_SITE_LIST
+ try:
+ sitelist = MailList(sitelistname, lock=0)
+ except Errors.MMUnknownListError:
+ print >> sys.stderr, _('Site list is missing: %(sitelistname)s')
+ syslog('error', 'Site list is missing: %s', mm_cfg.MAILMAN_SITE_LIST)
+ sys.exit(1)
+
+
def check_privs():
# 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
@@ -341,6 +353,8 @@ def main():
print _('Re-opening all log files')
kill_watcher(signal.SIGHUP)
elif command == 'start':
+ # First, complain loudly if there's no site list.
+ check_for_site_list()
# Here's the scoop on the processes we're about to create. We'll need
# one for each qrunner, and one for a master child process watcher /
# lock refresher process.