Description of problem:
In RHEL5 and below you can append "emergency" to the kernel command line and init will immediately run a "sulogin" even before it runs rc.sysinit.
This no longer works with RHEL6. Please fix.
Created attachment 481732 [details]
screenshot of emergency in action on RHEL5
I could imagine patching upstart to run /sbin/sulogin same as sysvinit but
according to https://bugzilla.redhat.com/show_bug.cgi?id=455763#c3 this would be rather covered by initscripts setup.
Created attachment 482855 [details]
This patch adds task rcS-emergency which is run before rc.sysinit if emergency is passed to kernel
It has one big issue - if user change runlevel, run reboot or shutdown in this emergency mode it tends to unpredictable results because rc.sysinit is not run.
User need to exit shell and continue in boot, or run 'reboot -f' to correctly exit emergency.
This is already relying on a working shell setup to parse the command line, etc., so it might be simpler to just do it in rcS itself, rather than dealing with another job.
rcS has 'console output' while sulogin needs 'console owner'
change to 'console owner' in rcS breaks init 1 on (virtual) serial console:
+ exec /sbin/sulogin
uart_close: bad serial port count; tty->count is 1, port->count is 0
.. and boot continues
... that sounds like an error somewhere else (That's a kernel message.)
Since RHEL 6.1 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.
Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.
(In reply to comment #6)
> rcS has 'console output' while sulogin needs 'console owner'
> change to 'console owner' in rcS breaks init 1 on (virtual) serial console:
> + exec /sbin/sulogin
> uart_close: bad serial port count; tty->count is 1, port->count is 0
> .. and boot continues
This is somehow related to plymouth. init 1 works well with rd_NO_PLYMOUTH in kernel command line.
With "start on runlevel RUNLEVEL=[S1] ..." in quit-plymouth.conf bad serial port message still appears but shell in runlevel 1 is run as expected.
Created attachment 523401 [details]
add 'emergency' target
This patch handles 'emergency' target without straight in rcS job.
Since rcS became console owner, there has to be hide of plymouth splash for runlevels 1 and S to avoid race with plymouth
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
System doesn't run into 'sulogin' if parameter 'emergency' is appended
to kernel command line.
rcS was changed to handle 'emergency' argument and rcS-emergency job
init will immediately run a 'sulogin' before rc.sysinit if
'emergency' is added to kernel command line
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.