From owner-freebsd-rc@FreeBSD.ORG Wed Oct 24 12:17:49 2007 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 7DC0A16A420; Wed, 24 Oct 2007 12:17:49 +0000 (UTC) (envelope-from John.Marshall@riverwillow.com.au) Received: from mail2.riverwillow.net.au (ns2.riverwillow.net.au [203.58.93.41]) by mx1.freebsd.org (Postfix) with ESMTP id D682013C4B3; Wed, 24 Oct 2007 12:17:48 +0000 (UTC) (envelope-from John.Marshall@riverwillow.com.au) Received: from rwmail.mby.riverwillow.net.au (rwsrv06.rw2.riverwillow.net.au [172.25.25.16]) by mail2.riverwillow.net.au (8.14.1/8.14.1) with ESMTP id l9OCHYVI077609; Wed, 24 Oct 2007 22:17:34 +1000 (AEST) Received: from [172.25.25.68] ([172.25.25.68] RDNS failed) by rwmail.mby.riverwillow.net.au with Microsoft SMTPSVC(6.0.3790.3959); Wed, 24 Oct 2007 22:17:33 +1000 Message-ID: <471F37CA.1080005@riverwillow.com.au> Date: Wed, 24 Oct 2007 22:17:14 +1000 From: John Marshall Organization: Riverwillow Pty Ltd User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Doug Barton References: <471D7F68.8070308@riverwillow.com.au> <584bfc3f0710230505i29e8f19aofc4e66d0aee7b7c1@mail.gmail.com> <471DFFD0.8020701@riverwillow.com.au> <20071023155932.GA37204@lor.one-eyed-alien.net> <471E27E5.4030609@riverwillow.com.au> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 24 Oct 2007 12:17:33.0782 (UTC) FILETIME=[DB453F60:01C81637] Cc: "Brooks Davis ; Mike Telahun Makonnen ; freebsd-rc@FreeBSD.Org" Subject: Re: How to debug rc hangs? 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: Wed, 24 Oct 2007 12:17:49 -0000 Doug Barton wrote: > On Wed, 24 Oct 2007, John Marshall wrote: >> Here is the fix. All happy now - but not much the wiser as to rc >> troubleshooting techniques. >> >> ----------------------------------------------- >> --- /usr/src/etc/rc.d/ypset 2007-10-12 12:38:42.000000000 +1000 >> +++ /etc/rc.d/ypset 2007-10-24 02:31:32.000000000 +1000 >> @@ -5,6 +5,7 @@ >> >> # PROVIDE: ypset >> # REQUIRE: ypbind >> +# BEFORE: mountd >> >> . /etc/rc.subr > > In regards to your proposed solution, I would like to explore this with > you a little. In general it would be preferred to add REQUIRE: ypset in > mountd instead of using BEFORE. This makes debugging easier down the road. Thanks Doug. No problem. I used your /etc/rc debug patch to produce rc.late files for a few different scenarios and include diffs from those below. > My concern is that in my rcorder (basically stock RELENG_6 with some > ports) ypxfrd, ypudated, and ypset are all running in that order, and > late in the overall order. I'm concerned that if we move ypset earlier > (and mountd is run a lot earlier than those 3) it will have other side > effects. I also noticed that ypserv and ypbind are run much than even > mountd, and since I don't use NIS I don't really know what those side > effects might be (if any). It looks to me like the only reason why ypset runs so late is that there are no REQUIRE/BEFORE constraints requiring it to run earlier - and I think there should be. ---- ypset(8) ---- NAME ypset -- tell ypbind(8) which YP server process to use ------------------ The sole purpose of ypset is to get ypbind working. Anything which has a dependency on the NIS client (ypbind) is going to stall if ypbind is stalled waiting to find a NIS server. I have no NIS experience beyond this particular network, but my guess is that most systems wouldn't be relying on ypset to get ypbind functioning, so most people wouldn't hit this problem. If ypset is unused, who cares where it sits in the rc order? If it is used, then it really needs to kick in very soon after ypbind and before anything that requires ypbind. Having delved a bit further into this, I think that mountd was probably actually waiting on nfsserver, and that nfsserver has the implicit dependency on ypbind. So, I added ypset to the REQUIRE list in rc.d/nfsserver - and it works. So, my revised proposed solution (which works fine for me) is: ----------------- --- /usr/src/etc/rc.d/nfsserver 2007-10-12 12:38:42.000000000 +1000 +++ /etc/rc.d/nfsserver 2007-10-24 21:01:37.000000000 +1000 @@ -4,7 +4,7 @@ # # PROVIDE: nfsserver -# REQUIRE: NETWORKING mountcritremote +# REQUIRE: NETWORKING mountcritremote ypset # KEYWORD: nojail . /etc/rc.subr ----------------- (If there was some way of tying ypbind and ypset together, I think that would be a better solution.) ...and the diff's resulting from various experiments with your debug patch applied to /etc/rc (thanks!). In each case, the only thing that moves is ypset - and in the first two scenarios yield identical results. ----------------- --- rc.late.standard 2007-10-24 08:54:59.000000000 +1000 +++ rc.late.ypset_before_mountd 2007-10-24 08:53:59.000000000 +1000 @@ -65,6 +65,7 @@ /etc/rc.d/kadmind /etc/rc.d/keyserv /etc/rc.d/kpasswdd +/etc/rc.d/ypset /etc/rc.d/quota /etc/rc.d/nfsserver /etc/rc.d/mountd @@ -115,7 +116,6 @@ /usr/local/etc/rc.d/apache22 /etc/rc.d/ypxfrd /etc/rc.d/ypupdated -/etc/rc.d/ypset /etc/rc.d/watchdogd /etc/rc.d/syscons /etc/rc.d/sshd ----------------- ----------------- --- rc.late.standard 2007-10-24 08:54:59.000000000 +1000 +++ rc.late.mountd_requires_ypset 2007-10-24 08:55:44.000000000 +1000 @@ -65,6 +65,7 @@ /etc/rc.d/kadmind /etc/rc.d/keyserv /etc/rc.d/kpasswdd +/etc/rc.d/ypset /etc/rc.d/quota /etc/rc.d/nfsserver /etc/rc.d/mountd @@ -115,7 +116,6 @@ /usr/local/etc/rc.d/apache22 /etc/rc.d/ypxfrd /etc/rc.d/ypupdated -/etc/rc.d/ypset /etc/rc.d/watchdogd /etc/rc.d/syscons /etc/rc.d/sshd ----------------- ----------------- --- rc.late.standard 2007-10-24 08:54:59.000000000 +1000 +++ rc.late.nfsserver_requires_ypset 2007-10-24 21:06:23.000000000 +1000 @@ -66,6 +66,7 @@ /etc/rc.d/keyserv /etc/rc.d/kpasswdd /etc/rc.d/quota +/etc/rc.d/ypset /etc/rc.d/nfsserver /etc/rc.d/mountd /etc/rc.d/nfsd @@ -115,7 +116,6 @@ /usr/local/etc/rc.d/apache22 /etc/rc.d/ypxfrd /etc/rc.d/ypupdated -/etc/rc.d/ypset /etc/rc.d/watchdogd /etc/rc.d/syscons /etc/rc.d/sshd ----------------- -- John Marshall