Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 755422

Summary: sys-apps/openrc: sysv shutdown util diverges from the defined interface wrt powering off
Product: Gentoo Hosted Projects Reporter: Andriy Utkin (RETIRED) <andrey_utkin>
Component: OpenRCAssignee: William Hubbs <williamh>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 759034    
Bug Blocks: 726092    

Description Andriy Utkin (RETIRED) gentoo-dev 2020-11-19 06:32:09 UTC
"shutdown -h now" should power off, but it just only the machine.

OpenRC mimics System V init system in this case, so System V init system interfaces documentation define how things must work.

According to shutdown(8) man page from sys-apps/sysvinit, `/sbin/shutdown -h ...` means "Equivalent to -P, unless -H is specified". And the option `-P` means "Action is to turn off the power". So acpid invokes a command which means powering off. So if openrc-provided shutdown tool doesn't power off the machine, it's the fault of openrc-provided shutdown tool.

The following statements have been confirmed.

* Commands "/sbin/shutdown -P now", "/lib/rc/bin/shutdown -P now" do turn off the power.
* Manually patching "h) shutdown_arg=--halt ;;" to "h) shutdown_arg=--poweroff ;;" in /lib/rc/bin/shutdown makes "shutdown -h now" to power machine off as expected.

Originally reported in https://bugs.gentoo.org/726092 .

Reproducible: Always

Steps to Reproduce:
1. install openrc[sysv-utils]
2. "shutdown -h now"
Actual Results:  
system halted

Expected Results:  
system powered off
Comment 1 Andriy Utkin (RETIRED) gentoo-dev 2020-12-01 14:41:43 UTC
Seems to be addressed by williamh in https://github.com/OpenRC/openrc/commit/38aaba28ee86602e29d8a31f155dfa72f5481e68

Huge thanks! Please mark this bug resolved when you feel appropriate - I don't know for sure, maybe you mean to do something else with this before closing.
Comment 2 Andriy Utkin (RETIRED) gentoo-dev 2021-04-26 09:27:10 UTC
OpenRC 0.43 is out with the fix.