diff options
Diffstat (limited to 'Mailman/bin')
| -rw-r--r-- | Mailman/bin/docs/mailmanctl.txt | 27 | ||||
| -rw-r--r-- | Mailman/bin/master.py | 3 |
2 files changed, 29 insertions, 1 deletions
diff --git a/Mailman/bin/docs/mailmanctl.txt b/Mailman/bin/docs/mailmanctl.txt new file mode 100644 index 000000000..bd9023371 --- /dev/null +++ b/Mailman/bin/docs/mailmanctl.txt @@ -0,0 +1,27 @@ +Mailman queue runner control +============================ + +Mailman has a number of queue runners which process messages in its queue file +directories. In normal operation, a command line script called 'mailmanctl' +is used to start, stop and manage the queue runners. mailmanctl actually is +just a wrapper around the real queue runner watcher script called master.py. + +Because master.py runs in the foreground, we can't start it directly, so we'll +start it via mailmanctl. + + >>> from Mailman.tests.helpers import Watcher + >>> watcher = Watcher() + >>> watcher.start() + + >>> import os + + # This will raise an exception if the process doesn't exist. + >>> os.kill(watcher.pid, 0) + +It's also easy to stop the queue runners via the mailmanctl program. + + >>> watcher.stop() + >>> os.kill(watcher.pid, 0) + Traceback (most recent call last): + ... + OSError: [Errno ...] No such process diff --git a/Mailman/bin/master.py b/Mailman/bin/master.py index e2a80934f..e4de11acc 100644 --- a/Mailman/bin/master.py +++ b/Mailman/bin/master.py @@ -350,9 +350,10 @@ qrunner %s reached maximum restart limit of %d, not restarting.""", # The child has already exited. log.info('ESRCH on pid: %d', pid) # Wait for all the children to go away. - while True: + while kids: try: pid, status = os.wait() + del kids[pid] except OSError, e: if e.errno == errno.ECHILD: break |
