Re: How to shoot yourself in the foot: kill -9 postmaster
От | Lamar Owen |
---|---|
Тема | Re: How to shoot yourself in the foot: kill -9 postmaster |
Дата | |
Msg-id | 3AA4475A.B55ADC7E@wgcr.org обсуждение исходный текст |
Ответ на | Re: How to shoot yourself in the foot: kill -9 postmaster (Bruce Momjian <pgman@candle.pha.pa.us>) |
Ответы |
Re: How to shoot yourself in the foot: kill -9 postmaster
Re: How to shoot yourself in the foot: kill -9 postmaster |
Список | pgsql-hackers |
Tom Lane wrote: > > Bruce Momjian <pgman@candle.pha.pa.us> writes: > > killproc should send a kill -15 to the process, wait a few seconds for > > it to exit. If it does not, try kill -1, and if that doesn't kill it, > > then kill -9. > > Tell it to the Linux people ... this is their boot-script code we're > talking about. RedHat, in particular. I can't vouch for any others. On my RH 6.2 box, with initscripts-5.00-1 loaded, here's what killproc does if no killlevel is set (even though a default $killlevel is set to -9, it's not used in this code): ($pid is the pid of the proc to kill, $base is the name of the proc, etc) if [ "$notset" = "1" ] ; then if ps h $pid>/dev/null 2>&1; then # TERM first, then KILL if not dead kill-TERM $pid usleep 100000 if ps h $pid >/dev/null 2>&1 ; then sleep 1 if ps h $pid >/dev/null2>&1 ; then sleep 3 if ps h $pid >/dev/null 2>&1 ; then kill -KILL $pid fi fi fi fi ps h $pid >/dev/null 2>&1 RC=$? [ $RC -eq 0 ] && failure "$baseshutdown" || success "$base shutdown" RC=$((! $RC)) # use specified level only else if ps h $pid >/dev/null 2>&1; then kill $killlevel$pid RC=$? [ $RC -eq 0 ] && success "$base $killlevel" || failure "$base $killlevel" fi fi Is 6.1 this different from 6.2? This code on the surface seems reasonable to me -- am I missing something? The 6.2 code (found in /etc/rc.d/init.d/functions, for those who might not know where to find killproc) sets a default killlevel but never uses it -- ignorant but not stupid. -- Lamar Owen WGCR Internet Radio 1 Peter 4:11
В списке pgsql-hackers по дате отправления: