Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 723522 - sys-auth/elogind does not support runit
Summary: sys-auth/elogind does not support runit
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Andreas Sturmlechner
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2020-05-17 23:50 UTC by Alex Efros
Modified: 2020-05-18 23:43 UTC (History)
2 users (show)

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


Attachments
elogind-243.7.ebuild.patch (elogind-243.7.ebuild.patch,1.55 KB, patch)
2020-05-17 23:50 UTC, Alex Efros
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Efros 2020-05-17 23:50:59 UTC
Created attachment 639904 [details, diff]
elogind-243.7.ebuild.patch

I don't use openrc and boot system using runit instead.
But openrc is hardcoded in elogind ebuild, which makes it broken on my system.

It's easy enough to fix this, here is the patch for ebuild:


--- elogind-243.7.ebuild.orig	2020-04-19 14:39:50.000000000 +0300
+++ elogind-243.7.ebuild	2020-05-18 02:38:32.389491073 +0300
@@ -19,7 +19,7 @@
 
 LICENSE="CC0-1.0 LGPL-2.1+ public-domain"
 SLOT="0"
-IUSE="+acl debug doc +pam +policykit selinux"
+IUSE="+acl debug doc +pam +policykit runit selinux"
 
 BDEPEND="
 	app-text/docbook-xml-dtd:4.2
@@ -64,12 +64,10 @@
 }
 
 src_configure() {
-	local rccgroupmode="$(grep rc_cgroup_mode ${EPREFIX}/etc/rc.conf | cut -d '"' -f 2)"
 	local cgroupmode="legacy"
-
-	if [[ "xhybrid" = "x${rccgroupmode}" ]] ; then
+	if grep -q '^\S\+ /sys/fs/cgroup/unified cgroup2 ' /proc/mounts ; then
 		cgroupmode="hybrid"
-	elif [[ "xunified" = "x${rccgroupmode}" ]] ; then
+	elif grep -q '^\S\+ /sys/fs/cgroup cgroup2 ' /proc/mounts ; then
 		cgroupmode="unified"
 	fi
 
@@ -85,7 +83,9 @@
 		-Dbashcompletiondir="${EPREFIX}/usr/share/bash-completion/completions"
 		-Dman=auto
 		-Dsmack=true
-		-Dcgroup-controller=openrc
+		$(use runit && echo -Dpoweroff-path=/sbin/elogind-poweroff)
+		$(use runit && echo -Dreboot-path=/sbin/elogind-reboot)
+		-Dcgroup-controller=$(usex runit none openrc)
 		-Ddefault-hierarchy=${cgroupmode}
 		-Ddefault-kill-user-processes=false
 		-Dacl=$(usex acl true false)
@@ -108,6 +108,12 @@
 
 	sed -e "s/@libdir@/$(get_libdir)/" "${FILESDIR}"/${PN}.conf.in > ${PN}.conf || die
 	newconfd ${PN}.conf ${PN}
+
+	if use runit; then
+		exeinto /sbin
+		printf '#!/bin/sh\nexec /sbin/runit-init 0\n' | newexe - elogind-poweroff
+		printf '#!/bin/sh\nexec /sbin/runit-init 6\n' | newexe - elogind-reboot
+	fi
 }
 
 pkg_postinst() {