[patch] kill process after a timeout

Florent Thoumie flz at xbsd.org
Sun Jan 29 06:16:15 PST 2006


On Sunday 29 January 2006 14:38, Sam Lawrance wrote:
> http://people.freebsd.org/~lawrance/patch-rc.subr
>
> This patch adds the ${name}_stop_timeout variable.  When set, rather
> than simply wait on the PIDS after sending a -TERM signal, they will
> be kill -9'ed after the specified timeout in seconds.
>
> For example, with a tomcat script I'm working on, I set
> jakarta_tomcat41_stop_timeout=10, then
>
> # sh tomcat41.sh forcestop
> Stopping jakarta_tomcat41.
> Waiting (max 10 secs) for PIDS: 42864, 42864, 42864, 42864, 42864.
>
> I need to do something like this anyway with the tomcat rc scripts, I
> figure it might be a useful addition to rc.subr.
>
> Thoughts?

Looks good to me. But I wondered if we really have cases where we don't want 
to wait with some timeout. I guess I would have modified wait_for_pid to take 
$name_stop_timeout as a new argument (defaulting to 10, for example) instead 
of copying wait_for_pid to a new function.

My 0.02$ :)

-- 
Florent Thoumie
flz at FreeBSD.org
FreeBSD Committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20060129/2db5de40/attachment.bin


More information about the freebsd-rc mailing list