From 15eaf7ece1a72fd634550f7278575051f2a25079 Mon Sep 17 00:00:00 2001 From: Lukas Nykryn Date: Mon, 31 Oct 2016 17:41:54 +0100 Subject: network: don't put down network when /usr is remote-fs Nowadays /usr is a essential part of system and if it is on network, we need to unmount it in shutdown dracut. Also parsing /etc/mtab does not work anymore. Fixes: rhbz#1369790 --- rc.d/init.d/network | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/rc.d/init.d/network b/rc.d/init.d/network index aec8b62a..92da47db 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -160,13 +160,10 @@ start) ;; stop) [ "$EUID" != "0" ] && exit 4 - # Don't shut the network down if root is on NFS or a network + # Don't shut the network down if root or /usr is on NFS or a network # block device. - rootfs=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/" && $3 != "rootfs") { print $3; }}' /proc/mounts) - rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' /etc/mtab) - - if [[ "$rootfs" == nfs* || "$rootopts" =~ _r?netdev ]] || systemctl show --property=RequiredBy -- -.mount | grep -q 'remote-fs.target' ; then - net_log $"rootfs is on network filesystem, leaving network up" + if systemctl show --property=RequiredBy -- -.mount usr.mount | grep -q 'remote-fs.target' ; then + net_log $"rootfs or /usr is on network filesystem, leaving network up" exit 1 fi -- cgit v1.2.1