Linux System Suspend
Usually, at the end of a workday or when moving between places, I suspend my Linux-based laptop. I simply press the sleep button on my external keyboard or click on the suspend button in Gnome. Today, however, this did not work. My machine was blocked from going to suspend. Was there any other option to suspend it? Or could I find out what as blocking it?
In the bash shell, I tried the command line option (which I found): systemctl suspend was supposed to suspend my Fedora system. Would it?
$ systemctl suspend
Operation inhibited by "hloeser" (PID 3765 "gnome-session-b", user hloeser), reason is "user session inhibited".
Please retry operation after closing inhibitors and logging out other users.
'systemd-inhibit' can be used to list active inhibitors.
Alternatively, ignore inhibitors and users with 'systemctl suspend -i'.
No. But the output revealed that I had to look for an inhibitor or to ignore the inhibitor. I decided to look into it and learn.
Inhibitors
First, I tried the suggested command, systemd-inhibit. The output was a longer list of programs and system processes. Hence, I did not consider it useful and searched for alternatives. That’s when gnome-session-inhibit showed up. Apparently, the command can create inhibitors and also list them.
$ gnome-session-inhibit -l
/opt/brave.com/brave/brave: Download in progress (suspend)
It seemed that some browser download was still in progress. Had I downloaded anything? I exited the browser and tried to suspend again, but did not succeed. Next, I ran ps -ef | grep brave to look for background processes. I found plenty of them. Apparently, my session of “Microsoft PowerPoint Online” in which I downloaded the PDF and PPTX versions was the culprit. Microsoft as inhibitor to my Linux machine…
I terminated the background processes, pressed the suspend button, and my machine went to sleep.
If you have feedback, suggestions, or questions about this post, please reach out to me on Mastodon (@data_henrik@mastodon.social) or LinkedIn.