Preventing Sleep Mode at Shutdown

How do I prevent sleep mode: my docked Laptop with an external Monitor and a closed Lid always enters suspend to RAM when given the shutdown command.

I am using 13.2 and KDE.

I have already disabled sleep within KDE’s energy settings. The problem occurs after shutdown with a closed lid. If the lid is opened later, the machine only resumes to complete the shutdown. There is no way to continue using the laptop without avoiding the shutdown then, so the sleep is futile.

Advice from old threads here about preventing sleep seems to be outdated, as I no longer find the configuration filed mentioned within the old threads.

Which configuration file are you talking about?

Have a look at /etc/systemd/logind.conf. You can configure systemd-logind’s action when the lid is closed there (option “HandleLidSwitch”), see “man logind.conf” for further details.

I remember a (quite old) bug report about this, but I’m not sure if I can find it. And I thought this was fixed since a while already…
Probably file a new one. A closed lid during shutdown should definitely not suspend the system.

So do I understand correctly that really you don’t want the laptop lid to affect the system?
So the action for lid close is set to ‘do nothing’?

Thanks! This solved it perfectly!

The Laptop starts and shuts down now just fine with the lid being closed throughout.

No, the Laptop Lid should have effects when it is actively closed or opened, but in my case the lid had been closed from booting to shutdown an the system entered sleep instead of shutting down.

The above solution fixes this by disabling the lid detection entirely. This is not 100% what I want, but it is what I asked for to keep things simple. I am quite happy now.

Good to hear!

But the documentation (“man logind.conf”) clearly states:

Note that the lid switch is ignored if the system is inserted in a docking station, or if more than one display is

So your original problem smells like a bug to me, as already mentioned.

I had the same problem and this thread helps me a lot. But like STurtle mentioned “The above solution fixes this by disabling the lid detection entirely.”.
I found a solution which is preventing the sleep mode when the laptop is in a dockingstation.

Open logind.conf

vim /etc/systemd/logind.conf

and add the following line


Now the laptop should be shutdown/log out without switching to suspend.

Quick update from my side:
The solution which I wrote in my previous post works only for a view minutes after booting the laptop into KDE. When I start the laptop, login into KDE and make a reboot, the laptop went down without going in suspend mode. But when I make shutdown or reboot after using the laptop for a longer period, the suspend-problem occurs again.

Maybe there is a problem in KDE itself…

Well, I only tried the HandleLidSwitch-option, but from what I learned, it only takes any effect outside of KDE, which is incidentally exactly what I wanted.

Without it, the Laptop would suspend while docked with lid closed, once I issue the shutdown command in KDE. Now, it no longer does that. However, KDE suspend and lid closing still works as before, as set in the KDE power settings. Looks like KDE ignores/supersedes these kind of settings while it is running, but not during startup and shutdown.

Strange thing. I had the “chance” to reinstall openSUSE recently and decided not to install nvidia drivers give noveau a go. What shall I say. Everything works flawlessly…except playing Fahrenheit :). Maybe I have to live with that problem and hope that it will be fixed in newer version of KDE/nvidia/kernel.