From owner-freebsd-rc@FreeBSD.ORG Sun Jan 29 13:38:55 2006 Return-Path: X-Original-To: rc@FreeBSD.org Delivered-To: freebsd-rc@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6FC4416A420 for ; Sun, 29 Jan 2006 13:38:55 +0000 (GMT) (envelope-from boris@brooknet.com.au) Received: from mailout1.pacific.net.au (mailout1.pacific.net.au [61.8.0.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id B01B743D49 for ; Sun, 29 Jan 2006 13:38:53 +0000 (GMT) (envelope-from boris@brooknet.com.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87]) by mailout1.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id k0TDcoiA014011 for ; Mon, 30 Jan 2006 00:38:50 +1100 Received: from [61.8.44.207] (ppp2CCF.dyn.pacific.net.au [61.8.44.207]) by mailproxy2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id k0TDcmU0014602 for ; Mon, 30 Jan 2006 00:38:49 +1100 Mime-Version: 1.0 (Apple Message framework v746.2) Content-Transfer-Encoding: 7bit Message-Id: <61138162-C7EB-4DC8-B106-F060D468DE70@brooknet.com.au> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: rc@FreeBSD.org From: Sam Lawrance Date: Mon, 30 Jan 2006 00:38:50 +1100 X-Mailer: Apple Mail (2.746.2) Cc: Subject: [patch] kill process after a timeout X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2006 13:38:55 -0000 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?