From Gentoo Wiki
Jump to: navigation, search
This is a talk page. Please add newer comments below older ones, and sign your comments using four tildes (~~~~). When adding a new section (at the bottom of the page), please mark it as "open for discussion" by using {{talk|open}} so it will show up in the list of open discussions.

Suggestion about Suspend to hibernate with elogind

Talk status
This discussion is still ongoing.

When laptop is suspended to ram, it uses very little power, so when the battery runes out user is forced to fully boot up the machine.

There are two ways to prevent this situation: Hibernate with hybrid-sleep, or use loginctl suspend command with the real-time wake timer hook to allow system to wake up and perform hibernate to disk with loginctl hibernate.

Solution is similar to Sabayon's wiki, but it fully uses loginctl command so sys-power/pm-utils becomes obsolete.

First You have to create folder /lib/elogind/system-sleep/ for sleep hooks, and/or /lib/elogind/system-shutdown/ for shutdown hooks.

Then, in /lib/elogind/system-sleep/ place script:

# Script name: /lib/elogind/system-sleep/
# Purpose: Auto hibernates after a period of sleep
# Edit the "autohibernate" variable below to set the number of seconds to sleep.

curtime=$(date +%s)

# 60 Minutes should be fine

echo "$curtime $1" >>/tmp/autohibernate.log

if [ "$1" = "pre" ]
        if [ "$2" = "suspend" ]
                # Suspending.  Record current time, and set a wake up timer.
                echo "$curtime" >/var/run/rtchibernate.lock
                rtcwake -m no -s $autohibernate

if [ "$1" = "post" ]

        if [ "$2" = "suspend" ]
                # Coming out of sleep
                sustime=$(cat /var/run/rtchibernate.lock)
                rm /var/run/rtchibernate.lock

                # Did we wake up due to the rtc timer above?
                if [ $(($curtime - $sustime)) -ge $autohibernate ]
                        # Then hibernate
                        /bin/loginctl hibernate
                        # Otherwise cancel the rtc timer and wake up normally.
                        rtcwake -m no -s 1

You need to add executable permission with: chmod +x /lib/elogind/system-sleep/ and reboot machine. — The preceding unsigned comment was added by PrSo (talkcontribs) 18th October, 2017

Kernel configuration needs updating

Talk status
This discussion is done as of 2018-01-22.

I can't find "[*] Simplified Mandatory Access Control Kernel Support" on my kernel 4.13.5 configuration.

Maybe it could be worth also specifying the actual CONFIG_* -variables too? Then tell to enable them using provided script (inside scripts -directory inside the kernel source directory). After applying the changes then users would need to run "make oldconfig". --Zucca (talk) 17:58, 24 October 2017 (UTC)

Sure. Can you update the article? The kernel configuration option is CONFIG_SECURITY_SMACK. Cateee is a wonderful site. Kind regards, --Maffblaster (talk) 19:03, 26 October 2017 (UTC)
Likely addressed by this edit: "Enable different security models" (CONFIG_SECURITY) must be enabled to make the option visible. The contents of the {{KernelBox}} template are correct at least for the 4.14-series, so marking as done. — GuillermoDH (talk) 18:53, 8 December 2018 (UTC)

Please describe life without elogind (USE=-elogind)

As I understand we need this for some desktop environments (for example XFCE) when do not want systemd, also for reboot/poweroff without root and mounting without root. Right now I am trying USE=-elogind:

root #emerge --update --deep --with-bdeps=y --newuse --ask @world
[ebuild   R    ] sys-process/procps-3.3.15-r1  USE="-elogind*" 
[ebuild   R    ] gui-apps/swayidle-1.6  USE="-elogind*" 
[ebuild   R    ] sys-apps/dbus-1.12.16  USE="-elogind*" 
[ebuild   R    ] x11-base/xorg-server-1.20.7  USE="-elogind*" 
[ebuild   R    ] gui-libs/wlroots-0.10.0  USE="-elogind*" 
[ebuild   R    ] gui-wm/sway-1.4  USE="-elogind*" 
[ebuild   R    ] sys-auth/pambase-20190402  USE="-elogind*"

Vitaly-zdanevich (talk) 02:24, 17 April 2020 (UTC)

startx integration not need when sys-apps/dbus is installed

sys-apps/dbus-1.12 installs the file /etc/X11/xinit/xinitrc.d/80-dbus which already seems to contain the dbuslaunch command:


# launches a session dbus instance

dbuslaunch="`which dbus-launch 2>/dev/null`"
if [ -n "$dbuslaunch" ] && [ -x "$dbuslaunch" ] && [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
  if [ -n "$command" ]; then
    command="$dbuslaunch --exit-with-session $command"
    eval `$dbuslaunch --sh-syntax --exit-with-session`

--EoD (talk)