Article 6R33G Slackware 15.0 rc.nfsd stop does not stop knfsd

Slackware 15.0 rc.nfsd stop does not stop knfsd

by
jimboj1m
from LinuxQuestions.org on (#6R33G)
Howdy,

I'm finding that rc.nfsd restart doesn't reregister nfs services after a rc.rpc restart.

After initial boot I have on the nfs server:
Code:# rpcinfo -p
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 863 rquotad
100011 2 udp 863 rquotad
100011 1 tcp 863 rquotad
100011 2 tcp 863 rquotad
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100227 3 tcp 2049 nfs_acl
100003 3 udp 2049 nfs
100227 3 udp 2049 nfs_acl
100021 1 udp 4045 nlockmgr
100021 3 udp 4045 nlockmgr
100021 4 udp 4045 nlockmgr
100021 1 tcp 4045 nlockmgr
100021 3 tcp 4045 nlockmgr
100021 4 tcp 4045 nlockmgr
100005 1 udp 862 mountd
100005 1 tcp 862 mountd
100005 2 udp 862 mountd
100005 2 tcp 862 mountd
100005 3 udp 862 mountd
100005 3 tcp 862 mountdRestarting rc.rpc and rc.nfsd
Code:# rpcinfo -p
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 865 status
100024 1 tcp 865 status
100011 1 udp 863 rquotad
100011 2 udp 863 rquotad
100011 1 tcp 863 rquotad
100011 2 tcp 863 rquotad
100005 1 udp 862 mountd
100005 1 tcp 862 mountd
100005 2 udp 862 mountd
100005 2 tcp 862 mountd
100005 3 udp 862 mountd
100005 3 tcp 862 mountdwhere nfs, nfs_acl, and nlockmgr are not registered because it seems knfsd is never terminated.

After stopping rc.nfsd I find that knfsd is still running:
Code:# ps aux | grep nfsd | grep -v grep
root 25587 0.0 0.0 0 0 ? I 16:36 0:00 [nfsd]
root 25588 0.0 0.0 0 0 ? I 16:36 0:00 [nfsd]
root 25589 0.0 0.0 0 0 ? I 16:36 0:00 [nfsd]
root 25590 0.0 0.0 0 0 ? I 16:36 0:00 [nfsd]
root 25591 0.0 0.0 0 0 ? I 16:36 0:00 [nfsd]
root 25592 0.0 0.0 0 0 ? I 16:36 0:00 [nfsd]
root 25593 0.0 0.0 0 0 ? I 16:36 0:00 [nfsd]
root 25594 0.0 0.0 0 0 ? I 16:36 0:00 [nfsd]knfsd can be stopped by unmounting it's psuedo filesystems
Code:# umount /proc/fs/nfs{,d}and
Code:# ps aux | grep nfsd | grep -v grepis now empty.

Restarting rc.nfsd I now find everything reregistered
Code:# rpcinfo -p
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 865 status
100024 1 tcp 865 status
100011 1 udp 863 rquotad
100011 2 udp 863 rquotad
100011 1 tcp 863 rquotad
100011 2 tcp 863 rquotad
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100227 3 tcp 2049 nfs_acl
100003 3 udp 2049 nfs
100227 3 udp 2049 nfs_acl
100021 1 udp 4045 nlockmgr
100021 3 udp 4045 nlockmgr
100021 4 udp 4045 nlockmgr
100021 1 tcp 4045 nlockmgr
100021 3 tcp 4045 nlockmgr
100021 4 tcp 4045 nlockmgr
100005 1 udp 862 mountd
100005 1 tcp 862 mountd
100005 2 udp 862 mountd
100005 2 tcp 862 mountd
100005 3 udp 862 mountd
100005 3 tcp 862 mountdIt appears that
Code:killall nfsdhas no effect in nfsd_stop() in /etc/rc.d/rc.nfsd, as there aren't any user space nfsd processes.

Should it instead unmount the nfsd psuedo filesystems to stop knfsd instead akin to something like
Code:--- rc.nfsd 2021-06-15 14:36:10.000000000 -0400
+++ rc.nfsd.new 2024-09-28 16:57:50.736371008 -0400
@@ -82,9 +82,7 @@

nfsd_stop() {
killall rpc.mountd 2> /dev/null
- killall nfsd 2> /dev/null
- sleep 1
- killall -9 nfsd 2> /dev/null # make sure :)
+ umount /proc/fs/nfs{,d}
killall rpc.rquotad 2> /dev/null
/usr/sbin/exportfs -au 2> /dev/null
}or am I missing something?
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments