aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf.d/localmount11
-rw-r--r--conf.d/netmount7
-rw-r--r--init.d/localmount.in14
-rw-r--r--init.d/netmount.in7
4 files changed, 26 insertions, 13 deletions
diff --git a/conf.d/localmount b/conf.d/localmount
index 397e8cd8..e7277194 100644
--- a/conf.d/localmount
+++ b/conf.d/localmount
@@ -2,8 +2,9 @@
# This could be useful for some NFS related work.
#no_umounts="/dir1:/var/dir2"
#
-# Ignore errors when mounting local file systems.
-# This should be left alone unless you know what you are doing. If it is
-# set to yes, not only will we allow mount failures, but we will ignore
-# syntax errors in fstab.
-#ignore_mount_errors="NO"
+# Mark certain mount points as critical.
+# This contains aspace separated list of mount points which should be
+# considered critical. If one of these mount points cannot be mounted,
+# localmount will fail.
+# By default, this is empty.
+#critical_mounts="/home /var"
diff --git a/conf.d/netmount b/conf.d/netmount
index 53717fcd..e759adf1 100644
--- a/conf.d/netmount
+++ b/conf.d/netmount
@@ -38,3 +38,10 @@
# other words, please change it to be more suited to your system.
#
rc_need="net"
+#
+# Mark certain mount points as critical.
+# This contains aspace separated list of mount points which should be
+# considered critical. If one of these mount points cannot be mounted,
+# netmount will fail.
+# By default, this is empty.
+#critical_mounts="/home /var"
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
}