summaryrefslogtreecommitdiff
path: root/cron/qrunner (follow)
Commit message (Collapse)AuthorAgeFilesLines
* No longer necessary. qrunner is now a proper daemon and shouldn't bebwarsaw2001-07-061-290/+0
| | | | invoked from cron.
* Lots of changes to make this act more like a traditional daemon and tobwarsaw2001-07-031-67/+59
| | | | | | | | | | | | | | | | | | | | | | | | | remove the run-from-cron functionality (yes, I know this script shouldn't be in cron/ anymore, but moving it is a PITA). Specifically, Removed the SIGCHLD signal handler since this will no longer be run as a cron job. Added a PIDFILE global to name the file holding the pid of the master qrunner process. sighup_handler(): When the master gets a SIGHUP, send a SIGINT to all the children so that they'll exit. This has two benefits: it will automatically close all open log files, and the auto-restart feature will mean all the children will see any changes to the source code (i.e they'll restart and thus import afresh any updated modules). master(): When the main loop exits, be sure to include the watchdog_pid in the list of children to SIGINT. main(): Removed the -b/--background flag. Write the pid of the current process to data/qrunner.pid so that it can be exited externally via: kill -INT `cat data/qrunner.pid` Convert all syslog() calls to new style.
* start_runner(): Put the invocation of qrclass().run() inside the try:bwarsaw2001-06-071-1/+1
| | | | | so that KeyboardInterrupts that percolate through are caught and ignored.
* sighup_handler(): Be sure to propagate the SIGHUP to all the qrunnerbwarsaw2001-06-021-8/+12
| | | | | | | children, so they re-open their log files too. Move the `kids' dictionary (with keys being the pids of the children), to module global `KIDS' so sighup_handler() can have access to it.
* sighup_handler(): New global function, installed as a signal handlerbwarsaw2001-06-021-1/+15
| | | | | | | | | for SIGHUP to force all the log files to close and be re-opened on the next write. master(): Catch OSError, EINTR that can happen if a signal (e.g. SIGHUP) is caught during the wait() system call. It's enough to just restart the os.wait().
* Be sure to set the language to the DEFAULT_SERVER_LANGUAGE as soon asbwarsaw2001-05-181-1/+4
| | | | possible.
* start_runner(): Due to race conditions, the subproc could get thebwarsaw2001-04-031-1/+6
| | | | SIGINT inside the syslog call. It's of no consequence.
* master(): Rework the while 1 loop so that it's inside the try/exceptbwarsaw2001-04-021-4/+4
| | | | | KeyboardError instead of outside it. This prevents the anomolous tracebacks that sometimes occur when ^C is used to kill qrunner.
* Improvements to make sure multiple qrunner masters aren't running atbwarsaw2001-03-011-15/+62
| | | | | | | | | | | | | the same time. Specifically, main(): Create a master qrunner lock file, with a lifetime of 10 days (but see below) and exit if that lock cannot be acquired. master(): Start the lock-refresher subprocess and restart it if it happens to exit. start_lock_refresher(): A tiny subprocess that owns the qrunner lock and periodically (once a day) wakes up to refresh it.
* usage(): Standard usage printing function.bwarsaw2001-02-161-7/+24
| | | | | | main(), master(): Add a -n/--no-restart option which inhibits a restart of child processes when they exit. Very helpful for debugging.
* Very significant changes to support the new Runner classes, and thebwarsaw2001-02-151-21/+167
| | | | | | | change in model to a long-running process. New usage options are added, including -r to run a specific runner exactly once, and -b to run the process in the backround.
* First step in the conversion to a multiple-queue model. This scriptbwarsaw2000-12-201-246/+22
| | | | | | | | | | | | | | | gets simplified considerably because the bulk of the logic is moved into classes in the Mailman.Queue package. The next step might be to make the queues long running processes watchdogged by the qrunner. QRUNNERS is a list of classes to instantiate to run through the various queue directories. Currently there are only incoming, outgoing, and usenet queues. Each qrunner is run in it's own child process (via fork), so we need to be more careful about race conditions in the re-queuing logic. main(): Pretty simple now, it just forks and waits on the child processes.
* dispose_message(): For mail destined to either the -admin or thebwarsaw2000-09-181-1/+3
| | | | | -owner address, explicit set the 'noack' flag to false so the Replybot module will act on it. Closes bug #114603.
* Turn off incessant logging on every execution.bwarsaw2000-09-141-2/+2
|
* main(): Fixed typo in syslog() call.bwarsaw2000-07-271-1/+1
|
* main(): Unmarshal the .db file before creating the Message object.bwarsaw2000-07-261-4/+5
| | | | | Pass in the `filebase' value to the Message constructor to make sure the message uses the same hash value as before.
* dispose_message(): A refinement of the message disposition scheme.bwarsaw2000-07-221-8/+74
| | | | | | | | | | | | | | | | | For messages that have toadmin set (i.e. came to the -admin address), we only do bounce detection before sending off to the list owners. Specifically, we don't do bounce-loop detection. All messages sent to the owners will get Errors-To: set to the -owner address. It is the -owner address that does bounce-loop detection before sending off to the list owners. The reason this is done is so that bounces arriving at the -admin address but not matching any detectors will be forwarded on the list owners. But bogus list owner address must be dealt with as well, so these are handled by the -owner address. This is all documented at the top of the file.
* main(): Honor QRUNNER_PROCESS_LIFETIME and QRUNNER_MAX_MESSAGES bybwarsaw2000-06-261-0/+11
| | | | breaking out of the main loop when either are exceeded.
* dispose_message(): If the sender of the message comes frombwarsaw2000-06-231-1/+14
| | | | | | | | LIKELY_BOUNCE_SENDERS, then this message is probably bounced from a bogus admin address. Catch and stop the loop by not attempting delivery again. Fixes PR#285, BUG#106592
* Use syslog() interface instead of writing to stderr. All syslogbwarsaw2000-06-231-10/+13
| | | | | | | errors go to the logs/qrunner file, while any exceptions that percolate to the top would go to logs/error. main(): Refresh the qrunner lock each time through the main loop.
* main(): Don't need to treat `kids' key specially here, since it's nowbwarsaw2000-06-201-19/+9
| | | | | | marked as volatile and not saved to the .db file. Use Utils.reap().
* This script now does most of the work that post, mailcmd, andbwarsaw2000-06-141-14/+50
| | | | | | | | | | | | | | | | | | | | | | | mailowner used to do. Those scripts now just quickly queue the messages into qfiles/. This was the only way to make sure that we never hit MTAs delivery command time limits. QRUNNER_LOCK_LIFETIME: moved to Defaults.py dispose_message(): Knows how to dispose of messages queued by post, mailcmd, or mailowner. mailcmd sets the `torequest' msgdata key, and mailowner sets the `toadmin' msgdata key. For torequest messages, we send the message through ParseMailCommands and always return 0. For toadmin messages, we send the message through the bounce scanner, and if that fails to find a bounce, we send the message on to the list owner (with all the proper queuing on errors). For all other messages, we do nothing different. main(): Be a little more careful about closing the file descriptors.
* Crank QRUNNER_LOCK_LIFETIME to 30 minutes and set manual_reprime=0 inbwarsaw2000-06-011-2/+2
| | | | setting up stderr logging.
* updated some commentsbwarsaw2000-05-311-8/+2
|
* main(): If a message in the queue is destined for a list that doesn'tbwarsaw2000-05-301-6/+16
| | | | | | | | exist, log this error and dequeue the message. Otherwise, messages for removed lists will sit in the queue forever because they can no longer be delivered. dequeue(): Factor out dequeuing logic.
* main(): Zap the `kids' key if it's present in the reconstitutedbwarsaw2000-05-221-0/+7
| | | | | dictionary; this contains pids which aren't descendent to the qrunner process.
* main(): Only check return value of dispose_message() to see if thebwarsaw2000-05-221-2/+0
| | | | | message can be dequeued or not. On failure, DeliverToList() will automatically enqueue the message.
* Substantial changes for robustification of deliveries.bwarsaw2000-05-081-31/+80
| | | | | | | | | | | | | | | | | dispose_message(): Compatibility function for delivery of pre-2.0beta3 version qfiles and 2.0b3 version qfiles (whose marshaled state now contains a schema version number). open_list(): Since qrunner can attempt delivery against the same list multiple times, cache the list name and the MailList object in a global, and reuse it if possible. The only thing that has to be managed explicitly is acquiring and relinquishing the lock. That fine though 'cause that's what we actually want to do! main(): Integrate with the new delivery stuff; use the msgdata dictionary for message metadata. Also, dig out the 'kids' info, which is a list of subproc pids to wait on. Re-queue the message if delivery did not successfully complete.
* main(): Catch base class MMListError.bwarsaw2000-04-041-1/+1
|
* Cron script for re-trying delivery of messages previously queuedbwarsaw2000-03-281-0/+106
because of total or partial failure in the smtpd handoff.