Bug 92523 - [patch] allow rc scripts to kill process after a timeout
[patch] allow rc scripts to kill process after a timeout
Status: In Progress
Product: Base System
Classification: Unclassified
Component: conf
Any Any
: Normal Affects Only Me
Assigned To: freebsd-rc
Depends on:
  Show dependency treegraph
Reported: 2006-01-30 04:50 UTC by lawrance
Modified: 2012-11-30 09:50 UTC (History)
0 users

See Also:

patch-rc.subr (1.46 KB, application/octet-stream)
2012-11-30 09:48 UTC, mitsururike
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description lawrance freebsd_committer 2006-01-30 04:50:02 UTC
	Services stopped with a new style rc script wait indefinitely for the
process to die (using the default behaviour).  For some services which become
wedged sometimes and don't respond to a TERM signal, it would be useful to
be able to kill the process after a timeout.



This patch adds the wait_max_for_pids function.  It is similar to wait_for_pids
but the first argument is a timeout which specifies the maximum amount of time
to wait.

The default stop sequence is then changed to check the ${name}_stop_timeout
variable.  If it is set, the script will call wait_max_for_pids and the process
will be killed after the timeout.

If ${name}_stop_timeout is unset it the script will use wait_for_pids (ie behaviour
Comment 1 lawrance freebsd_committer 2006-01-30 05:12:34 UTC
Responsible Changed
From-To: freebsd-bugs->rc

Over to maintainer(s).
Comment 2 Chris Rees freebsd_committer 2012-11-01 17:57:25 UTC
State Changed
From-To: open->feedback

Oops, this is so old you must have removed the patchfile!  Perhaps it 
would be just as easy to test for the _stop_timeout variable inside 
Comment 3 mitsururike 2012-11-30 04:52:55 UTC
It is archived at

Comment 4 mitsururike 2012-11-30 09:48:08 UTC
I have modified the patch.
 - to be applied cleanly for 8.2-RELEASE ( and 9-STABLE).
 - introduce default_stop_timeout
 - kill -KILL only if timeout