Update of /cvsroot/mailman/mailman/cron
In directory usw-pr-cvs1:/tmp/cvs-serv6840

Modified Files:
        qrunner 
Log Message:
sighup_handler(): New global function, installed as a signal handler
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().


Index: qrunner
===================================================================
RCS file: /cvsroot/mailman/mailman/cron/qrunner,v
retrieving revision 2.7
retrieving revision 2.8
diff -C2 -r2.7 -r2.8
*** qrunner     2001/05/18 21:16:44     2.7
--- qrunner     2001/06/02 05:13:52     2.8
***************
*** 107,111 ****
--- 107,120 ----
  SNOOZE = mm_cfg.days(1)
  
+ # We want a SIGHUP to re-open all the log files.  By closing syslog, it will
+ # cause a new StampedLogger to be opened the next time a message is logged.
+ def sighup_handler(signum, frame):
+     syslog.close()
+     # And just to tweak things...
+     syslog('qrunner', 'qrunner caught SIGHUP.  Re-opening log files.')
  
+ signal.signal(signal.SIGHUP, sighup_handler)
+ 
+ 
  
  def usage(code, msg=''):
***************
*** 175,179 ****
          try:
              while 1:
!                 pid, status = os.wait()
                  killsig = status & 0xff
                  exitstatus = (status >> 8) & 0xff
--- 184,193 ----
          try:
              while 1:
!                 try:
!                     pid, status = os.wait()
!                 except OSError, e:
!                     if e.errno <> errno.EINTR: raise
!                     # Just restart the wait()
!                     continue
                  killsig = status & 0xff
                  exitstatus = (status >> 8) & 0xff


_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-checkins

Reply via email to