[bind10-dev] shutdown problem
Shane Kerr
shane at isc.org
Wed Oct 6 14:04:13 UTC 2010
All,
On Mon, 2010-09-27 at 22:19 +0900, JINMEI Tatuya / 神明達哉 wrote:
> At Mon, 27 Sep 2010 20:18:11 +0800,
> "Likun Zhang" <zlkzhy at gmail.com> wrote:
>
> > When I checking the code , I find almost all the processes(msgq, cfgmgr,
> > auth, xfrout,xfrin) have catched the signal 'SIGINT', besides boss process.
> > As my understanding, the expected shutdown process should be: send the
> > "shutdown" command to boss, then boss will send the 'shutdown' command to
> > separate sub process.
> >
> > The current behavior is: when user enter 'ctrl + c', every process will exit
> > automatically by itself(xfrout and zonemgr can't do it now, I am fixing it),
> > is it the shutdown way we expect? Did we plan to provide two ways to
> > shutdown bind10?
>
> I think we expect that behavior. IMO, it's something like 'rndc stop'
> vs Ctl-C. While the most sophisticated way of shutdown is 'rndc
> stop', we still allow Ctl-C as an alternative and users would expect
> it to work.
>
> We should also note that Ctl-C only works if the processes are working
> foreground. Sending a SIGTERM by kill(1) or other tools should work,
> but would be less common for multi-process systems like BIND 10. So
> we'll need the shutdown command, too.
I agree with Jinmei's analysis here, but have a further question.
Since (almost?) every BIND 10 process will want to handle SIGINT and
SIGTERM and so on in a "clean" fashion, does it make sense to provide a
simple library that makes the right thing happen?
For C++ programs this is not a problem - the program exits, which it has
to be prepared to do in any case (due to power outage, or SIGKILL, or
kernel panic). If the program wants to do more, it can intercept these
calls using normal Unix signal handling.
So the main problem is Python programs. We could make a simple module
used like:
import bind10shutdown
This could then be something like:
import signal
import sys
def fatal_signal(signal_number, stack_frame):
sys.exit(1)
signal.signal(signal.SIGINT, fatal_signal)
signal.signal(signal.SIGTERM, fatal_signal)
I think if we used something like this in our various Python programs we
would be okay.
Opinions?
--
Shane
More information about the bind10-dev
mailing list