aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d
diff options
context:
space:
mode:
Diffstat (limited to 'rc.d/init.d')
-rwxr-xr-xrc.d/init.d/network12
1 files changed, 12 insertions, 0 deletions
diff --git a/rc.d/init.d/network b/rc.d/init.d/network
index 6521f2c3..84c7ed04 100755
--- a/rc.d/init.d/network
+++ b/rc.d/init.d/network
@@ -77,6 +77,18 @@ case "$1" in
touch /var/lock/subsys/network
;;
stop)
+ # If this is a final shutdown/halt, check for network FS,
+ # and unmount them even if the user didn't turn on netfs
+
+ if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then
+ NFSMTAB=`grep -v '^#' /proc/mounts | awk '{ if ($3 ~ /^nfs$/ ) print $2}'`
+ SMBMTAB=`grep -v '^#' /proc/mounts | awk '{ if ($3 ~ /^smbfs$/ ) print $2}'`
+ NCPMTAB=`grep -v '^#' /proc/mounts | awk '{ if ($3 ~ /^ncpfs$/ ) print $2}'`
+ if [ -n "$NFSMTAB" -o -n "$SMBMTAB" -o -n "$NCPMTAB" ] ; then
+ /etc/rc.d/init.d/netfs stop
+ fi
+ fi
+
for i in $interfaces ; do
action "Shutting down interface $i" ./ifdown $i boot
done