Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Apr 2011 18:40:24 -0400 (EDT)
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        Doug Barton <dougb@FreeBSD.org>
Cc:        rc@freebsd.org
Subject:   Re: rc scripts change for review
Message-ID:  <1308036720.478939.1303598424273.JavaMail.root@erie.cs.uoguelph.ca>
In-Reply-To: <4DB3089E.3070304@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> > One thing I am not sure about is the REQUIRE: list in mountd.
> > nfsserver and nfssrv essentially load the respective module. They
> > are only
> > used if sysctl variables need to be set and that's actually done by
> > nfsd.
> > (Should they be listed in mountd or nfsd or ???)
> 
> It's not a good idea to add single scripts that only have a tiny
> function, especially if they are only called conditionally (I.e., they
> contain KEYWORD: nostart). It's preferred to handle these things
> things
> in the script that needs them, or if it's necessary in more than one
> script to add a function to the appropriate .subr (rc, or network).
> 
> So can you say a little more about what you're trying to accomplish?
> It's not clear to me why instead of doing this:
> 
> + if ! sysctl vfs.newnfs >/dev/null 2>&1; then
> + force_depend nfssrv || return 1
> + fi
> 
> you would not just do this:
> 
> + if ! sysctl vfs.newnfs >/dev/null 2>&1; then
> + load_kld nfsd
> + fi
> 
Well, the intent of the above was to get the module loaded so that
sysctl could manipulate its sysctl variables. I played with it a bit
and it turns out that neither of the above code snippets work in the
sense that they don't affect the outcome.

What is needed to make the sysctls work is "nfssrv" has to be in the
REQUIRED: list for either mountd or nfsd. Without it, the sysctls fail
with unknown oid. (I'm guessing there is some delay between the load_kld
and when the module gets its sysctl variables registered?)

Now, I'm not sure whether there is any advantage to specifying "nfssrv"
in nfsd or mountd, although both seem to work when I test them. "nfsserver"
is in mountd, so unless you guys have a better suggestion, that's where
I'll leave it.

rick



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1308036720.478939.1303598424273.JavaMail.root>