Richard A Downing wrote:

I think that your solution, while not seemingly elegant, is a good
workaround.  rpc.nfsd is just a userland program to tell the kernel
module how many threads to run.  As such, it reports success if it told
the kernel OK - what the kernel does with this info is a different
matter.  Your solution correctly tests 'what the kernel did'.  So I
think it's right.

Thanks. :-)

The only real question left is 'Why do you want to know?'.  Do you abort
the shurdown if the nfsd threads don't die, or carry on with a worry
that some data wasn't safely written?  Not sure what the right answer is
here.
Well, thanks again, didn't think about that. I've expanded the command a little bit. It's not looking good, but should hopefully provide a little safety:

               if pidof nfsd 2>&1 > /dev/null ; then {
                       rpc.nfsd -- 0
                       sleep 1
                       if pidof nfsd 2>&1 > /dev/null ; then {
                               echo_failure
                               boot_mesg "Killing NFS nfsd..."
                               kill -HUP 'pidofproc nfsd'
                               evaluate_retval
                               sleep 10
                       }
                       else echo_ok
                       fi
               }
               else echo_warning
               fi

Haven't had chance to test this yet, and guess I have to fake a nfsd lockup to see what happens in worst case.

My attempt is based upon Richard Downing and Bruce Dubbs tips from the BLFS-dev list. Couldn't find a good solution there though, which is why I'm trying this on my own.

Again, all comment, corrections or better solutions are very welcome.

--Tor Olav
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to