Author Topic: Debian / GNOME default sleep settings: guaranteed crash  (Read 4869 times)

pocock

  • Sr. Member
  • ****
  • Posts: 296
  • Karma: +32/-0
    • View Profile
Debian / GNOME default sleep settings: guaranteed crash
« on: September 13, 2022, 04:10:00 pm »

I did a fresh Debian install on one system and then left it at the GNOME login screen while making a phone call.

When I came back, the screen was frozen, SSH was not working any more but the CPUs and fans still active.

I rebooted it, checked the log and found that it had tried to sleep and managed to become frozen.

It is probably a good idea to track this with bug reports in both Debian and GNOME and change their default settings on ppc64le.

However, is there anything that can be done at a lower level, for example, in the kernel, to reject the sleep attempt rather than letting the system get into this frozen state?  If that could make it appear stable for every OS it would be much better than fixing it in one distribution at a time.

It was kind of obvious to me what had happened before I even looked in the logs but I can imagine some users might get a fright
Debian Developer
https://danielpocock.com

MauryG5

  • Hero Member
  • *****
  • Posts: 760
  • Karma: +22/-1
    • View Profile
Re: Debian / GNOME default sleep settings: guaranteed crash
« Reply #1 on: September 13, 2022, 04:51:09 pm »
Hi Daniel, I remember this happening to me when I was using Ubuntu in version 20.04. If I left the computer for a while without using it, it would go to sleep with a black screen but when I tried to restore it from that state, the computer never recovered and crashed completely and you had to restart it. On Debian it never happened to me to be honest, I thought at the time that it was one of the many small Ubuntu bugs on Power but on Debian honestly I never tried to make it go to stand-by and then resume it ...

pocock

  • Sr. Member
  • ****
  • Posts: 296
  • Karma: +32/-0
    • View Profile
Re: Debian / GNOME default sleep settings: guaranteed crash
« Reply #2 on: September 14, 2022, 01:22:39 am »

If you make a fresh install of Debian with GNOME and then go and look at the default Settings panel for Power, you will see "Power Saving" default setting

The Debian wiki has some notes about systems which should never go to sleep.  In particular, they show some settings in systemd so it seems this can't just be fixed by changing the settings in GNOME

Code: [Select]
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

This default is one of many ways where systemd appears to diverge from a traditional UNIX-like system.

You can check the current status of a system by checking each of those targets with the status command:

Code: [Select]
$ sudo systemctl status sleep.target
● sleep.target - Sleep
     Loaded: loaded (/lib/systemd/system/sleep.target; static)
     Active: inactive (dead)
       Docs: man:systemd.special(7)

and on a system where the target was disabled:

Code: [Select]
$ sudo systemctl status sleep.target
● sleep.target
     Loaded: masked (Reason: Unit sleep.target is masked.)
     Active: inactive (dead)
[code]
Debian Developer
https://danielpocock.com

MauryG5

  • Hero Member
  • *****
  • Posts: 760
  • Karma: +22/-1
    • View Profile
Re: Debian / GNOME default sleep settings: guaranteed crash
« Reply #3 on: September 17, 2022, 04:42:20 pm »
Just today I accidentally hit a key dedicated to sleep on my keyboard and in fact it made the problem of going to sleep and then it never recovered, forcing me to restart everything. I gave that command you reported and in fact the result is: mauriziop9 @ debian: ~ $ sudo systemctl status sleep.target
[sudo] mauriziop9 password:
● sleep.target - Sleep
      Loaded: loaded (/lib/systemd/system/sleep.target; static)
      Active: inactive (dead)
        Docs: man: systemd.special (7)

Corvidae

  • Newbie
  • *
  • Posts: 25
  • Karma: +11/-0
    • View Profile
Re: Debian / GNOME default sleep settings: guaranteed crash
« Reply #4 on: September 18, 2022, 07:07:58 pm »
This isn't the best solution because it requires recompiling the kernel, but if you disable CONFIG_SUSPEND in the kernel config it should make it impossible for it to happen. From what I can tell, the s2idle state linux provides when suspend is enabled "works" in that it enters that state, but wakeup sources don't seem to work, so you can never get out of it.

MauryG5

  • Hero Member
  • *****
  • Posts: 760
  • Karma: +22/-1
    • View Profile
Re: Debian / GNOME default sleep settings: guaranteed crash
« Reply #5 on: September 19, 2022, 03:45:05 pm »
At this point I can try to disable CONFIG_SUSPEND as you tell me in the next Kernel compilation I will do. Let's see if it stops making this strange flaw ... Thanks, I update the post as soon as I compile the next Kernel which will be the new stable 6.0 that I will try as usual as soon as it is available.

MauryG5

  • Hero Member
  • *****
  • Posts: 760
  • Karma: +22/-1
    • View Profile
Re: Debian / GNOME default sleep settings: guaranteed crash
« Reply #6 on: October 17, 2022, 03:57:48 pm »
I tried looking for this CONFIG_SUSPEND option you told me about but I couldn't find it in the various entries while compiling the new 6.0.1 Kernel. Under which menu is this item located? Thank you

Corvidae

  • Newbie
  • *
  • Posts: 25
  • Karma: +11/-0
    • View Profile
Re: Debian / GNOME default sleep settings: guaranteed crash
« Reply #7 on: November 25, 2022, 11:39:32 pm »
I tried looking for this CONFIG_SUSPEND option you told me about but I couldn't find it in the various entries while compiling the new 6.0.1 Kernel. Under which menu is this item located? Thank you

Sorry for not responding to this earlier! It should be under kernel options -> suspend to RAM and standby

MauryG5

  • Hero Member
  • *****
  • Posts: 760
  • Karma: +22/-1
    • View Profile
Re: Debian / GNOME default sleep settings: guaranteed crash
« Reply #8 on: November 26, 2022, 09:19:17 am »
Ok thanks, don't worry, there are no problems, we answer when possible, I will look for this option as soon as I compile the new Kernel 6.1 in stable version. I'm waiting for its release...