[RFC PATCH] use sulogin in single-user mode

Bill Nottingham notting at redhat.com
Thu Jan 21 17:21:45 UTC 2010


We have an existing bug where if you're in single-user mode, and
SELinux is active, various commands don't print to the console.
The root of this is the single-user shell isn't running in the
right SELinux context, as there's nothing to distinguish this from
the 'normal' shells run during bootup.

By far, the simplest fix is to run something that starts a shell
via a 'normal' login-ish mechanism. Hence, the attached patch
that switches to sulogin for single user mode.

However, this changes behavior that has existed since the dawn
of time in Red Hat/Fedora systems; with this change, single-user
mode would now require the root password. This is both when
booting with 'linux single/linux S', or going to runlevel 1
with 'telinit 1'.

Comments?

Bill
-------------- next part --------------
diff --git a/init/rcS-sulogin.conf b/init/rcS-sulogin.conf
index 4f1f1f1..60360aa 100644
--- a/init/rcS-sulogin.conf
+++ b/init/rcS-sulogin.conf
@@ -1,6 +1,6 @@
 # rcS-sulogin - "single-user" runlevel compatibility
 #
-# This task runs /bin/bash during "single-user" mode,
+# This task runs /sbin/sulogin during "single-user" mode,
 # then continues to the default runlevel.
 
 start on runlevel S
@@ -10,7 +10,7 @@ stop on runlevel [!S]
 console owner
 script
 	plymouth --hide-splash || true
-	exec /bin/bash
+	exec /sbin/sulogin
 end script
 post-stop script
 	if [ "$RUNLEVEL" = "S" ]; then


More information about the devel mailing list