Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Oct 2007 22:17:14 +1000
From:      John Marshall <John.Marshall@riverwillow.com.au>
To:        Doug Barton <dougb@FreeBSD.org>
Cc:        "Brooks Davis <brooks@FreeBSD.org>; Mike Telahun Makonnen <mtm@freebsd.org>; freebsd-rc@FreeBSD.Org" <freebsd-rc@FreeBSD.org>
Subject:   Re: How to debug rc hangs?
Message-ID:  <471F37CA.1080005@riverwillow.com.au>
In-Reply-To: <alpine.BSF.0.9999.0710231038070.14145@qbhto.arg>
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> <alpine.BSF.0.9999.0710231038070.14145@qbhto.arg>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?471F37CA.1080005>