package/nbd: add option for the trdump utility
[buildroot-gz.git] / package / nfs-utils / S60nfs
blob893b1e49a67d6027363d486678c2da13aaca2e4b
1 #!/bin/sh
3 # nfs This shell script takes care of starting and stopping
4 # the NFS services. Stolen from RedHat FC5.
6 [ -x /usr/sbin/rpc.statd ] || exit 0
7 [ -x /usr/sbin/rpc.nfsd ] || exit 0
8 [ -x /usr/sbin/rpc.mountd ] || exit 0
9 [ -x /usr/sbin/exportfs ] || exit 0
11 mkdir -p /var/lock/subsys
12 mkdir -p /run/nfs/sm
13 mkdir -p /run/nfs/sm.bak
14 touch /run/nfs/rmtab
16 CFG_FILE=/etc/default/nfsd
18 NR_THREADS=2
19 if [ -f "${CFG_FILE}" ]; then
20 . "${CFG_FILE}"
24 start() {
25 # Start daemons.
26 printf "Starting NFS statd: "
27 rpc.statd
28 [ $? = 0 ] && echo "OK" || echo "FAIL"
29 touch /var/lock/subsys/nfslock
31 printf "Starting NFS services: "
32 /usr/sbin/exportfs -r
33 [ $? = 0 ] && echo "OK" || echo "FAIL"
35 printf "Starting NFS daemon: "
36 rpc.nfsd ${NR_THREADS}
37 [ $? = 0 ] && echo "OK" || echo "FAIL"
39 printf "Starting NFS mountd: "
40 rpc.mountd
41 [ $? = 0 ] && echo "OK" || echo "FAIL"
42 touch /var/lock/subsys/nfs
45 stop() {
46 # Stop daemons.
47 printf "Shutting down NFS mountd: "
48 killall -q rpc.mountd 2>/dev/null
49 [ $? = 0 ] && echo "OK" || echo "FAIL"
51 printf "Shutting down NFS daemon: "
52 killall -q nfsd 2>/dev/null
53 [ $? = 0 ] && echo "OK" || echo "FAIL"
55 printf "Shutting down NFS services: "
56 /usr/sbin/exportfs -au
57 [ $? = 0 ] && echo "OK" || echo "FAIL"
59 printf "Stopping NFS statd: "
60 killall -q rpc.statd 2>/dev/null
61 [ $? = 0 ] && echo "OK" || echo "FAIL"
62 rm -f /var/lock/subsys/nfs
63 rm -f /var/run/rpc.statd.pid
64 rm -f /var/lock/subsys/nfslock
67 # See how we were called.
68 case "$1" in
69 start)
70 start
72 stop)
73 stop
75 restart)
76 stop
77 start
79 reload)
80 /usr/sbin/exportfs -r
81 touch /var/lock/subsys/nfs
84 echo "Usage: $0 {start|stop|restart|reload}"
85 exit 1
86 esac
88 exit 0