summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/nfs-utils
diff options
context:
space:
mode:
authorQiang Chen <qiang.chen@windriver.com>2013-10-22 11:03:59 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-10-26 16:08:38 +0100
commitb82603b06276050b80c9ae643075dcb7efda352b (patch)
tree92d8a577d863d31b95b3be2357a3ff7a92a6d44c /meta/recipes-connectivity/nfs-utils
parent2570f13dbf557f3f46b9b0c14fdad8dca791725a (diff)
downloadpoky-b82603b06276050b80c9ae643075dcb7efda352b.tar.gz
nfs-utils: Stop rpc.statd correctly
An incorrect process name in the nfsserver initscript prevented rpc.statd from being shut down. root@qemux86-64:~# /etc/init.d/nfsserver start creating NFS state directory: done starting 8 nfsd kernel threads: done starting mountd: done starting statd: done root@qemux86-64:~# ps | grep rpc.statd 650 root 10532 S /usr/sbin/rpc.statd 654 root 4720 S grep rpc.statd root@qemux86-64:~# /etc/init.d/nfsserver stop stopping statd: done stopping mountd: done stopping nfsd: done root@qemux86-64:~# ps | grep rpc.statd 650 root 10532 S /usr/sbin/rpc.statd 662 root 4720 S grep rpc.statd As this daemon drops a pid file,simply use that instead. Also add some initialization checks so the daemons are not left partially started in the absence of kernel nfsd support. (From OE-Core rev: 37e70a28e9cfc773bd70f09d7129295ce891ae18) Signed-off-by: Andy Ross <andy.ross@windriver.com> Signed-off-by: Qiang Chen <qiang.chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/nfs-utils')
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver18
1 files changed, 14 insertions, 4 deletions
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
index 1ac6fec023..8ee8d0bb50 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
@@ -25,6 +25,7 @@ test -r /etc/default/nfsd && . /etc/default/nfsd
25test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/rpc.mountd 25test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/rpc.mountd
26test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/rpc.nfsd 26test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/rpc.nfsd
27test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd 27test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd
28test -z "$STATD_PID" && STATD_PID=/var/run/rpc.statd.pid
28# 29#
29# The user mode program must also exist (it just starts the kernel 30# The user mode program must also exist (it just starts the kernel
30# threads using the kernel module code). 31# threads using the kernel module code).
@@ -77,6 +78,17 @@ stop_mountd(){
77# 78#
78#nfsd 79#nfsd
79start_nfsd(){ 80start_nfsd(){
81 modprobe -q nfsd
82 grep -q nfsd /proc/filesystems || {
83 echo NFS daemon support not enabled in kernel
84 exit 1
85 }
86 grep -q nfsd /proc/mounts || mount -t nfsd nfsd /proc/fs/nfsd
87 grep -q nfsd /proc/mounts || {
88 echo nfsd filesystem could not be mounted at /proc/fs/nfsd
89 exit 1
90 }
91
80 echo -n "starting $1 nfsd kernel threads: " 92 echo -n "starting $1 nfsd kernel threads: "
81 start-stop-daemon --start --exec "$NFS_NFSD" -- "$@" 93 start-stop-daemon --start --exec "$NFS_NFSD" -- "$@"
82 echo done 94 echo done
@@ -115,14 +127,12 @@ stop_nfsd(){
115#statd 127#statd
116start_statd(){ 128start_statd(){
117 echo -n "starting statd: " 129 echo -n "starting statd: "
118 start-stop-daemon --start --exec "$NFS_STATD" 130 start-stop-daemon --start --exec "$NFS_STATD" --pidfile "$STATD_PID"
119 echo done 131 echo done
120} 132}
121stop_statd(){ 133stop_statd(){
122 # WARNING: this kills any process with the executable
123 # name 'statd'.
124 echo -n 'stopping statd: ' 134 echo -n 'stopping statd: '
125 start-stop-daemon --stop --quiet --signal 1 --name statd 135 start-stop-daemon --stop --quiet --signal 1 --pidfile "$STATD_PID"
126 echo done 136 echo done
127} 137}
128#---------------------------------------------------------------------- 138#----------------------------------------------------------------------