2007-01-14 02:46:04 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# nfs This shell script takes care of starting and stopping
|
|
|
|
# the NFS services. Stolen from RedHat FC5.
|
|
|
|
|
|
|
|
[ -x /usr/sbin/rpc.statd ] || exit 0
|
|
|
|
[ -x /usr/sbin/rpc.nfsd ] || exit 0
|
|
|
|
[ -x /usr/sbin/rpc.mountd ] || exit 0
|
|
|
|
[ -x /usr/sbin/exportfs ] || exit 0
|
|
|
|
|
2014-09-06 15:50:39 +02:00
|
|
|
mkdir -p /var/lock/subsys
|
2015-07-11 16:48:20 +02:00
|
|
|
mkdir -p /run/nfs/sm
|
2015-07-13 16:57:12 +02:00
|
|
|
mkdir -p /run/nfs/sm.bak
|
2015-07-11 16:48:20 +02:00
|
|
|
touch /run/nfs/rmtab
|
2007-01-14 02:46:04 +01:00
|
|
|
|
2007-05-07 05:59:04 +02:00
|
|
|
start() {
|
2007-01-14 02:46:04 +01:00
|
|
|
# Start daemons.
|
|
|
|
echo -n "Starting NFS statd: "
|
|
|
|
rpc.statd
|
|
|
|
touch /var/lock/subsys/nfslock
|
|
|
|
echo "done"
|
|
|
|
|
|
|
|
echo -n "Starting NFS services: "
|
|
|
|
/usr/sbin/exportfs -r
|
|
|
|
echo "done"
|
|
|
|
|
|
|
|
echo -n "Starting NFS daemon: "
|
|
|
|
rpc.nfsd 2
|
|
|
|
echo "done"
|
|
|
|
|
|
|
|
echo -n "Starting NFS mountd: "
|
|
|
|
rpc.mountd
|
|
|
|
echo "done"
|
|
|
|
touch /var/lock/subsys/nfs
|
2007-05-07 05:59:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2007-01-14 02:46:04 +01:00
|
|
|
# Stop daemons.
|
|
|
|
echo -n "Shutting down NFS mountd: "
|
|
|
|
killall -q rpc.mountd
|
|
|
|
echo "done"
|
|
|
|
|
|
|
|
echo "Shutting down NFS daemon: "
|
|
|
|
kill -9 `pidof nfsd` 2>/dev/null
|
|
|
|
echo "done"
|
|
|
|
|
|
|
|
echo -n "Shutting down NFS services: "
|
|
|
|
/usr/sbin/exportfs -au
|
|
|
|
rm -f /var/lock/subsys/nfs
|
|
|
|
killall -q rpc.statd
|
|
|
|
echo "done"
|
|
|
|
|
|
|
|
echo -n "Stopping NFS statd: "
|
|
|
|
killall -q rpc.statd
|
|
|
|
echo "done"
|
|
|
|
rm -f /var/lock/subsys/nfslock
|
2007-05-07 05:59:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# See how we were called.
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stop
|
2007-01-14 02:46:04 +01:00
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
reload)
|
|
|
|
/usr/sbin/exportfs -r
|
|
|
|
touch /var/lock/subsys/nfs
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: nfs {start|stop|reload}"
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|