|
From: | Pádraig Brady |
Subject: | Re: What signal should timeout send when it gets a SIGTERM? |
Date: | Mon, 08 Mar 2010 09:47:21 +0000 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100216 Thunderbird/3.0.2 |
On 08/03/10 07:17, Jim Meyering wrote:
Pádraig Brady wrote:Perhaps we could handle all cases with the equivalent of: if (sig==TERM&& user_sig==KILL) { send(sig); /* give chance to term gracefully */ sleep(1); send(KILL); /* nuke it from orbit */ }If the child program's signal-triggered clean-up code takes more than that one second, kill-9 would probably leave things in an inconsistent state.
Yes, that's true, and I'd be against doing the above as it could cause intermittent weird behavior. An alternative would be to add a new --kill-wait option which could be used to specify an additional timeout before a SIGKILL was sent. That would be a general mechanism to terminate "normally" after the timeout or when SIGTERM etc. is sent, but then always setup another timeout to send SIGKILL if the monitored command does not exit. cheers, Pádraig.
[Prev in Thread] | Current Thread | [Next in Thread] |