[Zope-Coders] Signal forwarding

Toby Dickenson tdickenson@geminidataloggers.com
Tue, 8 Oct 2002 10:08:39 +0100


On Monday 07 Oct 2002 1:21 pm, Chris McDonough wrote:
> 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 signal=
s
> > 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?

Since looking into this pid issue I have discovered some other wierdness.

z2.py writes a Z2.pid file containing two pids - its own pid and its pare=
nts=20
pid.  If you are using a supervisor process then this parent pid is the=20
supervisor, otherwise it is likely to be the start script etc.

So why do we have the idiom that *both* of these processes need to be=20
signalled. Z2.pid is used in the default stop script, or the default log=20
rotation script in CHANGES.txt? Im sure it is not healthy for the stop sc=
ript=20
to be sending SIGINT to the pid of the long-dead start script.


In all of these cases I think the external scripts should be signalling:
1. the zope process if you are not using a supervisor process
2. the supervisor process, if you have one. it will do the right thing in=
=20
   forwarding signals on to the zope process.

Right now we dont have a pid file that always contains the one right pid=20
according to those rules, and Im not sure how we resolve this without=20
breaking somebody's current usage of the existing pid files....

any thoughts?