Bug 443554 - Add "s" option to boot single user mode from grub command line
Summary: Add "s" option to boot single user mode from grub command line
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: event-compat-sysv
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Casey Dahlin
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-04-22 07:36 UTC by CHIKAMA Masaki
Modified: 2014-06-18 08:46 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-04-24 19:47:25 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description CHIKAMA Masaki 2008-04-22 07:36:58 UTC
Description of problem:
 Historycally we can boot with single user mode from grub command line
adding "s". But after changing to upstart, only "-s", "single" and "S" are
allowed. 

Version-Release number of selected component (if applicable):
 event-compat-sysv-0.3.9-13.fc9.noarch

How reproducible:
 always when type "s"


Steps to Reproduce:
1. enter grub menu
2. append "s" to command line
3.
  
Actual results:
default runlevel (3 or 5)

Expected results:
single user mode (1)

Additional info:
 Here is a proposed patch.
--- /etc/event.d/rcS~   2008-04-05 00:49:20.000000000 +0900
+++ /etc/event.d/rcS    2008-04-22 16:32:45.000000000 +0900
@@ -20,7 +20,7 @@
        [ -z "$runlevel" ] && runlevel="3"
        for t in $(cat /proc/cmdline); do
                case $t in
-                       -s|single|S) runlevel="S" ;;
+                       -s|single|S|s) runlevel="S" ;;
                        [1-9])       runlevel="$t" ;;
                esac
        done

Comment 1 Bill Nottingham 2008-04-22 15:21:25 UTC
I'm not sure why 's' worked before. From the init manpage:

Init accepts the following flags:

       -s, S, single
            Single user mode boot. In this mode /etc/inittab is examined  and  the
            bootup rc scripts are usually run before the single user mode shell is
            started.

From the code:
                if (!strcmp(argv[f], "single") || !strcmp(argv[f], "-s"))
                        dfl_level = 'S';

So, I don't think 's' was ever really supported.

Comment 2 Bill Nottingham 2008-04-22 15:22:43 UTC
Aha, found it:

                if (dfl_level == 's') dfl_level = 'S';

Yay for undocumented features.

Comment 3 CHIKAMA Masaki 2008-04-22 15:34:11 UTC
Which man page you are referring ?

On F8, LANG=C man 8 init said

       Runlevel S or s bring the system to single user mode and do not require
       an /etc/inittab file.  In single user mode, a root shell is  opened  on
       /dev/console.

$ rpm -qf /usr/share/man/man8/init.8.gz
sysvinit-2.86-18

Comment 4 Bill Nottingham 2008-04-24 19:47:25 UTC
Will be in 0.3.9-14.

Comment 5 CHIKAMA Masaki 2008-04-25 03:49:03 UTC
Sorry. Please ignore Comment #3.

And thank you for adding undocumented feature.
I've been using this option for over 10 years.
It's so thanksfull to keep compatibility.


Note You need to log in before you can comment on or make changes to this bug.