diff --git a/conf.d/mount-ro b/conf.d/mount-ro new file mode 100644 index 000000000..e3361da30 --- /dev/null +++ b/conf.d/mount-ro @@ -0,0 +1,3 @@ +# Stop the unmounting of certain points. +# This could be useful for some NFS related work. +#no_umounts="/dir1:/var/dir2" diff --git a/conf.d/netmount b/conf.d/netmount index e759adf10..34103928a 100644 --- a/conf.d/netmount +++ b/conf.d/netmount @@ -45,3 +45,7 @@ rc_need="net" # netmount will fail. # By default, this is empty. #critical_mounts="/home /var" +# +# Stop the unmounting of certain points. +# This could be useful for some NFS related work. +#no_umounts="/dir1:/var/dir2" diff --git a/init.d/netmount.in b/init.d/netmount.in index 5e285dfca..844ceee52 100644 --- a/init.d/netmount.in +++ b/init.d/netmount.in @@ -78,7 +78,13 @@ stop() fs="$fs${fs:+|}$x" done [ -n "$fs" ] && fs="^($fs)$" - do_unmount -- ${fs:+--fstype-regex} $fs --netdev + local IFS="$IFS:" no_umounts_r= + for x in $no_umounts; do + no_umounts_r="$no_umounts_r${no_umounts_r:+|}$x" + done + [ -n "$no_umounts_r" ] && no_umounts_r="^($no_umounts_r)$" + do_unmount umount ${no_umounts_r:+--skip-point-regex} $no_umounts_r \ + ${fs:+--fstype-regex} $fs --netdev retval=$? eoutdent