Module Name:    src
Committed By:   kre
Date:           Sat Jul 23 01:38:35 UTC 2016

Modified Files:
        src/etc/rc.d: mountcritlocal

Log Message:
Cause rc to abort if mounting any of the critical local filesystems fails
rather than just ignoring the error.

Don't bother attempting to clear the contents of /var/run if /var/run
does not exist.

In that case the mkdir of /var/run/lvm would have failed - correct that
by using mkdir -p (which as a side effect will ensure /var/run exists
and is available for later scripts to use if for some reason it did not exist.)


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/etc/rc.d/mountcritlocal

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/rc.d/mountcritlocal
diff -u src/etc/rc.d/mountcritlocal:1.14 src/etc/rc.d/mountcritlocal:1.15
--- src/etc/rc.d/mountcritlocal:1.14	Tue Jul 22 17:11:09 2014
+++ src/etc/rc.d/mountcritlocal	Sat Jul 23 01:38:35 2016
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: mountcritlocal,v 1.14 2014/07/22 17:11:09 wiz Exp $
+# $NetBSD: mountcritlocal,v 1.15 2016/07/23 01:38:35 kre Exp $
 #
 
 # PROVIDE: mountcritlocal
@@ -18,19 +18,21 @@ mountcritlocal_start()
 	#	(as specified in $critical_filesystems_local)
 	#	This usually includes /var.
 	#
-	mount_critical_filesystems local
+	mount_critical_filesystems local || return $?
 
 	#	clean up left-over files.
 	#	this could include the cleanup of lock files and /var/run, etc.
 	#
 	rm -f /etc/nologin /var/spool/lock/LCK.*
-	(cd /var/run && rm -rf -- *)
+	test -d /var/run && (cd /var/run && rm -rf -- *)
+
 	#       create LVM locking directory, it needs to be owned by operator
 	#	group and has parmissions to allow lock file creation.
 	#
-	mkdir /var/run/lvm
+	mkdir -p /var/run/lvm
 	chown root:operator /var/run/lvm
 	chmod 770 /var/run/lvm
+	return 0
 }
 
 load_rc_config $name

Reply via email to