[Zope-Coders] Signal forwarding

Chris McDonough chrism@zope.com
07 Oct 2002 08:21:44 -0400


Yikes.  Yes, that looks right...

On Mon, 2002-10-07 at 08:52, Toby Dickenson wrote:
> What happens when Zope or ZEO is run under a supervisor process, and the 
> supervisor process receives a signal such as SIGINT? The intention is that it 
> should forward the signal on to the server process.
> 
> This mechanism is currently very broken, due to the typo fixed in the patch 
> below.
> 
> This is definitely a problem that needs fixing - currently the signals get 
> forwarded get forwarded to the wrong processes, which could be disasterous if 
> the supervisor process is running as root.
> 
> Can anyone see a problem with this fix?
> 
> 
> Index: Daemon.py
> ===================================================================
> RCS file: /cvs-repository/Zope/lib/python/zdaemon/Daemon.py,v
> retrieving revision 1.11
> diff -c -2 -r1.11 Daemon.py
> *** Daemon.py   14 Aug 2002 22:12:52 -0000      1.11
> --- Daemon.py   7 Oct 2002 12:43:46 -0000
> ***************
> *** 43,47 ****
>                   # ie. HUP, INT, QUIT, USR1, USR2, TERM
>                   for sig in interesting:
> !                     signal.signal(sig, SignalPasser(sig))
>                   pstamp('Houston, we have forked: pid %s' % pid, zLOG.INFO)
>                   write_pidfile(pidfile)
> --- 43,47 ----
>                   # ie. HUP, INT, QUIT, USR1, USR2, TERM
>                   for sig in interesting:
> !                     signal.signal(sig, SignalPasser(pid))
>                   pstamp('Houston, we have forked: pid %s' % pid, zLOG.INFO)
>                   write_pidfile(pidfile)
> 
> 
> _______________________________________________
> Zope-Coders mailing list
> Zope-Coders@zope.org
> http://lists.zope.org/mailman/listinfo/zope-coders