Antwort: [RFC] Missing signal handling in ndo2db

Sascha.Runschke at gfkl.com Sascha.Runschke at gfkl.com
Wed Jul 1 15:23:14 CEST 2009


> regarding the flat ndo2db init script with it's tough "killall
> ndo2db..." I reviewed the signal processing in ndo2db.
> 
> Intro:
> As we know ndo2db forks first to become a daemon, no problem up to here,
> and forks again for each client connection.
> Each client connection has the daemon as session leader but if we send
> this leader a SIGTERM the parent process is exiting, deleting the
> socket, cleaning up and 'over and out'.
> Bad thing: The forked connection child is still alive, hanging around in
> read() from the (non existing) socket descriptor.

In my opinion ndo is totally missing a proper handling of itself and
its children. What you describe is just a designflaw in my eyes.

What ndo2db should have:

- a pidfile handling via /var/run
- a subsys handling via /var/lock/subsys

So it makes it easier to identify ndo2db processes and handle them
properly.

If ndo is getting pushed again now, I'm more then happy to contribute
my init script, which is much more sophisticated then the usual
one. Put it to good use :) I'll attach it as file, so the indenting
doesn't get broken.

But - I wrote it for RedHat Enterprise Linux 5 and I am not sure
how well it works on other distributions. I always wanted to take
a look into that, but I'm currently under too much pressure at work
here.

Regards
        Sascha





GFKL Financial Services AG
Vorstand: Dr. Peter Jänsch (Vors.), Jürgen Baltes, Dr. Tom Haverkamp
Vorsitzender des Aufsichtsrats: Dr. Georg F. Thoma
Sitz: Limbecker Platz 1, 45127 Essen, Amtsgericht Essen, HRB 13522
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20090701/1ffffcfa/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ndo2db
Type: application/octet-stream
Size: 2687 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20090701/1ffffcfa/attachment.obj>
-------------- next part --------------
------------------------------------------------------------------------------
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list