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.
14 # Should rpc.statd listen on a specific port?
15 # If so, set this variable to a statd argument like: "--port 1000".
19 if test -f /proc/ksyms
21 # We need to be conservative and run lockd,
22 # unless we can prove that it isn't required.
23 grep -q lockdctl /proc/ksyms || NEED_LOCKD=no
26 [ -x $PREFIX/sbin/rpc.statd ] || exit 0
27 [ -x $PREFIX/sbin/rpc.lockd ] || [ "$NEED_LOCKD" = no ] || exit 0
30 DESC="NFS common utilities"
32 # See how we were called.
35 cd / # daemons should have root dir as cwd
36 printf "Starting $DESC:"
38 start-stop-daemon --start --quiet \
39 --exec $PREFIX/sbin/rpc.statd -- $STATDPORT
40 if [ "$NEED_LOCKD" = yes ]
43 start-stop-daemon --start --quiet \
44 --exec $PREFIX/sbin/rpc.lockd
50 printf "Stopping $DESC:"
51 if [ "$NEED_LOCKD" = yes ]
54 start-stop-daemon --stop --oknodo --quiet \
55 --name rpc.lockd --user 0
58 start-stop-daemon --stop --oknodo --quiet \
59 --name rpc.statd --user 0
63 restart | force-reload)
70 echo "Usage: nfs-common {start|stop|restart}"