From 0aaa1815d2599c8c92c84f0417ec7b294ebd6899 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 11 Jul 2006 19:49:45 +0000 Subject: don't bring down the network if root is on nfs / _netdev --- rc.d/init.d/network | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'rc.d/init.d') diff --git a/rc.d/init.d/network b/rc.d/init.d/network index 8e0255b5..a16a2692 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -170,9 +170,17 @@ case "$1" in [ -n "${NETWORKDELAY}" ] && /bin/sleep ${NETWORKDELAY} ;; stop) + # Don't shut the network down if root is on NFS or a network + # block device. + rootfs=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $3; }}' /etc/mtab) + rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' /etc/mtab) + + if [[ "$rootfs" =~ "^nfs" ]] || [[ "$rootopts" =~ "_netdev" ]] ; then + exit 1 + fi + # 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=`LC_ALL=C awk '$3 ~ /^nfs/ { print $2 }' /proc/mounts` SMBMTAB=`LC_ALL=C awk '$3 == "smbfs" { print $2 }' /proc/mounts` -- cgit v1.2.1