LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Disable Suspend-Hibernate - How? (https://www.linuxquestions.org/questions/linux-desktop-74/disable-suspend-hibernate-how-4175719319/)

llewellen 11-30-2022 09:05 PM

Disable Suspend-Hibernate - How?
 
1 Attachment(s)
Dell Inspiron 7370 running Crunchbang++ (Deb 11.1 upgraded) with Openbox

After about 5 minutes of no keyboard activity my system goes into suspend or hibernate (can't tell which) and I cannot find any means to restore it. I have to hard shut down and boot again.

However, if I select Exit from the OB menu I get what I believe is the lightdm shut down window, from which I can select the "Suspend" option. I am then able to restore by touching any key which brings up a login prompt from XScreenSaver and all is well.

Debian Wiki advises this means to disable suspend and hiberate which I have implemented - to no effect:

"A modern alternative approach for disabling suspend and hibernation is to create /etc/systemd/sleep.conf.d/nosuspend.conf as

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

The above technique works on Debian 10 Buster and newer. See systemd-sleep.conf(5) for details."

Other sources found on the internet suggested these two possible solutions which I have tried - to no effect:

Code:

ken@cbpp:~$ sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
[sudo] password for ken:
ken@cbpp:~$ sudo systemctl status sleep.target suspend.target hibernate.target hybrid-sleep.target
● sleep.target
    Loaded: masked (Reason: Unit sleep.target is masked.)
    Active: inactive (dead)
● suspend.target
    Loaded: masked (Reason: Unit suspend.target is masked.)
    Active: inactive (dead)
● hibernate.target
    Loaded: masked (Reason: Unit hibernate.target is masked.)
    Active: inactive (dead)
● hybrid-sleep.target
    Loaded: masked (Reason: Unit hybrid-sleep.target is masked.)
    Active: inactive (dead)
ken@cbpp:~$

Someone suggested editing /etc/systemd/sleep.conf This is what mine now looks like. No effect after rebooting
[[Sleep]
AllowSuspend=no
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no
#SuspendMode=
#SuspendState=mem standby freeze
#HibernateMode=platform shutdown
#HibernateState=disk
#HybridSleepMode=suspend platform shutdown
#HybridSleepState=disk
#HibernateDelaySec=180min/pre]

My system power manager is set to "never" suspend:


No solution with any of these. Suggestions?

frankbell 11-30-2022 09:09 PM

Maybe I missed something, but have you looked in the system settings?

llewellen 11-30-2022 09:18 PM

Quote:

Originally Posted by frankbell (Post 6395421)
Maybe I missed something, but have you looked in the system settings?

Sorry, yes I should have stated that. I will edit my OP to include that. Thanks.

rclark 12-01-2022 04:30 PM

On that 'system settings' you did do the 'plugged in' tab, not just the battery tab... Just checking.

llewellen 12-01-2022 07:23 PM

Quote:

Originally Posted by rclark (Post 6395576)
On that 'system settings' you did do the 'plugged in' tab, not just the battery tab... Just checking.

Yes, it's not that clear in the screenshot I posted but that is "plugged in", not battery.

llewellen 12-02-2022 05:13 PM

Update: This gets curiouser and curiouser.

The system is still going into suspend after about 5 minutes of keyboard inactivity, regardless of all the things mentioned above that I have tried to prevent that. However, it now restores instantly with any keystroke. Previously I could not find any way to make it restore and had to do a hard shutdown and then boot.

What changed? Possibly this: this laptop had a broken key and I took it into the local repair shop yesterday to have a new keyboard installed. They told me that that they had to remove the motherboard to do that (???) and when they put the unit back together, it wouldn't boot. It would boot from a USB stick but not otherwise. After some messing around in BIOS, which they didn't describe very clearly, they were able to get it booting again and it has been doing so and rebooting just fine with no difficulties.

I noticed this change: before the keyboard repair, on the Boot Sequence window in BIOS, there was a checkbox marked "Debian" which was toggled on. I assumed that referred to Debian because CBPP is a stripped down variant of Debian. Since the repair shop messed around in BIOS that checkbox is marked "GRUB" and is also toggled on. Relevant or not? I don't know.

Something else that is not a recent change but may be relevant and also point to a BIOS issue in the Dell laptop. I have this exact version of CBPP installed from the same USB stick on an old Asus X200CA laptop. There has never been any issue with suspend/restore on the Asus. It suspends as it always did before CBPP was installed and restores immediately with any keystroke.

Any clues?


All times are GMT -5. The time now is 06:03 PM.