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? From owner-freebsd-rc@FreeBSD.ORG Sun Jan 29 14:16:15 2006 Return-Path: X-Original-To: freebsd-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 D16EF16A420 for ; Sun, 29 Jan 2006 14:16:15 +0000 (GMT) (envelope-from flz@xbsd.org) Received: from smtp.xbsd.org (xbsd.org [82.233.2.192]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B1A143D46 for ; Sun, 29 Jan 2006 14:16:15 +0000 (GMT) (envelope-from flz@xbsd.org) Received: from localhost (localhost.xbsd.org [127.0.0.1]) by smtp.xbsd.org (Postfix) with ESMTP id C40C211612; Sun, 29 Jan 2006 15:16:07 +0100 (CET) Received: from smtp.xbsd.org ([127.0.0.1]) by localhost (srv1.xbsd.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 38994-06; Sun, 29 Jan 2006 15:15:56 +0100 (CET) Received: from cream.xbsd.org (cream.xbsd.org [192.168.42.6]) by smtp.xbsd.org (Postfix) with ESMTP id 20F8B115A0; Sun, 29 Jan 2006 15:15:55 +0100 (CET) From: Florent Thoumie To: freebsd-rc@freebsd.org Date: Sun, 29 Jan 2006 15:15:41 +0100 User-Agent: KMail/1.8.2 References: <61138162-C7EB-4DC8-B106-F060D468DE70@brooknet.com.au> In-Reply-To: <61138162-C7EB-4DC8-B106-F060D468DE70@brooknet.com.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1317508.SaHREVnU65"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200601291515.47052.flz@xbsd.org> X-Virus-Scanned: amavisd-new at xbsd.org Cc: Sam Lawrance Subject: Re: [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 14:16:15 -0000 --nextPart1317508.SaHREVnU65 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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=3D10, 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 wan= t=20 to wait with some timeout. I guess I would have modified wait_for_pid to ta= ke=20 $name_stop_timeout as a new argument (defaulting to 10, for example) instea= d=20 of copying wait_for_pid to a new function. My 0.02$ :) =2D-=20 =46lorent Thoumie flz@FreeBSD.org =46reeBSD Committer --nextPart1317508.SaHREVnU65 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQBD3M4SMxEkbVFH3PQRAkCUAKCPPVXuyIeamA2qXRxxPWEt3bCJwgCeJGNG 8E0V07+hwmDZZFLGnoVg7tQ= =kcE/ -----END PGP SIGNATURE----- --nextPart1317508.SaHREVnU65-- From owner-freebsd-rc@FreeBSD.ORG Sun Jan 29 23:29:35 2006 Return-Path: X-Original-To: freebsd-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 28EA616A422 for ; Sun, 29 Jan 2006 23:29:35 +0000 (GMT) (envelope-from boris@brooknet.com.au) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E10143D6B for ; Sun, 29 Jan 2006 23:29:29 +0000 (GMT) (envelope-from boris@brooknet.com.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87]) by mailout2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id k0TNTQcx027766; Mon, 30 Jan 2006 10:29:26 +1100 Received: from [61.8.39.123] (ppp277B.dyn.pacific.net.au [61.8.39.123]) by mailproxy2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id k0TNTNfl002168; Mon, 30 Jan 2006 10:29:25 +1100 In-Reply-To: <200601291515.47052.flz@xbsd.org> References: <61138162-C7EB-4DC8-B106-F060D468DE70@brooknet.com.au> <200601291515.47052.flz@xbsd.org> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <6BAEAA5C-A4A2-4AD9-A658-A674749B20FF@brooknet.com.au> Content-Transfer-Encoding: 7bit From: Sam Lawrance Date: Mon, 30 Jan 2006 10:29:25 +1100 To: Florent Thoumie X-Mailer: Apple Mail (2.746.2) Cc: freebsd-rc@freebsd.org Subject: Re: [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 23:29:35 -0000 On 30/01/2006, at 1:15 AM, Florent Thoumie wrote: > 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$ :) We can't add a new optional argument without changing all the calls to it anyway, because it takes a variable of PIDs as arguments: wait_for_pids pid [pid ...] I thought it was better to create a new function, just in case there are other scripts and ports that use wait_for_pids. From owner-freebsd-rc@FreeBSD.ORG Mon Jan 30 05:14:06 2006 Return-Path: X-Original-To: rc@hub.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 90CB216A420; Mon, 30 Jan 2006 05:14:06 +0000 (GMT) (envelope-from lawrance@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4CD0F43D45; Mon, 30 Jan 2006 05:14:06 +0000 (GMT) (envelope-from lawrance@FreeBSD.org) Received: from freefall.freebsd.org (lawrance@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k0U5E6oE080794; Mon, 30 Jan 2006 05:14:06 GMT (envelope-from lawrance@freefall.freebsd.org) Received: (from lawrance@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k0U5E6Md080790; Mon, 30 Jan 2006 05:14:06 GMT (envelope-from lawrance) Date: Mon, 30 Jan 2006 05:14:06 GMT From: Sam Lawrance Message-Id: <200601300514.k0U5E6Md080790@freefall.freebsd.org> To: lawrance@FreeBSD.org, freebsd-bugs@FreeBSD.org, rc@FreeBSD.org Cc: Subject: Re: conf/92523: [patch] allow rc scripts to 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: Mon, 30 Jan 2006 05:14:06 -0000 Synopsis: [patch] allow rc scripts to kill process after a timeout Responsible-Changed-From-To: freebsd-bugs->rc Responsible-Changed-By: lawrance Responsible-Changed-When: Mon Jan 30 05:12:34 UTC 2006 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=92523 From owner-freebsd-rc@FreeBSD.ORG Mon Jan 30 11:02:47 2006 Return-Path: X-Original-To: freebsd-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 763FD16A420 for ; Mon, 30 Jan 2006 11:02:47 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 01C0B43D4C for ; Mon, 30 Jan 2006 11:02:45 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k0UB2joF019954 for ; Mon, 30 Jan 2006 11:02:45 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k0UB2ikF019948 for freebsd-rc@freebsd.org; Mon, 30 Jan 2006 11:02:44 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 30 Jan 2006 11:02:44 GMT Message-Id: <200601301102.k0UB2ikF019948@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-rc@FreeBSD.org Cc: Subject: Current problem reports assigned to you 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: Mon, 30 Jan 2006 11:02:47 -0000 Current FreeBSD problem reports Critical problems Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2005/02/10] conf/77340 rc awk used in /etc/rc.d/nsswitch when not a 1 problem total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2004/06/30] conf/68525 rc Loader's verbose boot mode has rc.d/local o [2004/11/11] conf/73834 rc Bad dependencies for /etc/rc.d/savecore o [2004/11/13] conf/73909 rc [patch] rc.d/sshd does not work with port o [2005/02/18] conf/77663 rc Suggestion: add /etc/rc.d/addnetswap afte o [2005/05/14] kern/81006 rc ipnat not working with tunnel interfaces o [2005/08/27] conf/85363 rc syntax error in /etc/rc.d/devfs o [2005/11/14] conf/88974 rc autoconfigured vlans confuse rc.d/netif 7 problems total. From owner-freebsd-rc@FreeBSD.ORG Mon Jan 30 11:06:02 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 EBF1016A420 for ; Mon, 30 Jan 2006 11:06:02 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7379043D55 for ; Mon, 30 Jan 2006 11:05:59 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k0UB5wRN023325 for ; Mon, 30 Jan 2006 11:05:58 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k0UB5vQa023318 for rc@freebsd.org; Mon, 30 Jan 2006 11:05:57 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 30 Jan 2006 11:05:57 GMT Message-Id: <200601301105.k0UB5vQa023318@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: rc@FreeBSD.org Cc: Subject: Current problem reports assigned to you 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: Mon, 30 Jan 2006 11:06:03 -0000 Current FreeBSD problem reports Critical problems Serious problems Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2006/01/30] conf/92523 rc [patch] allow rc scripts to kill process 1 problem total. From owner-freebsd-rc@FreeBSD.ORG Thu Feb 2 11:58:41 2006 Return-Path: X-Original-To: freebsd-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 AFCD316A431 for ; Thu, 2 Feb 2006 11:58:41 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (comp.chem.msu.su [158.250.32.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id E8DBA43D53 for ; Thu, 2 Feb 2006 11:58:35 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.13.3/8.13.3) with ESMTP id k12Bw30t000213; Thu, 2 Feb 2006 14:58:03 +0300 (MSK) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.13.3/8.13.3/Submit) id k12Bw1tX000207; Thu, 2 Feb 2006 14:58:01 +0300 (MSK) (envelope-from yar) Date: Thu, 2 Feb 2006 14:58:01 +0300 From: Yar Tikhiy To: Sam Lawrance Message-ID: <20060202115800.GI29980@comp.chem.msu.su> References: <61138162-C7EB-4DC8-B106-F060D468DE70@brooknet.com.au> <200601291515.47052.flz@xbsd.org> <6BAEAA5C-A4A2-4AD9-A658-A674749B20FF@brooknet.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6BAEAA5C-A4A2-4AD9-A658-A674749B20FF@brooknet.com.au> User-Agent: Mutt/1.5.9i Cc: freebsd-rc@freebsd.org Subject: Re: [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: Thu, 02 Feb 2006 11:58:41 -0000 On Mon, Jan 30, 2006 at 10:29:25AM +1100, Sam Lawrance wrote: > > On 30/01/2006, at 1:15 AM, Florent Thoumie wrote: > > >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$ :) > > We can't add a new optional argument without changing all the calls > to it anyway, because it takes a variable of PIDs as arguments: > > wait_for_pids pid [pid ...] > > I thought it was better to create a new function, just in case there > are other scripts and ports that use wait_for_pids. I wonder why we haven't begun using POSIX getopts in rc.subr functions yet. Some of them are asking for it. In this case: wait_for_pids [-t timeout] pid ... Pretty neat, huh? :-) -- Yar From owner-freebsd-rc@FreeBSD.ORG Thu Feb 2 12:04:20 2006 Return-Path: X-Original-To: freebsd-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 49DED16A422 for ; Thu, 2 Feb 2006 12:04:20 +0000 (GMT) (envelope-from boris@brooknet.com.au) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 78C6143D5A for ; Thu, 2 Feb 2006 12:04:18 +0000 (GMT) (envelope-from boris@brooknet.com.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id k12C3aJ0020428; Thu, 2 Feb 2006 23:03:37 +1100 Received: from [61.8.44.18] (ppp2C12.dyn.pacific.net.au [61.8.44.18]) by mailproxy1.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id k12C3X76002550; Thu, 2 Feb 2006 23:03:34 +1100 In-Reply-To: <20060202115800.GI29980@comp.chem.msu.su> References: <61138162-C7EB-4DC8-B106-F060D468DE70@brooknet.com.au> <200601291515.47052.flz@xbsd.org> <6BAEAA5C-A4A2-4AD9-A658-A674749B20FF@brooknet.com.au> <20060202115800.GI29980@comp.chem.msu.su> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <5FBC5173-5B69-4CA0-9152-4BF14357E4D8@brooknet.com.au> Content-Transfer-Encoding: 7bit From: Sam Lawrance Date: Thu, 2 Feb 2006 23:03:41 +1100 To: Yar Tikhiy X-Mailer: Apple Mail (2.746.2) Cc: freebsd-rc@freebsd.org Subject: Re: [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: Thu, 02 Feb 2006 12:04:20 -0000 On 02/02/2006, at 10:58 PM, Yar Tikhiy wrote: > On Mon, Jan 30, 2006 at 10:29:25AM +1100, Sam Lawrance wrote: >> >> On 30/01/2006, at 1:15 AM, Florent Thoumie wrote: >> >>> 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$ :) >> >> We can't add a new optional argument without changing all the calls >> to it anyway, because it takes a variable of PIDs as arguments: >> >> wait_for_pids pid [pid ...] >> >> I thought it was better to create a new function, just in case there >> are other scripts and ports that use wait_for_pids. > > I wonder why we haven't begun using POSIX getopts in rc.subr functions > yet. Some of them are asking for it. In this case: > > wait_for_pids [-t timeout] pid ... > > Pretty neat, huh? :-) You know, it never even crossed my mind. I'll make some changes and follow up to the PR. Thanks! From owner-freebsd-rc@FreeBSD.ORG Fri Feb 3 12:13:26 2006 Return-Path: X-Original-To: freebsd-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 CD4B316A420 for ; Fri, 3 Feb 2006 12:13:26 +0000 (GMT) (envelope-from matthieu.michaud@epita.info) Received: from marge.cload.net (marge.cload.net [213.41.172.209]) by mx1.FreeBSD.org (Postfix) with SMTP id F0DC043D46 for ; Fri, 3 Feb 2006 12:13:25 +0000 (GMT) (envelope-from matthieu.michaud@epita.info) Received: (qmail 3346 invoked by uid 100); 3 Feb 2006 13:18:32 +0100 Received: from homer.cload.net (HELO moe.lan) (213.41.241.56) by marge.cload.net with SMTP; 3 Feb 2006 13:18:32 +0100 From: Matthieu Michaud To: freebsd-rc@freebsd.org In-Reply-To: <1138042564.933.14.camel@localhost> References: <1138042564.933.14.camel@localhost> Content-Type: text/plain Organization: EPITA SRS 2007 Date: Fri, 03 Feb 2006 13:12:04 +0100 Message-Id: <1138968724.38904.13.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.4.2.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Subject: Re: gif_up with ipv6 transport layer 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: Fri, 03 Feb 2006 12:13:26 -0000 On Mon, 2006-01-23 at 19:56 +0100, Matthieu Michaud wrote: found it ! just replace those lines : > gifconfig_gif0="2001:7a8:6cd1::caca 2001:7a8:b138::caca" ipv6_ifconfig_gif0="tunnel 2001:7a8:6cd1::caca 2001:7a8:b138::caca" > gifconfig_gif0="inet6 tunnel 2001:7a8:b138::caca 2001:7a8:6cd1::caca" ipv6_ifconfig_gif0="tunnel 2001:7a8:b138::caca 2001:7a8:6cd1::caca" thanks to flz. -- Matthieu Michaud EPITA SRS 2007