Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Why Does Server OS Auto Suspend?

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
bithead
Posts: 48
Joined: 2015-10-21 02:54
Been thanked: 2 times

Why Does Server OS Auto Suspend?

#1 Post by bithead »

I have a Bullseye server which was recently installed. The console is at the Gnome login screen with no user logged in. I'm logged in to the server via ssh, and as I'm about to execute a 'mkfs.ext4...' command, the ssh session locks up. Huh?

It turns out that the server is set to auto-suspend after 20 minutes of inactivity on the server console. Even with multiple active ssh sessions, the server goes into suspend mode if no one is logged in on the console. This leads to a couple of questions...

What is the reason that a new server installations defaults to enabling suspend mode after 20 minutes of inactivity? This is a server OS after all, not a desktop OS like Ubuntu where auto-suspend would make sense.

More importantly, why is "inactivity" only evaluated at the physical server console? How is it that remote network activity fails to keep it awake? Had I been a few seconds earlier with my mkfs.ext4 command, suspension would have occurred during the file system creation process!! A pretty picture this does not make.

The auto-suspend mode is easy enough to disable, but it really should not be needed:

Code: Select all

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
Some docs say to reboot after issuing the above command, but I've not found that not to be necessary as can seen with:

Code: Select all

sudo systemctl status sleep.target suspend.target hibernate.target hybrid-sleep.target
In any event, the default behavior is redonculous and needs to be rethought and reprogrammed.

klt
Posts: 13
Joined: 2022-08-29 10:59
Has thanked: 1 time

Re: Why Does Server OS Auto Suspend?

#2 Post by klt »

bithead wrote: 2022-09-10 19:43 What is the reason that a new server installations defaults to enabling suspend mode after 20 minutes of inactivity? This is a server OS after all, not a desktop OS like Ubuntu where auto-suspend would make sense.
What is the reason you have Gnome installed on a server? I run couple of servers based on Debian, none of the suspend on their own. They don't have X nor any DE installed though...

Check this link, it may provide you some hint:
https://askubuntu.com/questions/942366/ ... gin-screen

bithead
Posts: 48
Joined: 2015-10-21 02:54
Been thanked: 2 times

Re: Why Does Server OS Auto Suspend?

#3 Post by bithead »

What is the reason you have Gnome installed on a server?
Fair question - I am doing some evaluation of ProtonVPN. The supported iterations use NetworkManager to configure interfaces and Gnome-Keyring for user auth to the VPN, so for the moment I need some DE installed. Also, while I normally work from a CLI, sometimes I like to have a GUI available. I'm not an in-depth user of any GUI on Linux. I've tried Gnome and Mate and prefer Gnome for it's ability to search for apps using partial names. Beyond that I'm really not sure what the most appropriate GUI config would be for occasional use on a server.

But it sounds like you're saying that Gnome is the culprit here re: the suspend mode, and as I think about it, that makes sense. By installing Gnome, I've essentially indicated that I'll be using the server like a desktop machine, and so it acts like one. So that answers my first question from the original post. My final thought still stands though... network activity via ssh should be considered activity with regard to suspend mode. In this case, I guess that's one for the Gnome developers to work out.

klt
Posts: 13
Joined: 2022-08-29 10:59
Has thanked: 1 time

Re: Why Does Server OS Auto Suspend?

#4 Post by klt »

bithead wrote: 2022-09-10 20:58 I've tried Gnome and Mate and prefer Gnome for it's ability to search for apps using partial names.
MATE does that too, just with the Advanced MATE Menu ;)
Beyond that I'm really not sure what the most appropriate GUI config would be for occasional use on a server.
A GUI takes up resources, normally dedicated to server tasks.
In your case the GUI is needed temporally, until you sort out things for your VPN, after that you'll revert to console/headless mode - I guess.
But it sounds like you're saying that Gnome is the culprit here re: the suspend mode, and as I think about it, that makes sense.
Did not test, but I guess any DE would do the same.
It seems, that the display manager (login screen) initiates the suspend, which is in your case an unwanted "feature", you need to disable it.
The link I gave you shows some hints, how to disable this power saving feature for the user whose name the DM runs in.

bithead
Posts: 48
Joined: 2015-10-21 02:54
Been thanked: 2 times

Re: Why Does Server OS Auto Suspend?

#5 Post by bithead »

MATE does that too, just with the Advanced MATE Menu ;)
Guess I never found that one.
A GUI takes up resources, normally dedicated to server tasks.
Understood. Even so, I'll likely install but not automatically run a GUI in the final iteration. I can run 'startx' as needed.
The link I gave you shows some hints, how to disable this power saving feature for the user whose name the DM runs in.
Actually my initial post shows how to disable suspend and similar modes for the machine, no user connection required. :)

rickvs
Posts: 4
Joined: 2017-08-24 20:03
Has thanked: 1 time

Re: Why Does Server OS Auto Suspend?

#6 Post by rickvs »

Hello bithead,
Thanks for your tip. The same thing happened to my with a desktop computer that I recently only use through vnc. I also found something funny: if I log on in a physical, non remote console, and then logout, then the suspension does not activate. Absolutely a bug.
regards

bithead
Posts: 48
Joined: 2015-10-21 02:54
Been thanked: 2 times

Re: Why Does Server OS Auto Suspend?

#7 Post by bithead »

if I log on in a physical, non remote console, and then logout, then the suspension does not activate.
Good to know. Sort of a poor man's workaround. :)

Post Reply