summaryrefslogtreecommitdiff
path: root/Mailman/Queue
diff options
context:
space:
mode:
authorbwarsaw2001-07-11 20:10:15 +0000
committerbwarsaw2001-07-11 20:10:15 +0000
commit15b3cc352f0cbdde4820b5e2c8e69c422b60d6df (patch)
tree1da9b93b250f3cbbb85af88eda48a26810fe27b9 /Mailman/Queue
parentab45acd549d3f4b8039f5fef229bfc572ec80f7d (diff)
downloadmailman-15b3cc352f0cbdde4820b5e2c8e69c422b60d6df.tar.gz
mailman-15b3cc352f0cbdde4820b5e2c8e69c422b60d6df.tar.zst
mailman-15b3cc352f0cbdde4820b5e2c8e69c422b60d6df.zip
start_runner(): Changed indentation, since the parent always returns.
Also added a note why "mailmanctl restart" doesn't Do The Right Thing w.r.t. allowing the subrunners to re-import various Mailman modules.
Diffstat (limited to 'Mailman/Queue')
-rw-r--r--Mailman/Queue/Control.py34
1 files changed, 20 insertions, 14 deletions
diff --git a/Mailman/Queue/Control.py b/Mailman/Queue/Control.py
index ddb75d80c..8646da2cd 100644
--- a/Mailman/Queue/Control.py
+++ b/Mailman/Queue/Control.py
@@ -91,20 +91,26 @@ def start_runner(qrclass, slice, count):
if pid:
# parent
return pid
- else:
- # child
- qrunner = qrclass(slice, count)
- def sighup_handler(signum, frame, qrunner=qrunner):
- # Exit the qrunner cleanly.
- qrunner.stop()
- syslog('qrunner', '%s qrunner caught SIGHUP. Stopping.' %
- qrunner.__class__.__name__)
- # Enable the child's SIGHUP handler
- signal.signal(signal.SIGHUP, sighup_handler)
- syslog('qrunner', '%s qrunner started.', qrclass.__name__)
- qrunner.run()
- syslog('qrunner', '%s qrunner exiting.', qrclass.__name__)
- os._exit(0)
+ # child
+ #
+ # BAW: We need to think of a good way to force the reloading of Mailman
+ # modules so that a "mailmanctl restart" will utilize any updated code.
+ # Clearing sys.modules is one way, but it has nasty side effects. Hmm,
+ # maybe exec'ing a new process image is the right thing to do?
+ #
+ # Now instantiate the qrunner class
+ qrunner = qrclass(slice, count)
+ def sighup_handler(signum, frame, qrunner=qrunner):
+ # Exit the qrunner cleanly.
+ qrunner.stop()
+ syslog('qrunner', '%s qrunner caught SIGHUP. Stopping.' %
+ qrunner.__class__.__name__)
+ # Enable the child's SIGHUP handler
+ signal.signal(signal.SIGHUP, sighup_handler)
+ syslog('qrunner', '%s qrunner started.', qrclass.__name__)
+ qrunner.run()
+ syslog('qrunner', '%s qrunner exiting.', qrclass.__name__)
+ os._exit(0)