Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 215616 - Give the option to fail to boot if all local filesystems don't mount
Summary: Give the option to fail to boot if all local filesystems don't mount
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-31 17:08 UTC by Travis Morgan
Modified: 2015-10-08 22:56 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.