- Added checking for configured NFS mountpoints in start)
- Added checking for configured and active NFS mountpoints in stop)
- Simplified status)
- I think reload) is stupid and someone should throw it out because it doesn't work ;)
Changed files:
nfsfs.init -> 1.6
+CONFIGUREDNFSMOUNTPOINTS="`grep -v '^#' /etc/fstab | \
+ awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}'`"
+ACTIVENFSMOUNTPOINTS="`grep -v '^#' /proc/mounts | \
+ awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}'`"
+
# See how we were called.
case "$1" in
start)
# See how we were called.
case "$1" in
start)
+ if [ -z "$CONFIGUREDNFSMOUNTPOINTS" ] ; then
+ echo "There are no configured NFS mountpoints!"
+ else
show "Mounting NFS filesystems"
busy
mount -a -t nfs
deltext
ok
touch /var/lock/subsys/nfsfs
show "Mounting NFS filesystems"
busy
mount -a -t nfs
deltext
ok
touch /var/lock/subsys/nfsfs
;;
stop)
if [ -f /proc/mounts ] ; then
;;
stop)
if [ -f /proc/mounts ] ; then
else
fsfile="/etc/mtab"
fi
else
fsfile="/etc/mtab"
fi
+
+ if [ -z "$CONFIGUREDNFSMOUNTPOINTS" ] ; then
+ echo "There are no configured NFS mountpoints!"
+ elif [ -z "$ACTIVENFSMOUNTPOINTS" ] ; then
+ echo "There are no active NFS mountpoints!"
+ else
show "Unmounting NFS filesystems"
busy
show "Unmounting NFS filesystems"
busy
deltext
ok
rm -f /var/lock/subsys/nfsfs
deltext
ok
rm -f /var/lock/subsys/nfsfs
;;
status)
if [ -f /proc/mounts ] ; then
echo "Configured NFS mountpoints:"
;;
status)
if [ -f /proc/mounts ] ; then
echo "Configured NFS mountpoints:"
- grep -v '^#' /etc/fstab | \
- awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}'
+ echo "$CONFIGUREDNFSMOUNTPOINTS"
echo "Active NFS mountpoints:"
echo "Active NFS mountpoints:"
- grep -v '^#' /proc/mounts | \
- awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}'
+ echo "$ACTIVENFSMOUNTPOINTS"
else
echo "/proc filesystem unavailable"
fi
else
echo "/proc filesystem unavailable"
fi