[ -f /etc/sysconfig/nfsd ] && . /etc/sysconfig/nfsd
# Check that networking is up.
-if is_no "${NETWORKING}"; then
- msg_Network_Down NFSD
- exit 1
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network ]; then
+ msg_network_down NFSD
+ exit 1
+ fi
+else
+ exit 0
fi
if [ -x /sbin/pidof ] && [ "$1" != "stop" ]; then
- [ -z "`/sbin/pidof portmap`" ] && echo "Error: portmap isn't running" && exit 0
+ [ -z "`/sbin/pidof portmap`" ] && nls "Error: portmap isn't running" && exit 0
fi
# Sanity checks
# Check if the service is already running?
if [ ! -f /var/lock/subsys/nfs ]; then
# Start daemons.
- if [ "$NFSDTYPE" = "U" ] ; then
+ if [ "$NFSDTYPE" = "U" ] ; then
msg_starting "NFS mountd"
daemon rpc.mountd
msg_starting "NFS daemon"
fi
touch /var/lock/subsys/nfs
else
- msg_Already_Running "NFS"
+ msg_already_running "NFS"
exit 1
fi
;;
stop)
if [ -f /var/lock/subsys/nfs ]; then
# Stop daemons.
- if [ "$NFSDTYPE" = "U" ] ; then
+ if [ "$NFSDTYPE" = "U" ] ; then
msg_stopping "NFS mountd"
killproc rpc.mountd
msg_stopping "NFS daemon"
fi
rm -f /var/lock/subsys/nfs
else
- msg_Not_Running "NFS"
+ msg_not_running "NFS"
exit 1
fi
;;
status)
status rpc.mountd
- if [ "$NFSDTYPE" = "U" ] ; then
+ if [ "$NFSDTYPE" = "U" ] ; then
status rpc.nfsd
else
status nfsd
probe)
[ "$NFSDTYPE" = "U" ] && exit 0
if [ ! -f /var/lock/subsys/nfs ] ; then
- echo start; exit 0
+ echo start
+ exit 0
fi
/sbin/pidof rpc.mountd >/dev/null 2>&1; MOUNTD="$?"
/sbin/pidof nfsd >/dev/null 2>&1; NFSD="$?"
if [ $MOUNTD = 1 -o $NFSD = 1 ] ; then
- echo restart; exit 0
+ echo restart
+ exit 0
fi
if [ /etc/exports -nt /var/lock/subsys/nfs ] ; then
- echo reload; exit 0
+ echo reload
+ exit 0
fi
;;
*)
#!/bin/sh
#
-# nfsfs Mount NFS filesystems.
+# nfsfs Mount NFS filesystems.
#
-# Version: @(#) /etc/init.d/skeleton 1.01 26-Oct-1993
+# Version: @(#) /etc/init.d/skeleton 1.01 26-Oct-1993
#
-# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
+# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
#
-# chkconfig: 345 15 88
-# description: Mounts and unmounts all Network File System (NFS) \
-# mount points.
+# chkconfig: 345 15 88
+# description: Mounts and unmounts all Network File System (NFS) \
+# mount points.
#
# $Id$
# Source networking configuration.
if [ ! -f /etc/sysconfig/network ]; then
- exit 0
+ exit 0
fi
# Source function library.
. /etc/rc.d/init.d/functions
+# Get network config
. /etc/sysconfig/network
# Check that networking is up.
-if is_no "${NETWORKING}"; then
- msg_network_down nfsfs
- exit 1
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network ]; then
+ msg_network_down nfsfs
+ exit 1
+ fi
+else
+ exit 0
fi
+
# See how we were called.
case "$1" in
start)
show "Mounting NFS filesystems"
busy
mount -a -t nfs
- deltext
ok
touch /var/lock/subsys/nfsfs
;;
umount -a -f -t nfs
remaining=$(awk '$3 == "nfs" {print $2}' $fsfile)
done
- deltext
ok
rm -f /var/lock/subsys/nfsfs
;;
esac
exit 0
-
#!/bin/sh
#
-# nfslock This shell script takes care of starting and stopping
-# the NFS file locking service.
+# nfslock This shell script takes care of starting and stopping
+# the NFS file locking service.
#
# chkconfig: 345 61 19
# description: NFS is a popular protocol for file sharing across \
[ -f /etc/sysconfig/nfslock ] && . /etc/sysconfig/nfslock
# Check that networking is up.
-if is_no "${NETWORKING}"; then
- msg_Network_Down "NFS lockd"
- exit 1
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network ]; then
+ msg_network_down "NFS lockd"
+ exit 1
+ fi
+else
+ exit 0
fi
if [ -x /sbin/pidof ] && [ "$1" != "stop" ]; then
daemon rpc.statd
touch /var/lock/subsys/nfslock
else
- msg_Already_Running "NFS statd"
+ msg_already_running "NFS statd"
exit 1
fi
;;
stop)
- if [ -f /var/lock/subsys/nfslock ]; then
+ if [ -f /var/lock/subsys/nfslock ]; then
# Stop daemons.
msg_stopping "NFS statd"
killproc rpc.statd
rm -f /var/lock/subsys/nfslock
else
- msg_Not_Running "NFS statd"
+ msg_not_running "NFS statd"
exit 1
fi
;;
status rpc.statd
;;
restart)
- $0 stop
+ $0 stop
$0 start
;;
probe)
if [ ! -f /var/lock/subsys/nfslock ] ; then
- echo start; exit 0
+ echo start
+ exit 0
fi
/sbin/pidof rpc.statd >/dev/null 2>&1; STATD="$?"
if [ $STATD = 1 ] ; then
- echo restart; exit 0
+ echo restart
+ exit 0
fi
;;
*)
- msg_Usage "$0 {start|stop|status|restart}"
+ msg_usage "$0 {start|stop|restart|probe|status}"
exit 1
esac