From 5d130cc45cd334fd38b0c6874bcc81ac74636217 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Mon, 25 Apr 2016 12:04:34 -0500 Subject: localmount/netmount: allow mount points to be marked critical In previous releases, we either treated no mount points as critical or all of them. Now both localmount and netmount support a critical_mounts setting. If mount points listed in this setting fail to mount, localmount and netmount will fail. --- init.d/localmount.in | 14 +++++++------- init.d/netmount.in | 7 ++++++- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'init.d') diff --git a/init.d/localmount.in b/init.d/localmount.in index cfc841a7..96ccc44b 100644 --- a/init.d/localmount.in +++ b/init.d/localmount.in @@ -22,7 +22,7 @@ depend() start() { # Mount local filesystems in /etc/fstab. - local types="noproc" x= no_netdev= rc= + local critical= types="noproc" x= no_netdev= rc= for x in $net_fs_list $extra_net_fs_list; do types="${types},no${x}" done @@ -37,13 +37,13 @@ start() mount -at "$types" $no_netdev eend $? "Some local filesystem failed to mount" rc=$? - if [ "$RC_UNAME" != Linux ]; then - rc=0 - elif yesno "${ignore_mount_errors:-NO}"; then - if [ $rc -ne 0 ]; then - ewarn "localmount: errors detected, but ignored" - fi + if [ -z "$critical_mounts" ]; then rc=0 + else + for x in ${critical_mounts}; do + mountinfo -q $x || critical=x + done + [-z "$critical" ] && rc=0 fi return $rc } diff --git a/init.d/netmount.in b/init.d/netmount.in index f7237f13..0febde2a 100644 --- a/init.d/netmount.in +++ b/init.d/netmount.in @@ -42,8 +42,13 @@ start() rc=$? fi ewend $rc "Could not mount all network filesystems" - if [ "$RC_UNAME" != Linux ]; then + if [ -z "$critical_mounts" ]; then rc=0 + else + for x in ${critical_mounts}; do + mountinfo -q $x || critical=x + done + [-z "$critical" ] && rc=0 fi return $rc } -- cgit v1.2.3