From: Yves <yme...@pe...> - 2005-01-20 10:36:23
|
> In an attempt to figure out why the 'kill' does not induce the same > effect on Nagios, I concluded that the reason is that kill sends a > SIGTERM to perfparsed, which is nicely handled in log_reader.c. The > sighandler _closes all log sources_. > A simple exit somewehere in the application does not, and subsequent > write attempts to the pipe are hanging (blocked). > > Question 1: is my conclusion correct? I am not sure, but I would say yes. > Question 2: if so, is there any way you can catch an exit call with a > signal handler? Or should you use something like raise(SIGxxx) instead > of exit? Yes, and it is already implemented. We use atexit() to catch the exit call. When you kill the application, there is a signal handling, that only wait= for the end of critical operations before the normal behaviour that is leaving graciousl= y. When perfparsed exit, there are places where we cannot work with the atex= it() registered functions. So it does not exits with exit() but with _exit(). Maybe this = is where to change things ? But I have a better idea : what about creating our own exit() function, t= hat call the functions we register with atexit() ? And don't use exit(), _exit() and a= texit() at all ? This is some big development. Tim and Ben (and others) could you check if what I say is correct ? How m= uch work it represents ? If this is not too hard, maybe Bruno and Remi can do it ? (they have not been introduced yet, but I'm waiting that they manage to i= nstall nagios and perfparse : they began 2 days ago). > (Q3: has anyone else experienced this problem?) Maybe you should ask nagios mailing-list about this, to know if somebody = had this problem and how they solved it ? However, the bug is in perfparse, not in= nagios, and it has to be fixed in perfparse. Yves --=20 - Homepage - http://ymettier.free.fr - http://www.logicacmg.com - - GPG key - http://ymettier.free.fr/gpg.txt - - Maitretarot - http://www.nongnu.org/maitretarot/ - - Perfparse - http://perfparse.sf.net/ - |