Upgrade from 9 to 10. Now it sleeps

Hello, all.

I just finished upgrading a machine from AlmaLinux 9 minimal to 10 using ELevate and Leap. And now, for some reason, the machine goes to sleep/suspend/hibernate after a period of time. I can hit the power button and it wakes up. Again, this is a brand new issue since the upgrade. I never experienced this in AlmaLinux 9.

Is there anything I should look for in any configs to disable or enable to keep it from going to sleep/suspend/hibernate?

Thanks.

I found the fix.

For those that may run into the issue: I found in Journalctl the following message before the server went offline, “systemd-logind[925]: The system will suspend now!”. To give credit to Google’s search and AI response, which I am actually reluctant to do, I completed this as the fix:

I created the directory sleep.conf.d under /etc/systemd and a file nosuspend.conf in that new directory with the following contents:

[Sleep]
AllowSuspend=no
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no

Then ran the command as root systemctl daemon-reload. No more suspend/sleep/hibernation.

I have a fresh install of 10.2 with no custom settings and my desktop was trying to hibernate. Should this file be a default part of the installation?

This workaround is valid, but it only disables suspend.

It would also be useful to check what triggered systemd-logind to suspend the system after the AlmaLinux 10 upgrade.

As redadmin mentioned, take a look at systemd.logind, it’s probably configured there.
Check what for example IdleAction and IdleActionSec is configured to.
Configure as you prefer, probably best to create a dropin override file in /etc/systemd/logind.conf.d/