[ZCM] [ZC] 904/ 3 Comment "SIGUSR2 not working on Solaris"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Fri Oct 17 06:04:22 EDT 2003


Issue #904 Update (Comment) "SIGUSR2 not working on Solaris"
 Status Pending, Zope/bug medium
To followup, visit:
  http://collector.zope.org/Zope/904

==============================================================
= Comment - Entry #3 by cheeseshop on Oct 17, 2003 6:04 am

zdaemon/Daemon.py pass thru signals from process manager
to Zope, but it has dependency on Linux signal numbers.

This patch is for Zope 2.6.2.

> *** Daemon.py.orig      Wed Nov 13 06:13:59 2002
> --- Daemon.py   Fri Oct 17 16:52:06 2003
> *************** def run(argv, pidfile=''):
> *** 51,57 ****
>                   # We're the parent (the daemon process)
>                   # pass all "normal" signals along to our child, but don't
>                   # respond to them ourselves unless they say "die"!
> !                 interesting = [1, 2, 3, 10, 12, 15]
>                   # ie. HUP, INT, QUIT, USR1, USR2, TERM
>                   for sig in interesting:
>                       signal.signal(sig, SignalPasser(pid))
> --- 51,64 ----
>                   # We're the parent (the daemon process)
>                   # pass all "normal" signals along to our child, but don't
>                   # respond to them ourselves unless they say "die"!
> !                 interesting = [
> !                   signal.SIGHUP,
> !                   signal.SIGINT,
> !                   signal.SIGQUIT,
> !                   signal.SIGUSR1,
> !                   signal.SIGUSR2,
> !                   signal.SIGTERM
> !                 ]
>                   # ie. HUP, INT, QUIT, USR1, USR2, TERM
>                   for sig in interesting:
>                       signal.signal(sig, SignalPasser(pid))

________________________________________
= Comment - Entry #2 by smcmahon on Jul 3, 2003 11:51 am

This problem also crops up under FreeBSD. (Zope 2.6.1, FreeBSD 4.5, Python 2.1.3)

A bit more information. This is particular to the access log (Z2.log).

When z2.py starts the access log, it successfully saves the file_logger instance to sys.__lg:

     lg = logger.file_logger(LOG_PATH)
     zLOG.LOG('z2', zLOG.BLATHER, 'Using access log file %s' % LOG_PATH) sys.__lg = lg

However, when Signals.py handles SIGUSR2 and tries to recover the
file_logger instance with "getattr(sys, '__lg', None)" it can't find it and silently fails. 

________________________________________
= Request - Entry #1 by Anonymous User on May 6, 2003 5:09 am

When sending a SIGUSR2 signal to Zope process, log files are not closed and reopened correctly, so it's impossible to make a log rotation without restarting Zope...

My global process is just :
 - mv Z2.log Z2.log.0
 - kill -USR2 `cat Z2.pid`

Z2 events log says it's OK, but it's not !!
Log goes on in Z2.log.0 :-((

==============================================================




More information about the Zope-Collector-Monitor mailing list