commit:     fd80b6fc67ec6a0fe4853167fb67ee40bb51b742
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Tue Apr 26 17:43:50 2016 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Tue Apr 26 17:43:50 2016 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=fd80b6fc

localmount/netmount: clean up critical mount processing

Fix a typo and do not fail if a path in critical_mounts is not listed as
a critical mount does not get mounted.

 init.d/localmount.in | 8 ++++++--
 init.d/netmount.in   | 8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/init.d/localmount.in b/init.d/localmount.in
index 96ccc44..b7de0d8 100644
--- a/init.d/localmount.in
+++ b/init.d/localmount.in
@@ -41,9 +41,13 @@ start()
                rc=0
        else
                for x in ${critical_mounts}; do
-               mountinfo -q $x || critical=x
+               fstabinfo -q $x || continue
+               if ! mountinfo -q $x; then
+                       critical=x
+                       eerror "Failed to mount $x"
+               fi
                done
-               [-z "$critical" ] && rc=0
+               [ -z "$critical" ] && rc=0
        fi
        return $rc
 }

diff --git a/init.d/netmount.in b/init.d/netmount.in
index 0febde2..ede4d32 100644
--- a/init.d/netmount.in
+++ b/init.d/netmount.in
@@ -46,9 +46,13 @@ start()
                rc=0
        else
                for x in ${critical_mounts}; do
-               mountinfo -q $x || critical=x
+               fstabinfo -q $x || continue
+               if ! mountinfo -q $x; then
+                       critical=x
+                       eerror "Failed to mount $x"
+               fi
                done
-               [-z "$critical" ] && rc=0
+               [ -z "$critical" ] && rc=0
        fi
        return $rc
 }

Reply via email to