Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 158615 - Computer not shutting down.
Summary: Computer not shutting down.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-19 18:15 UTC by Xake
Modified: 2006-12-21 02:49 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Don't launch sulogin unless RUNLEVEL S (rc.single,517 bytes, patch)
2006-12-20 00:41 UTC, Roy Marples (RETIRED)
Details | Diff
shutdown goes into single user mode (shutdown.patch,530 bytes, patch)
2006-12-20 05:10 UTC, Roy Marples (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xake 2006-12-19 18:15:17 UTC
I have currently four Gentoo-enviroments (two softraid, on laptop and a old pII) who refuses to shutdown right wnd this whitout error-messages..
If I issue 'shutdown -r now' everything went as it should, but if I issue 'shutdown now' the computers showing me sooner or later the "Enter root-password for maintains or Ctrl-D:" thing. If I do Ctrl-D it just stops there, if I enter the password and then typ halt -p it remounts / and does a power down.

How do I fix this and/or gives you more information?

All machines are ~x86.
Two are currently running the 1.13_alpha* to see if it was fixed there.
Comment 1 SpanKY gentoo-dev 2006-12-19 20:08:46 UTC
emerge sync and re-emerge sysvinit/baselayout and see if that works
Comment 2 Roy Marples (RETIRED) gentoo-dev 2006-12-20 00:38:11 UTC
This error is caused by /sbin/rc assuming that runlevel 1 is single user.
We should be treating it as just another runlevel really.
Comment 3 Roy Marples (RETIRED) gentoo-dev 2006-12-20 00:41:13 UTC
Created attachment 104423 [details, diff]
Don't launch sulogin unless RUNLEVEL S

Don't launch sulogin unless we're in RUNLEVEL S (ie single user). Could the reporter test this patch against baselayout.1.13.0_alpha10 and see if it works for him?

It could also be argued that shutdown without any halt or power switches should do a telinit S instead of telinit 1 (which commands can be used to replicate this bug)
Comment 4 Xake 2006-12-20 05:01:47 UTC
Rsync && remerge did not work, the patch only seems to stop the shutdown where it earlier asked for root password.
However I have found something other that may or may not be related:
Before the patch when "enter pass or ctrl-d" thing comes up it most of the time it does not work correctly.
The behaviors I have seen is: 

treat root as still logged in but ask for login at the same time. (thus giving me "login incorrect" as the same time it handles what I typs as commandos), 

unable to login (every key I press on my keyboard gives directly "login incorrect" and gives me the ctrl-d-prompt again), 

treat the ctrl-d prompt as a standard loginprompt lays in the background (If I enter anything it shows up in clear-text and if I enter root-pass after that it logins as root whatever I entered the line before. The tricky part is: dodge the "login incorrect" and the new login-prompts being issued while trying to execute halt -p).

Is this related or is that a new bug?
Comment 5 Roy Marples (RETIRED) gentoo-dev 2006-12-20 05:10:48 UTC
Created attachment 104440 [details, diff]
shutdown goes into single user mode

This patch defaults shutdown going to single user mode, which makes it the same as the BSD shutdown now action - and is probably the desired affect anyway.
Comment 6 Roy Marples (RETIRED) gentoo-dev 2006-12-20 05:25:22 UTC
(In reply to comment #4)
> Rsync && remerge did not work, the patch only seems to stop the shutdown where
> it earlier asked for root password.

That is correct, because shutdown doesn't go to the single user runlevel (unless you use the other patch too).


> The behaviors I have seen is: 
> 
> treat root as still logged in but ask for login at the same time. (thus giving
> me "login incorrect" as the same time it handles what I typs as commandos), 
> 
> unable to login (every key I press on my keyboard gives directly "login
> incorrect" and gives me the ctrl-d-prompt again), 
> 
> treat the ctrl-d prompt as a standard loginprompt lays in the background (If I
> enter anything it shows up in clear-text and if I enter root-pass after that it
> logins as root whatever I entered the line before. The tricky part is: dodge
> the "login incorrect" and the new login-prompts being issued while trying to
> execute halt -p).
> 
> Is this related or is that a new bug?

It's related. basically sulogin and getty are fighting each other for keyboard input. The first patch here stops that (hopefully one and for all) and the second patch makes shutdown behave in a sensible manner if not asked to halt or reboot.
Comment 7 Xake 2006-12-20 17:26:33 UTC
Ok, patched shutdown and now I got the prompt again.
Currently everything works as it should if I enter my root-pass, but if I press Ctrl-D it starts reloading all startskripts from the beginning. Like a reboot ut without any booting or kernel-reload.

So currently:
Getting the prompt without any errors
and
Pressing Ctrl-D makes init load scripts like it does when the system starts.
Comment 8 Roy Marples (RETIRED) gentoo-dev 2006-12-21 00:03:07 UTC
(In reply to comment #7)
> Ok, patched shutdown and now I got the prompt again.
> Currently everything works as it should if I enter my root-pass, but if I press
> Ctrl-D it starts reloading all startskripts from the beginning. Like a reboot
> ut without any booting or kernel-reload.

That's how single user mode works. When you exit it (ie, exit the shell, logout, etc) or don't enter the root password, it starts up again. In single user mode, the entire computer is effectively shutdown with only the bare essentials running for you to have a prompt. This enables you to make any repairs, modifications, that would otherwise be affected by running processes.

If you want shutdown to actually halt or power-off the computer (ie, go that extra step) you need to use one of the -h, -H or -p flags.
Comment 9 Roy Marples (RETIRED) gentoo-dev 2006-12-21 02:49:37 UTC
Fixed in baselayout-1.12.8-r1 and sysvinit-2.86-r7