Linux Sleep

My Ubuntu Server 18.04, is without a monitor / keyboard connected (headless server) and has been running for several years, but today I updated to the latest kernel version because I couldn’t find the solution to a problem that suddenly appeared and without any apparent cause: AMD-Vi IO_PAGE_FAULT error. From what I found online, it seems to be a bug present on systems with AMD Ryzen processor and apparently would have solved in the last kernel.

All good and beautiful, I updated the kernel, reinstalled the latest driver from nvidia + patch to remove the limitations of NVEC and that’s about it.

Later, after 30 minutes, I noticed that the server was no longer responding and the surprise was to find it stopped, luckily I was at home, otherwise I would be gone for 1-2 weeks until I returned.

I pressed the button and it came back online in a few seconds, so I realized it was on standby! But after an hour the same story happened again … I checked the logs to see what was happening, and here’s what I found:

Feb 26 21:19:05 zen NetworkManager [1059]: [1645910345.5047] manager: sleep: sleep requested (sleeping: no enabled: yes)
Feb 26 21:19:05 zen NetworkManager [1059]: [1645910345.5049] manager: NetworkManager state is now ASLEEP
Feb 26 21:19:05 zen ModemManager [1171]: [sleep-monitor] system is about to suspend
Feb 26 21:19:05 zen gnome-shell [1560]: Screen lock is locked down, not locking

I don’t know why, it may be related to the inactive SSH session or an SSH communication error, because it happened while I was logged in and we have an open terminal. The first time I even worked in the terminal … the second time it was in the background.

But I’m pretty sure it’s something related to the new kernel, because I’ve never had this problem since I got the server, it never stopped on its own in 4 years, even if it’s not mains electricity, because I have backup UPS on it with 12 hours of autonomy.

But since I’m in a hurry, I don’t have time to look for a clear answer and consequently I disabled Sleep / Standby using the following command:

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
Created symlink /etc/systemd/system/sleep.target → / dev / null.
Created symlink /etc/systemd/system/suspend.target → / dev / null.
Created symlink /etc/systemd/system/hibernate.target → / dev / null.
Created symlink /etc/systemd/system/hybrid-sleep.target → / dev / null.

then I checked the status:

systemctl sleep.target status
● sleep.target
Loaded: masked (Reason: Unit sleep.target is masked.)
Active: inactive (dead) since Sat 2022-02-26 21:28:41 UTC; 18min ago
Feb 26 21:19:05 zen systemd [1]: Reached target Sleep.
Feb 26 21:28:41 zen systemd [1]: Stopped target Sleep.

Now I hope everything is ok, I have another day to make sure I have access to the home server while I’m gone.

Tags: , , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *