Bug 1324 - telinit 1 boots into the default normal runlevel
: telinit 1 boots into the default normal runlevel
Status: NEW
: Sisyphus
(All bugs in Sisyphus/SysVinit)
: unstable
: all Linux
: P4 major
Assigned To:
:
:
:
:
:
  Show dependency tree
 
Reported: 2002-09-28 17:12 by
Modified: 2008-06-13 13:00 (History)


Attachments
0001324-initscripts-5.49-ipl44mdk-single-no-exec.patch (238 bytes, application/octet-stream)
2002-09-28 19:12, imz
no flags Details
0001324-inittab (2.03 KB, application/octet-stream)
2003-01-08 16:23, imz
no flags Details


Note

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


Description From 2002-09-28 17:12:40
When I call \'telinit 1\' (as root), all the services are brought down as
exepcted. Then there is a pause, and after it some messages appear, among them
\'Telling INIT to go to single user mode\'. And after a short while a login
prompt appears: the system has been booted into runlevel 3 (the default). The
OK messages for the started services doesn\'t show up, but the service are
started (syslog logged this).

The same situation when I append \'1\' to the kernel command for GRUB: it boots
into runlevel 3 finally.

When \'single\' is appended, it is booted into the sungle user mode as
expected.

\'init S\' called from a root shell also asks for the root\'s password and
starts a root shell (I expect this to be the final step of \'telinit 1\').

---

---
$ rpm -q SysVinit initscripts 
SysVinit-2.84-alt4
initscripts-5.49-ipl44mdk
------- Comment #1 From 2002-09-28 19:11:42 -------
Surprisingly, removing \'exec \' in /etc/init.d/single made it work correctly.
(The patch is attached.)
------- Comment #2 From 2002-09-28 19:11:42 -------
Surprisingly, removing \'exec \' in /etc/init.d/single made it work correctly.
(The patch is attached.)
------- Comment #3 From 2002-10-14 20:46:50 -------
Applied patch in 5.49-ipl45mdk
------- Comment #4 From 2002-10-14 20:46:50 -------
Applied patch in 5.49-ipl45mdk
------- Comment #5 From 2002-10-19 23:04:27 -------
Can this be an error in /sbin/init? And the patch only implemets a
work-araound.
------- Comment #6 From 2002-10-19 23:04:27 -------
Can this be an error in /sbin/init? And the patch only implemets a
work-araound.
------- Comment #7 From 2002-12-30 01:06:32 -------
Unable to reproduce all these strange things.

I\'m going to revert this patch and add \"exec\" back to /etc/init.d/single.

Please check this \"exec\" thing again with SysVinit-2.84-alt5.
------- Comment #8 From 2002-12-30 01:06:32 -------
Unable to reproduce all these strange things.

I\'m going to revert this patch and add \"exec\" back to /etc/init.d/single.

Please check this \"exec\" thing again with SysVinit-2.84-alt5.
------- Comment #9 From 2003-01-08 15:55:07 -------
I\'m able to duplicate it with SysVinit-2.84-alt5, initscripts-5.49-ipl48mdk.
It happens always.

This time the behaviour is the same, no matter whether \'exec \' is present in
/etc/init.d/single: I\'m not able to boot into runlevel 1 (either with telinit
1 or appending 1 in GRUB).
------- Comment #10 From 2003-01-08 15:55:07 -------
I\'m able to duplicate it with SysVinit-2.84-alt5, initscripts-5.49-ipl48mdk.
It happens always.

This time the behaviour is the same, no matter whether \'exec \' is present in
/etc/init.d/single: I\'m not able to boot into runlevel 1 (either with telinit
1 or appending 1 in GRUB).
------- Comment #11 From 2003-01-08 16:02:44 -------
Please provide as much information as possible, including your /etc/inittab
------- Comment #12 From 2003-01-08 16:02:44 -------
Please provide as much information as possible, including your /etc/inittab
------- Comment #13 From 2003-01-08 16:28:17 -------
Tested with SysVinit-2.82-alt2.

With \'exec telinit -t1 S\' in /etc/init.d/single: 

after telinit 1, it stops all services, writes \'telling INIT to go into single user mode\' and hangs, does nothing. SysRQ + T shows there 2 init processes and some k*.

After appending 1 in GRUB, it writes after the minimal start-up about going into single user mode, no more start up messages appear, and finally, the system has been booted into runlevel 3 (all the services started).

Without \'exec \': telinit 1 boots into runlevel 3 (as described: without messages). The same when appending 1 in GRUB.
------- Comment #14 From 2003-01-08 16:28:17 -------
Tested with SysVinit-2.82-alt2.

With \'exec telinit -t1 S\' in /etc/init.d/single: 

after telinit 1, it stops all services, writes \'telling INIT to go into single user mode\' and hangs, does nothing. SysRQ + T shows there 2 init processes and some k*.

After appending 1 in GRUB, it writes after the minimal start-up about going into single user mode, no more start up messages appear, and finally, the system has been booted into runlevel 3 (all the services started).

Without \'exec \': telinit 1 boots into runlevel 3 (as described: without messages). The same when appending 1 in GRUB.
------- Comment #15 From 2003-01-08 16:46:44 -------
Tested with SysVinit-2.84-alt4 again. The bahaviour is the same, no matter 
whether \'exec \' is there. It writes \'Telling INIT to go to single user mode\' and after a while runlevel 3 is there (the login prompt), no start-up messages appeared before the login screen appeared.
------- Comment #16 From 2003-01-08 16:46:44 -------
Tested with SysVinit-2.84-alt4 again. The bahaviour is the same, no matter 
whether \'exec \' is there. It writes \'Telling INIT to go to single user mode\' and after a while runlevel 3 is there (the login prompt), no start-up messages appeared before the login screen appeared.
------- Comment #17 From 2003-01-08 16:58:16 -------
1. Does -alt4 and -alt5 behaviour differ? -alt5 is preferred for testing.
2. Please restore CTRL-ALT-DEL default action for a while.
------- Comment #18 From 2003-01-08 16:58:16 -------
1. Does -alt4 and -alt5 behaviour differ? -alt5 is preferred for testing.
2. Please restore CTRL-ALT-DEL default action for a while.
------- Comment #19 From 2003-01-08 17:01:06 -------
1. It seems, no.
2. will do it
------- Comment #20 From 2003-01-08 17:01:06 -------
1. It seems, no.
2. will do it
------- Comment #21 From 2003-01-08 17:17:57 -------
Now I\'m using the /etc/inittab from initscripts-5.49-ipl48mdk and
SysVinit-2.84-alt5. Nothing changed: after \'Telling INIT to go to single user
mode\' no messages appear, but runlevel 3 is booted.
------- Comment #22 From 2003-01-08 17:17:57 -------
Now I\'m using the /etc/inittab from initscripts-5.49-ipl48mdk and
SysVinit-2.84-alt5. Nothing changed: after \'Telling INIT to go to single user
mode\' no messages appear, but runlevel 3 is booted.
------- Comment #23 From 2003-01-08 17:28:17 -------
/etc/rc.d/init.d/single: remove exec (if any) and add smth like
echo \"rc=$?\"
right after telinit command. What\'s the rc?
------- Comment #24 From 2003-01-08 17:28:17 -------
/etc/rc.d/init.d/single: remove exec (if any) and add smth like
echo \"rc=$?\"
right after telinit command. What\'s the rc?
------- Comment #25 From 2003-01-08 17:51:10 -------
rc=0

But the result became less stable: in 1 of 5 tests, it went into single user mode! A kind of race?

So I appended these lines: $ tail -5 /etc/init.d/single
# Now go to the single user level.
echo \"Telling INIT to go to single user mode.\"
telinit -t1 S
echo \"rc=$?\"
sleep 5 && echo slept

and now the behaviour is stable and correct. telinit 1 brings the services down, prints \"Telling INIT to go to single user mode.\", \"rc=0\", then prints smth like \"Going SINGLE\" and asks for the password. After a while, \"slept\" is printed.

After I give \"exit\" command in the single user mode shell, the system goes into runlevel 3, with all the messages this time.

Appending 1 in GRUB also works fine.
------- Comment #26 From 2003-01-08 17:51:10 -------
rc=0

But the result became less stable: in 1 of 5 tests, it went into single user mode! A kind of race?

So I appended these lines: $ tail -5 /etc/init.d/single
# Now go to the single user level.
echo \"Telling INIT to go to single user mode.\"
telinit -t1 S
echo \"rc=$?\"
sleep 5 && echo slept

and now the behaviour is stable and correct. telinit 1 brings the services down, prints \"Telling INIT to go to single user mode.\", \"rc=0\", then prints smth like \"Going SINGLE\" and asks for the password. After a while, \"slept\" is printed.

After I give \"exit\" command in the single user mode shell, the system goes into runlevel 3, with all the messages this time.

Appending 1 in GRUB also works fine.
------- Comment #27 From 2003-01-08 17:59:17 -------
Looks like a race.
Could you provide some info from your /proc/cpuinfo?
------- Comment #28 From 2003-01-08 17:59:17 -------
Looks like a race.
Could you provide some info from your /proc/cpuinfo?
------- Comment #29 From 2003-01-08 18:01:07 -------
$ cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 5
model name      : Pentium II (Deschutes)
stepping        : 2
cpu MHz         : 400.917
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr
bogomips        : 799.53
------- Comment #30 From 2003-01-08 18:01:07 -------
$ cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 5
model name      : Pentium II (Deschutes)
stepping        : 2
cpu MHz         : 400.917
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr
bogomips        : 799.53
------- Comment #31 From 2006-12-16 15:31:27 -------
Never saw that...
------- Comment #32 From 2008-06-13 13:00:39 -------
*** This bug has been confirmed by popular vote. ***