aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2006-07-11 19:49:45 +0000
committerBill Nottingham <notting@redhat.com>2006-07-11 19:49:45 +0000
commit0aaa1815d2599c8c92c84f0417ec7b294ebd6899 (patch)
tree0d449ddcdb3408b00e3847d42374411898f0d593 /rc.d
parent7ad45d75c9fd1986ffc36b2a0c810e33b0114ebd (diff)
downloadinitscripts-0aaa1815d2599c8c92c84f0417ec7b294ebd6899.tar
initscripts-0aaa1815d2599c8c92c84f0417ec7b294ebd6899.tar.gz
initscripts-0aaa1815d2599c8c92c84f0417ec7b294ebd6899.tar.bz2
initscripts-0aaa1815d2599c8c92c84f0417ec7b294ebd6899.tar.xz
initscripts-0aaa1815d2599c8c92c84f0417ec7b294ebd6899.zip
don't bring down the network if root is on nfs / _netdev
Diffstat (limited to 'rc.d')
-rwxr-xr-xrc.d/init.d/network10
1 files changed, 9 insertions, 1 deletions
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`