From owner-freebsd-rc@FreeBSD.ORG Sun Dec 20 21:48:47 2009 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2241A106566C for ; Sun, 20 Dec 2009 21:48:47 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id DE62C8FC15 for ; Sun, 20 Dec 2009 21:48:46 +0000 (UTC) Received: from toad.stack.nl (toad.stack.nl [IPv6:2001:610:1108:5010::135]) by mx1.stack.nl (Postfix) with ESMTP id 4374D1DD62C for ; Sun, 20 Dec 2009 22:48:46 +0100 (CET) Received: by toad.stack.nl (Postfix, from userid 1677) id 2B73073F9F; Sun, 20 Dec 2009 22:48:46 +0100 (CET) Date: Sun, 20 Dec 2009 22:48:46 +0100 From: Jilles Tjoelker To: freebsd-rc@freebsd.org Message-ID: <20091220214846.GA66977@stack.nl> References: <20091220143623.GC46060@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091220143623.GC46060@stack.nl> User-Agent: Mutt/1.5.18 (2008-05-17) Subject: Re: [PATCH] use pwait in wait_for_pids 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, 20 Dec 2009 21:48:47 -0000 On Sun, Dec 20, 2009 at 03:36:23PM +0100, Jilles Tjoelker wrote: > Here is a patch to use the new pwait utility in wait_for_pids. > This patch still works if pwait is not available, using the old sleep > method. > The redirection on the pwait command serves to squelch "No such process" > and "pwait: not found" errors. The braces are necessary to redirect the > "not found" error even for sh(1) that doesn't have the fix in r197820 > (which has not been MFC'ed). It seems the mailing list ate the patch (strange, text/x-diff attachments used to work), so I will put it inline here: Index: etc/rc.subr =================================================================== --- etc/rc.subr (revision 200442) +++ etc/rc.subr (working copy) @@ -390,7 +390,11 @@ _list=$_nlist echo -n ${_prefix:-"Waiting for PIDS: "}$_list _prefix=", " - sleep 2 + if { pwait $_list; } 2>/dev/null; then + break + else + sleep 2 + fi done if [ -n "$_prefix" ]; then echo "." -- Jilles Tjoelker