Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 944832 - sys-kernel/scx: openrc start script broken: /usr/bin/openrc-run: no such file or directory
Summary: sys-kernel/scx: openrc start script broken: /usr/bin/openrc-run: no such file...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Violet Purcell
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2024-11-24 23:08 UTC by Holger Hoffstätte
Modified: 2024-11-26 16:32 UTC (History)
3 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 Holger Hoffstätte 2024-11-24 23:08:37 UTC
I'm finally giving scx (1.0.6-r1) a try and it seems I'm the first person to use openrc:

root>/etc/init.d/scx 
zsh: /etc/init.d/scx: bad interpreter: /usr/bin/openrc-run: no such file or directory

Changing the interpreter to the usual /sbin/openrc-run makes it work.
Maybe this is a split/merged-usr issue compared to CachyOS but IMHO it should work nevertheless.

The upstream openrc support can be found here:
https://github.com/sched-ext/scx/tree/main/services/openrc

Not sure about the best way to fix this - sed the first line or just drop a fixed script into $FILESDIR and install it as necessary.


Reproducible: Always

Steps to Reproduce:
1. install scx-1.0.6-r1 with USE=openrc enabled
2. /etc/init.d/scx fails
3. :(
Comment 1 Holger Hoffstätte 2024-11-26 12:27:09 UTC
This works for me:

--snip--
@@ -359,6 +359,9 @@ src_prepare() {
 	# Inject the rust_abi value into install_rust_user_scheds
 	sed -i "s;\${MESON_BUILD_ROOT};\${MESON_BUILD_ROOT}/$(rust_abi);" \
 		meson-scripts/install_rust_user_scheds || die
+
+	# Fix up openrc service script (#944832)
+	use openrc && sed -i 's/usr\/bin/sbin/g' "${S}"/services/openrc/scx.initrd || die
 }
 
 src_configure() {
--snip--
Comment 2 Holger Hoffstätte 2024-11-26 13:17:19 UTC
(In reply to Holger Hoffstätte from comment #1)
> This works for me:

..except that it doesn't work for -openrc, sigh. fixed:

--snip--

@@ -359,6 +359,9 @@ src_prepare() {
 	# Inject the rust_abi value into install_rust_user_scheds
 	sed -i "s;\${MESON_BUILD_ROOT};\${MESON_BUILD_ROOT}/$(rust_abi);" \
 		meson-scripts/install_rust_user_scheds || die
+
+	# Fix up openrc service script (#944832)
+	use openrc && (sed -i 's/usr\/bin/sbin/g' "${S}"/services/openrc/scx.initrd || die)
 }
 
 src_configure() {
--snip--
Comment 3 Florian Schmaus gentoo-dev 2024-11-26 16:27:31 UTC
(In reply to Holger Hoffstätte from comment #2)
> 's/usr\/bin/sbin/g'


This would also change

command="/usr/bin/$SCX_SCHEDULER"

to

command="/sbin/$SCX_SCHEDULER"

Not sure if that's what we want, given that scx installs its binaries under /usr/bin. Maybe it is better to fix the openrc she-bang?
Comment 4 Larry the Git Cow gentoo-dev 2024-11-26 16:32:38 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53d62fca42306efee6f52deaafd5757428f710cd

commit 53d62fca42306efee6f52deaafd5757428f710cd
Author:     Florian Schmaus <flow@gentoo.org>
AuthorDate: 2024-11-26 16:29:54 +0000
Commit:     Florian Schmaus <flow@gentoo.org>
CommitDate: 2024-11-26 16:32:00 +0000

    sys-kernel/scx: fix openrc init
    
    Closes: https://bugs.gentoo.org/944832
    Signed-off-by: Florian Schmaus <flow@gentoo.org>

 sys-kernel/scx/{scx-1.0.6-r1.ebuild => scx-1.0.6-r2.ebuild} | 4 ++++
 1 file changed, 4 insertions(+)