Bug 92523 - [patch] allow rc scripts to kill process after a timeout
Summary: [patch] allow rc scripts to kill process after a timeout
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 6.0-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2006-01-30 04:50 UTC by Sam Lawrance
Modified: 2018-01-03 05:16 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 Sam 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 Sam 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

Comment 5 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:31 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped