Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Jun 2010 17:10:55 -0700
From:      Doug Barton <dougb@FreeBSD.org>
To:        Jilles Tjoelker <jilles@stack.nl>
Cc:        freebsd-rc@FreeBSD.org
Subject:   Re: ugly output of wait_for_pids with kill(1) builtin
Message-ID:  <4C1D5C8F.6070404@FreeBSD.org>
In-Reply-To: <20100619094813.GA83874@stack.nl>
References:  <20100608214526.GB9977@stack.nl> <4C1A7F99.3030807@FreeBSD.org> <20100619094813.GA83874@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On 06/19/10 02:48, Jilles Tjoelker wrote:
> 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.

Right, I'm not confused about where kill is used, I'm confused regarding 
what you mean by "too fast."

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

The sleep only happens if the pid still exists the second time through 
the loop. In my experience even when I see the "waiting for pids" 
message there is no delay. I'll patch my rc.subr to display something 
when the sleep happens just to be sure.

> If this happens for a few services, the shutdown is delayed
> considerably.

Yes, I agree that were this happening it would be an issue.

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

I am not sure how moving the timeout would help the "delaying the boot" 
issue, although I would certainly not want to dissuade you from 
improving on pwait. :)


Doug

-- 

	... and that's just a little bit of history repeating.
			-- Propellerheads

	Improve the effectiveness of your Internet presence with
	a domain name makeover!    http://SupersetSolutions.com/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C1D5C8F.6070404>