SIGINT handler not set correctly when debugging
Hi, obviously, the SIGINT handler for clean shutdown when running in debug mode isn't set up correctly: Index: src/main/radiusd.c =================================================================== RCS file: /source/radiusd/src/main/radiusd.c,v retrieving revision 1.370 diff -u -r1.370 radiusd.c --- src/main/radiusd.c 12 Jun 2007 09:16:26 -0000 1.370 +++ src/main/radiusd.c 10 Aug 2007 07:24:45 -0000 @@ -475,7 +475,7 @@ * server to die immediately. Use SIGTERM to shut down * the server cleanly in that case. */ - if ((debug_memory == 1) || (debug_flag == 0)) { + if ((debug_memory == 1) || (debug_flag != 0)) { #ifdef HAVE_SIGACTION act.sa_handler = sig_fatal; sigaction(SIGINT, &act, NULL); Enrik
Enrik Berkhan wrote:
obviously, the SIGINT handler for clean shutdown when running in debug mode isn't set up correctly:
I'm not so sure. When debugging, you don't care if the server dies without shutting down cleanly on CTRL-C. When running in daemon mode, it should shut down cleanly. Then again, SIGTERM is for clean shutdowns in daemon mode. Alan DeKok.
Alan DeKok wrote:
Enrik Berkhan wrote:
obviously, the SIGINT handler for clean shutdown when running in debug mode isn't set up correctly:
I'm not so sure. When debugging, you don't care if the server dies without shutting down cleanly on CTRL-C. When running in daemon mode, it should shut down cleanly.
I do care because my embedded perl code does some resource cleanup on shutdown that should be done even when debugging ;-) And CTRL-C aka SIGINT is the typical way of shutting down in debug mode. Killing with SIGTERM isn't as easy as typing CTRL-C ...
Then again, SIGTERM is for clean shutdowns in daemon mode.
That's right and that's why I think SIGINT should be handled specially in debugging mode, not in daemon mode. Enrik
participants (2)
-
Alan DeKok -
Enrik Berkhan