开发者

Configuration location for timeout for SIGTERM handlers before killing the process when Linux shuts down

I'm trying to debug a java shutd开发者_C百科ownhook problem. These shutdown hooks use SIGTERM + a watchdog thread. I suspect either a bug in the watchdog thread or a bug in my serialization process, but can't eliminate the second possibility, since i can't debug (even writing to file), so i'd like to increase the timeout to debug, but i don't know where that value is.

Edit: i'm on ubuntu


Regarding the default SIGTERM timeout,

For Upstart in Ubuntu, it is apparently 5 seconds.

For killproc in the Red Hat family, it is apparently at least 1 + 3 = 4 seconds. It is unclear to me if this has changed in a newer version of the function.

This answer is in the community wiki.


According to /etc/rc.d/rc0.d/S01halt on my Fedora 12 system, it's 2 seconds:

kill_all $"Sending all processes the TERM signal..." -15 $OMITARGS
# No need to sleep and kill -9 if no processes to kill were found
if [ "$?" == 0 ]; then
    sleep 2
    kill_all $"Sending all processes the KILL signal..." -9 $OMITARGS
fi

On Ubuntu (10.04, at least), the code is in /etc/init.d/sendsigs. It waits up to 10 seconds for processes to terminate before sending SIGKILL to any that remain.

Rather than changing the timeout, though, it might be better to try shutting down the app yourself (kill 12345 where 12345 is the app's PID).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜