Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 920720 - sys-apps/openrc[sysv-utils] - make reboot/poweroff work standalone (sys-kernel/dracut-059-r5 modules.d/99shutdown/module-setup.sh installs broken poweroff and reboot binaries)
Summary: sys-apps/openrc[sysv-utils] - make reboot/poweroff work standalone (sys-kerne...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-26 15:14 UTC by Esteve Varela Colominas
Modified: 2024-01-22 23:47 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Esteve Varela Colominas 2023-12-26 15:14:02 UTC
On my system, built with sys-apps/openrc[sysv-utils], the /sbin/{shutdown,reboot} binaries are scripts calling /sbin/openrc-shutdown.

When I'm dropped into a dracut shell due to booting issues, using these commands doesn't work for obvious reasons: the openrc-init daemon isn't running, and the openrc-shutdown binary isn't present.

I wonder if there's a way to coerce dracut into installing useful programs here, allowing me to exit out of a rescue shell properly.
Comment 1 Mike Gilbert gentoo-dev 2023-12-27 13:34:18 UTC
Seems like something for the OpenRC project to fix.

Making these shell scripts is unexpected; neither sysvinit nor systemd does that.
Comment 2 Alexander Tsoy 2023-12-27 13:48:10 UTC
As a workaround you can pass "--install openrc-shutdown" to dracut command or add install_optional_items+=" openrc-shutdown " to dracut.conf/dracut.conf.d
Comment 3 Alexander Tsoy 2023-12-27 14:03:57 UTC
(In reply to Alexander Tsoy from comment #2)
> install_optional_items+=" openrc-shutdown "
I wonder if it is OK for openrc to drop config into /usr/lib/dracut/dracut.conf.d with the content above. Saddly, we currently don't have eclass function for querying dracutconfdir
Comment 4 Esteve Varela Colominas 2024-01-17 18:50:05 UTC
I would like to note that "openrc-shutdown" doesn't work either, as openrc-init was never started (and it expects to communicate with that)
Comment 5 Esteve Varela Colominas 2024-01-17 18:51:50 UTC
(this is also why I suggested the dracut package fix this - surely it can be made to install a script that actually does something?)
(though I guess openrc could also detect when openrc-init isn't running and do something sensible with the information)
Comment 6 Mike Gilbert gentoo-dev 2024-01-17 19:38:14 UTC
(In reply to Esteve Varela Colominas from comment #5)
> (this is also why I suggested the dracut package fix this - surely it can be
> made to install a script that actually does something?)

The OpenRC maintainer created this mess; I don't feel the need to clean it up.

I think it would be better to make OpenRC function more like sysvinit with a multi-call binary instead of shell script hacks.

If the OpenRC maintainer disagrees, they should fix dracut with patches upstream.
Comment 7 Esteve Varela Colominas 2024-01-17 20:19:25 UTC
Didn't mean to invoke any animosity, but I meant mostly that there isn't really a guarantee about what /sbin/shutdown actually *is* and what it requires to run. Since no init process ought to be running in dracut (dracut *is* the init), I think it'd make sense for it to implement its own shutdown script. Though I agree something like that should be an upstream request, I figured I'd bounce it here first.