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.
emerge sync and re-emerge sysvinit/baselayout and see if that works
This error is caused by /sbin/rc assuming that runlevel 1 is single user. We should be treating it as just another runlevel really.
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)
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?
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.
(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.
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.
(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.
Fixed in baselayout-1.12.8-r1 and sysvinit-2.86-r7