Primary start-up and shutdown script for Mailman's qrunner daemon.
This script starts, stops, and restarts the main Mailman queue runners, making
sure that the various long-running qrunners are still alive and kicking. It
does this by forking and exec'ing the qrunners and waiting on their pids.
When it detects a subprocess has exited, it may restart it.
The qrunners respond to SIGINT, SIGTERM, and SIGHUP. SIGINT and SIGTERM both
cause the qrunners to exit cleanly, but the master will only restart qrunners
that have exited due to a SIGINT. SIGHUP causes the master and the qrunners
to close their log files, and reopen then upon the next printed message.
The master also responds to SIGINT, SIGTERM, and SIGHUP, which it simply
passes on to the qrunners (note that the master will close and reopen its own
log files on receipt of a SIGHUP). The master also leaves its own process id
in the file data/master-qrunner.pid but you normally don't need to use this
pid directly. The `start', `stop', `restart', and `reopen' commands handle
everything for you.
Usage: %(PROGRAM)s [options] [ start | stop | restart | reopen ]
Options:
-n/--no-restart
Don't restart the qrunners when they exit because of an error or a
SIGINT. They are never restarted if they exit in response to a
SIGTERM. Use this only for debugging. Only useful if the `start'
command is given.
-u/--run-as-user
Normally, this script will refuse to run if the user id and group id
are not set to the `mailman' user and group (as defined when you
configured Mailman). If run as root, this script will change to this
user and group before the check is made.
This can be inconvenient for testing and debugging purposes, so the -u
flag means that the step that sets and checks the uid/gid is skipped,
and the program is run as the current user and group. This flag is
not recommended for normal production environments.
Note though, that if you run with -u and are not in the mailman group,
you may have permission problems, such as begin unable to delete a
list's archives through the web. Tough luck!
-s/--stale-lock-cleanup
If mailmanctl finds an existing master lock, it will normally exit
with an error message. With this option, mailmanctl will perform an
extra level of checking. If a process matching the host/pid described
in the lock file is running, mailmanctl will still exit, but if no
matching process is found, mailmanctl will remove the apparently stale
lock and make another attempt to claim the master lock.
-q/--quiet
Don't print status messages. Error messages are still printed to
standard error.
-h/--help
Print this message and exit.
Commands:
start - Start the master daemon and all qrunners. Prints a message and
exits if the master daemon is already running.
stop - Stops the master daemon and all qrunners. After stopping, no
more messages will be processed.
restart - Restarts the qrunners, but not the master process. Use this
whenever you upgrade or update Mailman so that the qrunners will
use the newly installed code.
reopen - This will close all log files, causing them to be re-opened the
next time a message is written to them