Your Linux Laptop Won't Suspend? Here's What You Can Do
You close the lid and the laptop keeps running. Or you leave it alone for an hour and it never goes to sleep. Often nothing is broken. The cause is a program that asked systemd to hold off sleep.
That request is called an inhibitor lock. In this article, you'll list the locks on your system, read what each one blocks, tell a lock that stops a suspend from one that only delays it, and close the program that holds it.
Every command here works on any distribution that uses systemd. I ran them on an Ubuntu 26.04 desktop virtual machine with GNOME, which ships systemd 259.
What an inhibitor lock is
A program takes an inhibitor lock from systemd-logind , the systemd service that handles sleep, shutdown and the power keys. The lock says what the program wants to hold back, why, and for how long.
A backup tool might hold a lock while it copies files, so the laptop doesn't suspend halfway through. A video player might hold one so the screen doesn't go idle during a movie. When the program exits, its lock goes away with it.
The problem starts when a program holds a lock it no longer needs, or holds a stronger lock than it should.
List every inhibitor lock
The systemd-inhibit command lists the active locks. It needs no root.
systemd-inhibit --list
To have a lock to clear later in this article, I first started a stand-in backup job wrapped in systemd-inhibit . It holds a block lock on sleep and shows up as "Backup script". Everything else in the list below came from the system itself.
WHO UID USER PID COMM WHAT WHY MODE
Backup script 0 root 4952 systemd-inhibit sleep Copying files to the NAS block
ModemManager 0 root 1322 ModemManager sleep ModemManager needs to reset devices delay
NetworkManager 0 root 1196 NetworkManager sleep NetworkManager needs to turn off networks delay
Realtime Kit 0 root 1497 rtkit-daemon sleep Demote realtime scheduling and stop canary. delay
UPower 0 root 2006 upowerd sleep Pause device polling delay
Unattended Upgrades Shutdown 0 root 1365 unattended




Comments
No comments yet. Be the first to share your thoughts.