How to debug rc hangs?

Doug Barton dougb at FreeBSD.org
Wed Oct 24 15:30:20 PDT 2007


John,

Thanks for digging into this, a few comments in line.

On Wed, 24 Oct 2007, John Marshall wrote:

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

Ok, fair enough.

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

I think I understand that bit, thanks.

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

More good detective work! I have another idea though ...

> (If there was some way of tying ypbind and ypset together, I think that would 
> be a better solution.)

Well there are a couple ways of doing that. The least painful would be to 
change any REQUIRE lines that mention ypbind to mention ypset instead. 
ypset already has a REQUIRE for ypbind, so that would put them in the 
right order, and closer together. Since I know next to nothing about NIS 
though, I am hesitant to do that.

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

That's good news, I did notice something interesting though.

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

Here it comes before quota

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

Here it comes after.

Now mountd has:
# REQUIRE: NETWORKING nfsserver rpcbind quota

and there is a comment in quota that says:
must be after ypbind if using NIS

So I'm thinking that adding REQUIRE: ypset to quota might be the way to 
go. Can you try that fix instead and see if it works for you?

If you have time, I would also be interested to know if there are any 
changes if you take the current CVS code and just s/ypbind/ypset/ for all 
the scripts that currently REQUIRE ypbind. I'm not convinced that is the 
right answer yet, I'm just interested in what's going to happen.

Doug

-- 

     This .signature sanitized for your protection



More information about the freebsd-rc mailing list