[2025-jun-17] The SlackDocs Wiki has moved to a new server, in order to make it more performant.
Table of Contents
Elogind on Slackware
elogind handles suspend, lid switch, and session tracking. Use elogind-inhibit to temporarily block suspend when running important tasks.
Compatibility
This document was written and tested on Slackware-current with elogind-255.23.
The same configuration applies to Slackware 15.0, which ships elogind-246.10. All commands, configuration directives, and D-Bus interfaces shown here are present in both versions.
If you are on a different version, run elogind –version to check.
Overview
Slackware does not use systemd, but it provides logind functionality through elogind.
elogind is responsible for:
- User sessions
- Suspend and power actions
- Lid switch handling (laptops)
- Inhibitors (temporary blocking of actions)
Slackware follows upstream behavior. There are no distribution-specific wrappers or automation layers. All configuration is explicit.
Suspend and Lid Switch
On laptops, the lid switch behavior is controlled by elogind.
Create a configuration file:
/etc/elogind/logind.conf.d/50-power.conf
Example:
[Login] HandleLidSwitch=suspend LidSwitchIgnoreInhibited=no
Explanation:
HandleLidSwitch=suspend
Closing the lid triggers suspend-to-RAM.
LidSwitchIgnoreInhibited=no
Ensures that suspend is blocked when an inhibitor is active.
Restart elogind after changes:
/etc/rc.d/rc.elogind restart
What is Suspend
Suspend (also known as suspend-to-RAM) stores the system state in memory and powers down most hardware.
- Fast resume (a few seconds)
- Low power consumption
- System state is preserved in RAM
This is different from hibernation (suspend-to-disk), which writes memory to disk and powers off completely.
Inhibitors
elogind provides a mechanism to temporarily block suspend and related actions.
This is useful when running long tasks such as package upgrades or backups.
Example:
elogind-inhibit --what=handle-lid-switch:sleep:idle sleep 120
While this command is running:
- Closing the lid will NOT suspend the system
- Idle suspend is blocked
- The system remains fully operational
Real-world example:
elogind-inhibit --what=handle-lid-switch:sleep:idle slackpkg upgrade-all
Note that if –what= is omitted, elogind-inhibit defaults to idle:sleep:shutdown. This default does not include handle-lid-switch, so on a laptop you almost always want to add it explicitly.
Checking Active Inhibitors
The loginctl shipped with elogind does not implement list-inhibitors:
$ loginctl list-inhibitors Unknown command verb 'list-inhibitors'.
Use busctl instead:
busctl call org.freedesktop.login1 /org/freedesktop/login1 \ org.freedesktop.login1.Manager ListInhibitors
Example output on a typical Slackware desktop:
a(ssssuu) 3 "sleep" "NetworkManager" "NetworkManager needs to turn off networks" "delay" 0 2026 "sleep" "UPower" "Pause device polling" "delay" 0 3227 "sleep" "ModemManager" "ModemManager needs to reset devices" "delay" 0 2083
The fields are (What, Who, Why, Mode, UID, PID). The three locks above are normal: they are delay locks used by services to clean up before the system suspends. They do not block suspend.
While an elogind-inhibit is active, a fourth entry appears with Mode=block:
"sleep:idle:handle-lid-switch" "test" "testing" "block" 1000 7664
The difference matters: block actually prevents the action; delay only gives services a window to clean up before the system goes to sleep.
ACPI Event Flow
On Slackware, lid events follow this path:
kernel (input/udev) → elogind → action
↘ acpid (optional, for custom shell scripts)
acpid is shipped (/etc/rc.d/rc.acpid) but is not required for elogind to handle the lid; elogind listens to the kernel directly.
You can monitor raw ACPI events:
acpi_listen
Example output:
button/lid LID close button/lid LID open
These events confirm that the hardware and ACPI layer are working correctly.
Behavior With and Without Inhibit
Without inhibitor:
- Closing the lid → system suspends
With elogind-inhibit:
- Closing the lid → event is received
- Suspend is blocked
- System continues running
This behavior depends on:
LidSwitchIgnoreInhibited=no
Troubleshooting
Lid close does not suspend
Check:
elogindis running- configuration file is correct
- no inhibitors are active
Lid close still suspends with inhibitor
Ensure:
LidSwitchIgnoreInhibited=no
And ensure handle-lid-switch is included in –what=. A plain sleep inhibitor is not enough by default, because lid events ignore high-level locks unless LidSwitchIgnoreInhibited=no is set.
No ACPI events
Check acpid:
/etc/rc.d/rc.acpid status
Verify ACPI events
acpi_listen
Verify elogind events
loginctl monitor
Notes
elogind-inhibititself does not require root, but the wrapped command may (e.g.slackpkg upgrade-all)- Suspend used here is suspend-to-RAM (ACPI S3 or s2idle)
- Hibernation (suspend-to-disk) requires additional configuration and is not covered here
- Slackware does not enforce policy; behavior is defined by configuration
- Two classes of inhibitor locks exist: high-level (
shutdown,sleep,idle) are subject to the*IgnoreInhibited=settings; low-level (handle-*) are always honored
Best Practice
Use elogind-inhibit for temporary control instead of changing global configuration.
Example:
elogind-inhibit --what=handle-lid-switch:sleep:idle command
This avoids permanent changes and keeps system behavior predictable.
Conclusion
elogind provides simple and explicit control over suspend behavior on Slackware.
Using inhibitors allows fine-grained control without adding complexity or relying on external tools.
References
elogind-inhibit(1)loginctl(1)logind.conf(5)
Sources
- Originally written by r1w1s1