From Gentoo Wiki
Jump to:navigation Jump to:search
Before creating a discussion or leaving a comment, please read about using talk pages. To create a new discussion, click here. Comments on an existing discussion should be signed using ~~~~:
A comment [[User:Larry|Larry]] 13:52, 13 May 2024 (UTC)
: A reply [[User:Sally|Sally]] 18:09, 20 June 2024 (UTC)
:: Your reply ~~~~

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)

Talk status
This discussion is still ongoing.

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

Talk status
This discussion is still ongoing.

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) (2020-06-28)

This file only gets called (via /etc/X11/xinit/xinitrc) if the user doesn't have an .xinitrc file, or has XINITRC set to /etc/X11/xinit/xinitrc. From the startx(1) man page:

To determine the client to run, startx first checks the environment variable XINITRC for a filename. If that variable is unset, or does not contain a filename, it looks for a file called .xinitrc in the user's home directory. If that is not found, it uses the file xinitrc in the xinit library directory.

-- Flexibeast (talk) 06:51, 29 May 2023 (UTC)