Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 215616

Summary: Give the option to fail to boot if all local filesystems don't mount
Product: Gentoo Hosted Projects Reporter: Travis Morgan <imbezol>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: RESOLVED FIXED    
Severity: normal CC: alex_y_xu, jer
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Travis Morgan 2008-03-31 17:08:51 UTC
Having a system go live when one or more local filesystems have mounted is sometimes not at all desirable. This little patch gives the option to the user to have the system prompted for single user mode when one or more local filesystems fail to mount.

Reproducible: Always

Steps to Reproduce:
1. Unplug a drive or have a raid fail
2. Boot the system
3. It boots and goes live even with missing drive



Expected Results:  
Should be configurable to fail to boot.

--- /etc/conf.d/rc.old	2008-03-31 11:00:38.000000000 -0600
+++ /etc/conf.d/rc	2008-03-31 11:02:23.000000000 -0600
@@ -145,7 +145,11 @@
 
 RC_DMESG_LEVEL="1"
 
+# RC_REQ_ALL_LOCAL_MOUNTS:
+# Set to "yes" if you want the boot process to stop and a shell to be started
+# if some local filesystems fail to mount
 
+RC_REQ_ALL_LOCAL_MOUNTS="yes"
 
 
 
--- /etc/init.d/localmount.old	2008-03-31 11:00:50.000000000 -0600
+++ /etc/init.d/localmount	2008-03-31 11:04:17.000000000 -0600
@@ -11,8 +11,15 @@
 	ebegin "Mounting local filesystems"
 	mount -at noproc,noshm${NET_FS_LIST:+,no}${NET_FS_LIST// /,no} \
 		-O no_netdev >/dev/null
+	retval=$?
 	eend $? "Some local filesystem failed to mount"
 
+	if [[ ${retval} -ne 0 ]] ; then
+		if [[ ${RC_REQ_ALL_LOCAL_MOUNTS} == "yes" ]] ; then
+			/sbin/sulogin ${CONSOLE}
+		fi
+	fi
+
 	# Make sure we insert usbcore if its a module
 	if [[ -f /proc/modules && ! -d /proc/bus/usb ]] ; then
 		# >/dev/null to hide errors from non-USB users
Comment 1 William Hubbs gentoo-dev 2015-10-08 22:56:49 UTC
I just now saw this bug, and we now do something similarr. In
OpenRC-0.18, we allow localmount and netmount to fail on Linux if all of
the file systems they are supposed to mount do not mount successfully.

It is possible to configure which file systems are part of this by
adding nofail or noauto to the fstab entries.