public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/openrc:master commit in: init.d/, conf.d/
Date: Mon, 25 Apr 2016 17:12:00 +0000 (UTC)	[thread overview]
Message-ID: <1461603874.5d130cc45cd334fd38b0c6874bcc81ac74636217.williamh@OpenRC> (raw)

commit:     5d130cc45cd334fd38b0c6874bcc81ac74636217
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Mon Apr 25 17:04:34 2016 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Apr 25 17:04:34 2016 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=5d130cc4

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.

 conf.d/localmount    | 11 ++++++-----
 conf.d/netmount      |  7 +++++++
 init.d/localmount.in | 14 +++++++-------
 init.d/netmount.in   |  7 ++++++-
 4 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/conf.d/localmount b/conf.d/localmount
index 397e8cd..e727719 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 53717fc..e759adf 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 cfc841a..96ccc44 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 f7237f1..0febde2 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
 }


             reply	other threads:[~2016-04-25 17:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-25 17:12 William Hubbs [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-10-06 19:44 [gentoo-commits] proj/openrc:master commit in: init.d/, conf.d/ William Hubbs
2017-05-22 17:54 William Hubbs
2016-01-19 19:37 William Hubbs
2016-01-13 17:02 William Hubbs
2014-08-22 19:10 William Hubbs
2014-08-08 23:19 ` William Hubbs
2014-01-05 21:59 William Hubbs
2012-10-26  0:58 William Hubbs
2012-02-18 19:11 William Hubbs
2012-02-18 19:11 William Hubbs
2011-11-26 18:22 Mike Frysinger
2011-11-23  0:55 William Hubbs
2011-11-07  4:07 William Hubbs
2011-11-06 20:04 William Hubbs
2011-09-27 16:16 Christian Ruppert
2011-07-04  7:52 Robin H. Johnson
2011-06-24  2:58 William Hubbs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461603874.5d130cc45cd334fd38b0c6874bcc81ac74636217.williamh@OpenRC \
    --to=williamh@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox