Bug 731574

Summary: Switch off the computer automatically
Product: [openSUSE] openSUSE 12.1 Reporter: Forgotten User ghcFYO_ifG <forgotten_ghcFYO_ifG>
Component: BasesystemAssignee: Frederic Crozat <fcrozat>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P2 - High CC: jeffm, ro, werner, wstephenson, zaitor
Version: Final   
Target Milestone: ---   
Hardware: i586   
OS: SUSE Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Look the Shut down Button ("Herunterfahren"
console output when shutting down provided by reporter
more console output when shutting down provided by reporter
system halted
picture 2

Description Forgotten User ghcFYO_ifG 2011-11-19 22:51:18 UTC
Created attachment 463043 [details]
Look the Shut down Button ("Herunterfahren"

User-Agent:       Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20100101 Firefox/7.0.1

(KDE 4.7): When I switch the "Shut down" button, the system shuts down, but the green open Suse screen doesn´t switch the computer correctly off. That means the computer doesn´t switch off completely. 
If I switch to the terminal with "STRG+ALT+F1" and switch out the computer with the switch-off-switch from the computer, the system shuts down and the computer switches off correctly.
What´s wrong with the desktop?

Reproducible: Always

Steps to Reproduce:
1.Click on "Shut down"-Button in KDE 4.7
2.You must switch off the computer manually because the system doesn´t shut down correctly


Actual Results:  
The computer doesn´t shut down correctly. It doesn´t sitch off.
Comment 1 Will Stephenson 2011-11-21 12:05:27 UTC
Press Escape at the "green openSUSE screen" to get the text console and take a picture of the output there, attach that here please.
Comment 2 Will Stephenson 2011-11-22 10:22:25 UTC
Created attachment 463378 [details]
console output when shutting down provided by reporter
Comment 3 Will Stephenson 2011-11-22 10:23:03 UTC
Created attachment 463379 [details]
more console output when shutting down provided by reporter
Comment 4 Will Stephenson 2011-11-22 10:27:43 UTC
Not a KDE issue, it's getting to "System halted" but not actually powering down.
Comment 5 Forgotten User ghcFYO_ifG 2011-11-22 15:12:31 UTC
Created attachment 463442 [details]
system halted

Why did the system halt?
Comment 6 Forgotten User ghcFYO_ifG 2011-11-22 15:15:33 UTC
Created attachment 463444 [details]
picture 2
Comment 7 Forgotten User ghcFYO_ifG 2011-11-22 15:20:22 UTC
When I switch of the computer with "/sbin/poweroff" it switches off correctly!
Why do I need "/sbin/poweroff" in Open Suse 12.1 and not "/sbin/halt" like in Open Suse 11.1/11.2/11.3/11.4?
Comment 8 Bjørn Lie 2011-11-22 22:52:44 UTC
From the releasenotes 

System Shutdown with systemd

To halt and poweroff the system when using systemd, issue halt -p or shutdown -h now on the command-line or use the shutdown button provided by your desktop environment.

Note: A plain halt will not shutdown the system properly.
Comment 9 Jeff Mahoney 2011-11-23 00:08:40 UTC
(In reply to comment #7)
> When I switch of the computer with "/sbin/poweroff" it switches off correctly!
> Why do I need "/sbin/poweroff" in Open Suse 12.1 and not "/sbin/halt" like in
> Open Suse 11.1/11.2/11.3/11.4?

Thanks for the research. That points straight to the problem.

The bug here is an incompatibility between systemd and the old sysvinit /
aaa_base halt script. Technically, I suppose it's a bug in aaa_base's halt
script but it's been that way *forever* and compatibility is more important
than correctness at this stage.

sysvinit's 'halt' (without -f) translates to 'shutdown -h'
sysvinit's 'shutdown -h' is a soft halt and translates to 'init 0' and sets the
INIT_HALT variable to an empty value (-H sets it to "HALT", -P sets it to
"POWEROFF")
aaa_base's /etc/init.d/rc0.d only contains a link to /etc/init.d/halt
/etc/init.d/halt without INIT_HALT uses POWEROFF
... that translates to halt -P (and some other irrelevant things)
... and we loop back up to the top.
Except now 'halt -p' is already at runlevel 0 so it passes through and calls
the poweroff system call.

So, long story short, 'halt' = 'poweroff' w/ sysvinit + our aaa_base.

systemd translates 'halt' to what would be sysvinit's 'shutdown -H' if it
didn't handle it internally.

Interestingly (to me at least), 'halt' will have never functioned as 'halt' on
any SUSE release I'm aware of. The /etc/init.d/halt script will never get
passed INIT_HALT=HALT from the halt executable -- only from shutdown -H.


(In reply to comment #8)
> From the releasenotes 
> 
> System Shutdown with systemd
> 
> To halt and poweroff the system when using systemd, issue halt -p or shutdown
> -h now on the command-line or use the shutdown button provided by your desktop
> environment.
> 
> Note: A plain halt will not shutdown the system properly.

This is garbage. 'halt' has equaled 'poweroff' on SUSE systems for a very, very long time. We're not going to switch it now because the systemd authors dictate it so. This is a regression as far as I'm concerned.

Anyway, I'm not the maintainer of either. I'm only involved because it was assigned as a kernel problem and the reporter posted to the kernel-maintainers list directly.

Passing on to the proper maintainers.
Comment 10 Jeff Mahoney 2011-11-23 00:10:22 UTC
Actually adding the maintainers.
Comment 11 Ludwig Nussel 2011-11-23 07:36:09 UTC
(In reply to comment #9)
> This is garbage. 'halt' has equaled 'poweroff' on SUSE systems for a very, very
> long time. We're not going to switch it now because the systemd authors dictate
> it so. This is a regression as far as I'm concerned.

let's hope you're right

*** This bug has been marked as a duplicate of bug 726387 ***