rc scripts change for review

Rick Macklem rmacklem at uoguelph.ca
Sun Apr 24 13:06:34 UTC 2011



----- Original Message -----
> On 04/23/2011 15:40, Rick Macklem wrote:
> >>
> >>> 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
> >>
My mistake was that the kernel I was using already had
the client linked in, so:
  sysctl vfs.newnfs
wasn't failing and then
  load_kld nfsd
wasn't happenning.

> 
> The load_kld module is safe to run unconditionally (it will simply
> return if the module is loaded). So what you could do (for both cases)
> is something like this:
> 
> load_kld nfsd
> while ! sysctl vfs.newnfs >/dev/null 2>&1; do
> sleep .5
> done
> 
> If that works, I think we should add that feature to load_kld itself.
> 
I now just do the
load_kld nfsd
unconditionally and it works fine. (Although vfs.newnfs was there,
vfs.newnfs.nfs_privport isn't until "nfsd" is loaded. I could make
it conditional on that, but I don't see a need, since load_kld works
when it is already loaded.)

I've updated the scripts at:
  http://people.freebsd.org/~rmacklem/rc.conf
and attached them again, so...

could you please take another look at them.

Thanks, rick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nfsd.diff
Type: text/x-patch
Size: 1471 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20110424/5d4cf114/nfsd.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mountd.diff
Type: text/x-patch
Size: 478 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20110424/5d4cf114/mountd.bin


More information about the freebsd-rc mailing list