Bug 92523

Summary: [patch] allow rc scripts to kill process after a timeout
Product: Base System Reporter: Sam Lawrance <lawrance>
Component: confAssignee: freebsd-rc (Nobody) <rc>
Status: Open ---    
Severity: Affects Only Me Keywords: patch
Priority: Normal    
Version: 6.0-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch-rc.subr none

Description Sam Lawrance freebsd_committer freebsd_triage 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.

Fix: 

http://people.freebsd.org/~lawrance/patch-rc.subr

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
unchanged).
Comment 1 Sam Lawrance freebsd_committer freebsd_triage 2006-01-30 05:12:34 UTC
Responsible Changed
From-To: freebsd-bugs->rc

Over to maintainer(s).
Comment 2 Chris Rees freebsd_committer freebsd_triage 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 
wait_for_pids?
Comment 3 mitsururike 2012-11-30 04:52:55 UTC
It is archived at
http://web.archive.org/web/20060921232848/http://people.freebsd.org/~lawrance/patch-rc.subr

--
mitsuru
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

--
mitsuru
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
Comment 6 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:33:51 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>
Comment 7 Mark Linimon freebsd_committer freebsd_triage 2023-12-31 01:35:31 UTC
Comment on attachment 61785 [details]
patch-rc.subr

^Triage: convert this to text/plain and set the Patch flag so that the
automation can see it.