Bug 1324 - telinit 1 boots into the default normal runlevel
Summary: telinit 1 boots into the default normal runlevel
Status: NEW
Alias: None
Product: Sisyphus
Classification: Development
Component: SysVinit (show other bugs)
Version: unstable
Hardware: all Linux
: P4 major
Assignee: Dmitry V. Levin
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-28 17:12 MSD by imz
Modified: 2008-06-13 13:00 MSD (History)
1 user (show)

See Also:


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

Note You need to log in before you can comment on or make changes to this bug.
Description imz 2002-09-28 17:12:40 MSD
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 imz 2002-09-28 19:11:42 MSD
Surprisingly, removing \'exec \' in /etc/init.d/single made it work correctly. (The patch is attached.)
Comment 2 imz 2002-09-28 19:11:42 MSD
Surprisingly, removing \'exec \' in /etc/init.d/single made it work correctly. (The patch is attached.)
Comment 3 Dmitry V. Levin 2002-10-14 20:46:50 MSD
Applied patch in 5.49-ipl45mdk
Comment 4 Dmitry V. Levin 2002-10-14 20:46:50 MSD
Applied patch in 5.49-ipl45mdk
Comment 5 imz 2002-10-19 23:04:27 MSD
Can this be an error in /sbin/init? And the patch only implemets a work-araound.
Comment 6 imz 2002-10-19 23:04:27 MSD
Can this be an error in /sbin/init? And the patch only implemets a work-araound.
Comment 7 Dmitry V. Levin 2002-12-30 01:06:32 MSK
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 Dmitry V. Levin 2002-12-30 01:06:32 MSK
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 imz 2003-01-08 15:55:07 MSK
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 imz 2003-01-08 15:55:07 MSK
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 Dmitry V. Levin 2003-01-08 16:02:44 MSK
Please provide as much information as possible, including your /etc/inittab
Comment 12 Dmitry V. Levin 2003-01-08 16:02:44 MSK
Please provide as much information as possible, including your /etc/inittab
Comment 13 imz 2003-01-08 16:28:17 MSK
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 imz 2003-01-08 16:28:17 MSK
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 imz 2003-01-08 16:46:44 MSK
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 imz 2003-01-08 16:46:44 MSK
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 Dmitry V. Levin 2003-01-08 16:58:16 MSK
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 Dmitry V. Levin 2003-01-08 16:58:16 MSK
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 imz 2003-01-08 17:01:06 MSK
1. It seems, no.
2. will do it
Comment 20 imz 2003-01-08 17:01:06 MSK
1. It seems, no.
2. will do it
Comment 21 imz 2003-01-08 17:17:57 MSK
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 imz 2003-01-08 17:17:57 MSK
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 Dmitry V. Levin 2003-01-08 17:28:17 MSK
/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 Dmitry V. Levin 2003-01-08 17:28:17 MSK
/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 imz 2003-01-08 17:51:10 MSK
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 imz 2003-01-08 17:51:10 MSK
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 Dmitry V. Levin 2003-01-08 17:59:17 MSK
Looks like a race.
Could you provide some info from your /proc/cpuinfo?
Comment 28 Dmitry V. Levin 2003-01-08 17:59:17 MSK
Looks like a race.
Could you provide some info from your /proc/cpuinfo?
Comment 29 imz 2003-01-08 18:01:07 MSK
$ 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 imz 2003-01-08 18:01:07 MSK
$ 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 Michael Shigorin 2006-12-16 15:31:27 MSK
Never saw that...
Comment 32 Mikhail Gusarov 2008-06-13 13:00:39 MSD