3 # nfs-common This shell script takes care of starting and stopping
4 # common daemons required for NFS clients and servers.
7 # description: NFS is a popular protocol for file sharing across \
8 # TCP/IP networks. This service provides NFS file \
9 # locking functionality.
15 if test -f /proc/ksyms
17 # We need to be conservative and run lockd,
18 # unless we can prove that it isn't required.
19 grep -q lockdctl /proc/ksyms || NEED_LOCKD=no
22 [ -x $PREFIX/sbin/rpc.statd ] || exit 0
23 [ -x $PREFIX/sbin/rpc.lockd ] || [ "$NEED_LOCKD" = no ] || exit 0
26 DESC="NFS common utilities"
28 # See how we were called.
31 cd / # daemons should have root dir as cwd
32 printf "Starting $DESC:"
34 start-stop-daemon --start --quiet \
35 --exec $PREFIX/sbin/rpc.statd
36 if [ "$NEED_LOCKD" = yes ]
39 start-stop-daemon --start --quiet \
40 --exec $PREFIX/sbin/rpc.lockd
46 printf "Stopping $DESC:"
47 if [ "$NEED_LOCKD" = yes ]
50 start-stop-daemon --stop --oknodo --quiet \
51 --exec $PREFIX/sbin/rpc.lockd
54 start-stop-daemon --stop --oknodo --quiet \
55 --exec $PREFIX/sbin/rpc.statd
59 restart | force-reload)
66 echo "Usage: nfs-common {start|stop|restart}"