when I kill (TERM) nsd under no load, it shuts down completely, including
anything I have registered with ns_atshutdown. Under load (real users or
apache bench) however none of the RegisterAtShutdown stuff runs; neither
mine, nor stuff like nssock that uses that to register its cleanup routine.
log from no load:
Notice: nsmain: AOLserver/3.3.1+ad13 stopping
Notice: nssock: triggering shutdown
Notice: serv: stopping connection threads
Notice: serv: connection threads stopped
Notice: sched: shutdown pending
Notice: exiting
Notice: socks: shutdown pending
Notice: nscp: shutdown
Notice: socks: shutdown complete
Notice: sched: shutdown started
Notice: sched: shutdown complete
Notice: at shutdown ** (my call) **
Notice: nslog: closing '/home/aolserver/log/sfr/sfr_access.log'
Notice: nssock: shutdown complete
Notice: nsmain: AOLserver/3.3.1+ad13 exiting
log with load:
Notice: nsmain: AOLserver/3.3.1+ad13 stopping
Notice: nssock: triggering shutdown
Notice: serv: stopping connection threads
Notice: serv: connection threads stopped
Notice: exiting
running in gdb looks like this
...
[New Thread 16401 (LWP 24378)]
Delayed SIGSTOP caught for LWP 24378.
Program received signal SIGTERM, Terminated.
[Switching to Thread 1024 (LWP 24349)]
0x40131544 in read () from /lib/libc.so.6
(gdb) bt
#0 0x40131544 in read () from /lib/libc.so.6
#1 0x40037c9c in __DTOR_END__ () from /lib/libpthread.so.0
#2 0x080941f7 in NsHandleSignals () at unix.c:199
#3 0x08077a9f in Ns_Main (argc=10, argv=0xbffffa54,
initProc=0x8074d10 <ServerInit>) at nsmain.c:710
#4 0x08074cfb in main (argc=10, argv=0xbffffa54) at main.c:64
#5 0x400760de in __libc_start_main () from /lib/libc.so.6
this is AOLServer 3.3.1.
-Jonathan