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 # Make sure that daemon cwds are in root fs.
31 # See how we were called.
34 printf "Starting $DESC:"
36 start-stop-daemon --start --quiet \
37 --exec $PREFIX/sbin/rpc.statd
38 if [ "$NEED_LOCKD" = yes ]
41 start-stop-daemon --start --quiet \
42 --exec $PREFIX/sbin/rpc.lockd
48 printf "Stopping $DESC:"
49 if [ "$NEED_LOCKD" = yes ]
52 start-stop-daemon --stop --oknodo --quiet \
53 --exec $PREFIX/sbin/rpc.lockd
56 start-stop-daemon --stop --oknodo --quiet \
57 --exec $PREFIX/sbin/rpc.statd
61 restart | force-reload)
68 echo "Usage: nfs-common {start|stop|restart}"