diff options
author | Lukas Nykryn <lnykryn@redhat.com> | 2016-10-31 17:41:54 +0100 |
---|---|---|
committer | Lukáš Nykrýn <lnykryn@redhat.com> | 2016-11-01 12:41:49 +0100 |
commit | 15eaf7ece1a72fd634550f7278575051f2a25079 (patch) | |
tree | 436f7a8b0f54167ebf1a4e6d2bec21e5570fe34c | |
parent | 78ebd68cd40a229313ff3130d7dd335e88bb4d44 (diff) | |
download | initscripts-15eaf7ece1a72fd634550f7278575051f2a25079.tar initscripts-15eaf7ece1a72fd634550f7278575051f2a25079.tar.gz initscripts-15eaf7ece1a72fd634550f7278575051f2a25079.tar.bz2 initscripts-15eaf7ece1a72fd634550f7278575051f2a25079.tar.xz initscripts-15eaf7ece1a72fd634550f7278575051f2a25079.zip |
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
-rwxr-xr-x | rc.d/init.d/network | 9 |
1 files 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 |