Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 614658 - sys-auth/consolekit: runit support
Summary: sys-auth/consolekit: runit support
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jason Zaman
Depends on:
Reported: 2017-04-04 15:32 UTC by Alex Efros
Modified: 2020-10-04 14:39 UTC (History)
3 users (show)

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

runit.patch (runit.patch,1014 bytes, patch)
2017-04-04 15:32 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 2017-04-04 15:32:26 UTC
Created attachment 469138 [details, diff]

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):

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

    sys-auth/consolekit: remove last-rited pkg
    Signed-off-by: Mikle Kolyada <>

 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/ |  17 ---
 sys-auth/consolekit/metadata.xml                   |  22 ----
 17 files changed, 1094 deletions(-)