From owner-freebsd-rc@FreeBSD.ORG Sat Jun 19 09:48:15 2010 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 B8005106566B; Sat, 19 Jun 2010 09:48:14 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 3F4C08FC15; Sat, 19 Jun 2010 09:48:14 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 42EA435A864; Sat, 19 Jun 2010 11:48:13 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 395E91727C; Sat, 19 Jun 2010 11:48:13 +0200 (CEST) Date: Sat, 19 Jun 2010 11:48:13 +0200 From: Jilles Tjoelker To: Doug Barton Message-ID: <20100619094813.GA83874@stack.nl> References: <20100608214526.GB9977@stack.nl> <4C1A7F99.3030807@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C1A7F99.3030807@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-rc@FreeBSD.org Subject: Re: ugly output of wait_for_pids with kill(1) builtin 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: Sat, 19 Jun 2010 09:48:15 -0000 On Thu, Jun 17, 2010 at 01:03:37PM -0700, Doug Barton wrote: > On 06/08/10 14:45, Jilles Tjoelker wrote: > > I'm experimenting with making kill an sh(1) builtin (*). > > However, this > > makes wait_for_pids's output ugly: the kill builtin is too fast and > > almost always detects the process is still running or a zombie, so the > > Waiting for PIDS message appears for all daemons. > I'm guessing it only appears very briefly, right? I'm also not sure what > you mean by "too fast" here. The sending of the kill command happens in > _run_rc_killcmd, not wait_for_pids. They both use kill, _run_rc_killcmd to send a signal, and wait_for_pids to see if the process is gone. > It's probably also worth mentioning that out of 8 services that get > stopped at shutdown time I currently get the "waiting for pids" message > for 2-4 of them already, so I'm not sure what it is that you're > concerned about. > > Any ideas how to avoid this? > I'm not sure why you're concerned about the "Waiting for PIDS" message, > is your only issue that you find it aesthetically unappealing? The aesthetics are only a minor concern. The main problem is that when the waiting for pids message appears, there is a delay of at least one second. If this happens for a few services, the shutdown is delayed considerably. I know that syncing disks takes like ten seconds even when it has almost nothing to do, but that is a separate bug that should also be fixed. > > One such option would be some sort of modification to pwait(1). > What are you suggesting? Something involving the NOTE_REAP mentioned by rwatson and a timeout option in pwait(1) perhaps. -- Jilles Tjoelker