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

Bug 614658

Summary: sys-auth/consolekit: runit support
Product: Gentoo Linux Reporter: Alex Efros <powerman-asdf>
Component: Current packagesAssignee: Jason Zaman <perfinion>
Status: RESOLVED FIXED    
Severity: normal CC: base-system, freedesktop-bugs, williamh
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: runit.patch

Description Alex Efros 2017-04-04 15:32:26 UTC
Created attachment 469138 [details, diff]
runit.patch

When kernel cmdline contains "init=/sbin/runit-init" then PID 1 is runit, which uses different mechanism to reboot/halt: there is no /dev/initctl control file and thus commands like `shutdown -h now` doesn't work. This breaks consolekit restart/stop feature. Attached patch fixes this.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-04-08 07:47:40 UTC
To be honest, I don't think that's a good solution. It unconditionally assumes that any system without /dev/initctl and with runit installed is going to be running it. You really ought to have some better way of figuring out whether runit is being used.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-04-08 07:48:07 UTC
CC-ing runit maintainers.
Comment 3 Alex Efros 2017-04-08 08:17:15 UTC
(In reply to Michał Górny from comment #1)
> You really ought to have some better way of figuring
> out whether runit is being used.

Well, this solution isn't perfect but it's improve current situation, at least.

More reliable solution is

  [ "$(readlink /proc/1/exe)" == /sbin/runit ]

but I wasn't sure is these scripts are executed as root. If they isn't executed as root then on hardened system normal user can't access /proc/1/, so I choose less reliable solution which works for normal users too.
Comment 4 Meoberto Whagbossa 2017-08-09 07:22:36 UTC
Consolekit is also missing support for the newly introduced openrc-init. When using openrc-init, /dev/initctl is non-existant, thus the openrc-shutdown utility should be used instead of shutdown.

Due to the permissions required to use shutdown, it is assumed that the consolekit scripts run as root, and thus [ "$(readlink /proc/1/exe)" == /sbin/runit ] would be a reliable solution for both openrc-init and runit, only substituting /sbin/runit for /sbin/openrc-init in the case of the former.
Comment 5 Larry the Git Cow gentoo-dev 2020-10-04 14:39:18 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39ece3ff2467f0c1a3dc946767f3896d31055198

commit 39ece3ff2467f0c1a3dc946767f3896d31055198
Author:     Mikle Kolyada <zlogene@gentoo.org>
AuthorDate: 2020-10-04 14:33:57 +0000
Commit:     Mikle Kolyada <zlogene@gentoo.org>
CommitDate: 2020-10-04 14:39:06 +0000

    sys-auth/consolekit: remove last-rited pkg
    
    Bug: https://bugs.gentoo.org/727730
    Closes: https://bugs.gentoo.org/644550
    Closes: https://bugs.gentoo.org/667912
    Closes: https://bugs.gentoo.org/644548
    Closes: https://bugs.gentoo.org/601878
    Closes: https://bugs.gentoo.org/699592
    Closes: https://bugs.gentoo.org/651788
    Closes: https://bugs.gentoo.org/614658
    Closes: https://bugs.gentoo.org/593306
    
    Signed-off-by: Mikle Kolyada <zlogene@gentoo.org>

 sys-auth/consolekit/Manifest                       |   6 -
 sys-auth/consolekit/consolekit-0.4.6.ebuild        | 125 -------------------
 sys-auth/consolekit/consolekit-1.1.0-r1.ebuild     | 120 -------------------
 sys-auth/consolekit/consolekit-1.1.2.ebuild        | 131 --------------------
 sys-auth/consolekit/consolekit-1.2.0.ebuild        | 132 ---------------------
 sys-auth/consolekit/consolekit-1.2.1.ebuild        | 132 ---------------------
 sys-auth/consolekit/consolekit-9999.ebuild         | 128 --------------------
 sys-auth/consolekit/files/90-consolekit-3          |  32 -----
 sys-auth/consolekit/files/consolekit-0.2.rc        |  25 ----
 .../files/consolekit-0.4.5-polkit-automagic.patch  |  30 -----
 sys-auth/consolekit/files/consolekit-1.0.0.initd   |  16 ---
 ...ove-the-root-restriction-for-runtime-dirs.patch |  57 ---------
 .../files/consolekit-cleanup_console_tags.patch    |  67 -----------
 ...nsolekit-shutdown-reboot-without-policies.patch |  26 ----
 .../files/consolekit-udev-acl-install_to_usr.patch |  28 -----
 sys-auth/consolekit/files/pam-foreground-compat.ck |  17 ---
 sys-auth/consolekit/metadata.xml                   |  22 ----
 17 files changed, 1094 deletions(-)