[Solved] Odd message "The system will suspend now!" in SSH even though suspend is disabled

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
olignyf
Posts: 5
Joined: 2023-09-09 02:24

[Solved] Odd message "The system will suspend now!" in SSH even though suspend is disabled

#1 Post by olignyf »

I just installed Debian 12.
I did the following as per the doc https://wiki.debian.org/Suspend

Code: Select all

systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
Then rebooted.
The system successfully stays awake.

However my SSH sessions receive this unexpected message

Code: Select all

Broadcast message from Debian-gdm@angel on tty1 (Sat 2023-09-09 11:00:59 EDT):

The system will suspend now!
Image

The SSH session stays alive though.
Last edited by olignyf on 2023-10-20 00:03, edited 1 time in total.

lindi
Debian Developer
Debian Developer
Posts: 486
Joined: 2022-07-12 14:10
Has thanked: 2 times
Been thanked: 93 times

Re: Odd message "The system will suspend now!" in SSH even though suspend is disabled

#2 Post by lindi »

That just means that gnome was about to call the API that suspends the system. It does not know that it is disabled

lindi
Debian Developer
Debian Developer
Posts: 486
Joined: 2022-07-12 14:10
Has thanked: 2 times
Been thanked: 93 times

Re: Odd message "The system will suspend now!" in SSH even though suspend is disabled

#3 Post by lindi »

Masking that service might not be the best way to disable suspend.

olignyf
Posts: 5
Joined: 2023-09-09 02:24

Re: Odd message "The system will suspend now!" in SSH even though suspend is disabled

#4 Post by olignyf »

I found the solution. This method works better and doesn't have the spurious message on connected SSH clients.

Create /etc/systemd/sleep.conf.d/nosuspend.conf as

Code: Select all

[Sleep]
AllowSuspend=no
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no
They should probably edit the documentation and swap both solution so this one is the first one and not marked as an "alternative"

Aki
Global Moderator
Global Moderator
Posts: 3370
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 92 times
Been thanked: 442 times

Re: Odd message "The system will suspend now!" in SSH even though suspend is disabled

#5 Post by Aki »

Hello,
olignyf wrote: 2023-09-14 02:09 I found the solution. This method works better and doesn't have the spurious message on connected SSH clients.

Create /etc/systemd/sleep.conf.d/nosuspend.conf as

Code: Select all

[Sleep]
AllowSuspend=no
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no
They should probably edit the documentation and swap both solution so this one is the first one and not marked as an "alternative"
Thank you for sharing the solution. Please update the discussion by adding the tag "[Solved]" to the beginning of the subject of the first post. Happy Debian ! :-)
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

olignyf
Posts: 5
Joined: 2023-09-09 02:24

Re: Odd message "The system will suspend now!" in SSH even though suspend is disabled

#6 Post by olignyf »

Aki wrote: 2023-09-14 05:57 Thank you for sharing the solution. Please update the discussion by adding the tag "[Solved]" to the beginning of the subject of the first post. Happy Debian ! :-)
Thanks Aki! Shouldn't the documentation be updated for it to be considered solved? How can I submit a correction to the doc?

Aki
Global Moderator
Global Moderator
Posts: 3370
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 92 times
Been thanked: 442 times

Re: Odd message "The system will suspend now!" in SSH even though suspend is disabled

#7 Post by Aki »

Hello,
olignyf wrote: 2023-09-16 22:36
Aki wrote: 2023-09-14 05:57 Thank you for sharing the solution. Please update the discussion by adding the tag "[Solved]" to the beginning of the subject of the first post. Happy Debian ! :-)
Thanks Aki! Shouldn't the documentation be updated for it to be considered solved? How can I submit a correction to the doc?
I suggested to mark the discussion as "solved" since you "solved" your issue: the suspension message does not appear in ssh sessions.

The manual page for systemd-sleep.conf [1] already explains how to configure its parameters and systemd-sleep [2] explains the service. The documentation seems fine to me.

As already user @lindi pointed out in previous posts, you disabled the suspension service, but you didn't identified what triggers it. Perhaps this would merit further investigation on your part if you are interested. I'm not a gnome user, but a quick search landed here (as an example): ---
[1] https://manpages.debian.org/bookworm/systemd/systemd-sleep.conf.5.en.html
[2] https://manpages.debian.org/bookworm/systemd/systemd-sleep.8.en.html
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

olignyf
Posts: 5
Joined: 2023-09-09 02:24

Re: Odd message "The system will suspend now!" in SSH even though suspend is disabled

#8 Post by olignyf »

Aki wrote: 2023-09-17 06:21 The documentation seems fine to me.
The documentation list the problematic method first and the newer working method secondly as an alternative... it should be reversed.

User avatar
eccenux
Posts: 1
Joined: 2023-10-02 18:43

Re: Odd message "The system will suspend now!" in SSH even though suspend is disabled

#9 Post by eccenux »

What is interesting is that when you upgrade from e.g. Debian 10 to 12 the system will suspend when you are reading changelogs or make decisions. The system is suspended without any warning! Without any message visible in SSH console. This is bad. VERY BAD. It made me drive to work today... I blamed UPS initially (mostly because I don't have a screen on this computer)... So that was "fun". Never would've thought this could be intentional (to suspend during upgrade I mean).

When this happens during upgrade you seem to be able to join apt process (like `sudo apt full-upgrade`) by using:

Code: Select all

sudo killall apt
sudo dpkg --configure -a
This makes apt continue from the place where there was a question about configuration changes.

olignyf
Posts: 5
Joined: 2023-09-09 02:24

Re: Odd message "The system will suspend now!" in SSH even though suspend is disabled

#10 Post by olignyf »

Aki wrote: 2023-09-17 06:21 (...)
As already user @lindi pointed out in previous posts, you disabled the suspension service, but you didn't identified what triggers it. Perhaps this would merit further investigation on your part if you are interested. I'm not a gnome user, but a quick search landed here (as an example): ---
[1] https://manpages.debian.org/bookworm/systemd/systemd-sleep.conf.5.en.html
[2] https://manpages.debian.org/bookworm/systemd/systemd-sleep.8.en.html
I'm not sure why you guys mention Gnome. I'm not using Gnome. The issue occurs when leaving the computer idle at login screen then doing remote login SSH session to the system. What additional investigation is needed? Adjusting the documentation seems to be the next step at this point. I updated the topic to [Solved].

Post Reply