0f75b2635e
'echo -n' is not a POSIX construct (no flag support), we shoud use 'printf', especially in init script. This patch was generated by the following command line: git grep -l 'echo -n' -- `git ls-files | grep -v 'patch'` | xargs sed -i 's/echo -n/printf/' Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
81 lines
1.3 KiB
Bash
Executable File
81 lines
1.3 KiB
Bash
Executable File
#!/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
|
|
|
|
mkdir -p /var/lock/subsys
|
|
mkdir -p /run/nfs/sm
|
|
mkdir -p /run/nfs/sm.bak
|
|
touch /run/nfs/rmtab
|
|
|
|
start() {
|
|
# Start daemons.
|
|
printf "Starting NFS statd: "
|
|
rpc.statd
|
|
touch /var/lock/subsys/nfslock
|
|
echo "done"
|
|
|
|
printf "Starting NFS services: "
|
|
/usr/sbin/exportfs -r
|
|
echo "done"
|
|
|
|
printf "Starting NFS daemon: "
|
|
rpc.nfsd 2
|
|
echo "done"
|
|
|
|
printf "Starting NFS mountd: "
|
|
rpc.mountd
|
|
echo "done"
|
|
touch /var/lock/subsys/nfs
|
|
}
|
|
|
|
stop() {
|
|
# Stop daemons.
|
|
printf "Shutting down NFS mountd: "
|
|
killall -q rpc.mountd
|
|
echo "done"
|
|
|
|
echo "Shutting down NFS daemon: "
|
|
kill -9 `pidof nfsd` 2>/dev/null
|
|
echo "done"
|
|
|
|
printf "Shutting down NFS services: "
|
|
/usr/sbin/exportfs -au
|
|
rm -f /var/lock/subsys/nfs
|
|
killall -q rpc.statd
|
|
echo "done"
|
|
|
|
printf "Stopping NFS statd: "
|
|
killall -q rpc.statd
|
|
echo "done"
|
|
rm -f /var/lock/subsys/nfslock
|
|
}
|
|
|
|
# See how we were called.
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart)
|
|
stop
|
|
start
|
|
;;
|
|
reload)
|
|
/usr/sbin/exportfs -r
|
|
touch /var/lock/subsys/nfs
|
|
;;
|
|
*)
|
|
echo "Usage: nfs {start|stop|reload}"
|
|
exit 1
|
|
esac
|
|
|
|
exit 0
|