hibernating when lid closes
Hi, I have installed Leap 15.4 on a laptop with KDE-desktop. Unfortunately PowerDevil blocks the "handle-lid-switch", so the "HandleLidSwitch=hibernate" in /etc/systemd/logind.conf does not work. How could I get hibernation on the lid close event please? Is it possible somewhere, to configure PowerDevil to not block the event? TIA for any hints, -- Peter
On Fri, May 26, 2023 at 11:42 AM Peter Münster <pm@a16n.net> wrote:
Unfortunately PowerDevil blocks the "handle-lid-switch", so the "HandleLidSwitch=hibernate" in /etc/systemd/logind.conf does not work.
waht do you mean exactly, 15.4 with laptop here as well. lid seems to work here. although i am not satisfied at all with the battery efficiency or sleep in gerneral. I dont like hibernate due to huge loads of ram amount, dont want to write that to the disk all the time or so id figure. but this powerdevil and whatnot, those logind.conf file, all seems vanilla at my system, which started from scratch with 15.4 all the compiletime default values. all only comments in that file giving defaults. journalctl -b shows lid events. right now opened the lid. a while ago closed the lid. these two events i see when grep-ing the journalctl
How could I get hibernation on the lid close event please? Is it possible somewhere, to configure PowerDevil to not block the event?
maybe adjust those commented (default) values in that logind.conf file to begin with? does lid close and lid open work with sleep or suspend or whats this not-hibernating stuff is named?
On Fri, May 26 2023, cagsm wrote:
waht do you mean exactly,
Suspend to disk.
maybe adjust those commented (default) values in that logind.conf file to begin with?
Yes, already tried.
does lid close and lid open work with sleep or suspend or whats this not-hibernating stuff is named?
Yes, suspend to ram works. -- Peter
On Fri, May 26 2023, Larry Len Rainey wrote:
Is swap file big enough to suspend to disk.
Yes. "systemctl hibernate" works well. The issue is PowerDevil. Output of "systemd-inhibit --list": --8<---------------cut here---------------start------------->8--- WHO UID USER PID COMM WHAT WHY MODE ModemManager 0 root 1000 ModemManager sleep ModemManager needs to reset devices delay NetworkManager 0 root 1129 NetworkManager sleep NetworkManager needs to turn off networks delay PowerDevil 1000 peter 3283 org_kde_powerde [...]:handle-lid-switch KDE handles power events block 3 inhibitors listed. --8<---------------cut here---------------end--------------->8--- -- Peter
Am Freitag, 26. Mai 2023, 17:41:09 CEST schrieb Peter Münster:
On Fri, May 26 2023, cagsm wrote:
waht do you mean exactly,
Suspend to disk.
It would be interesting to see what the issue is: open a terminal, log in as root, and run journalctl -j open a second terminal window and issue systemctl hibernate check the journal for error messages afterwards Cheers Axel
On 2023-05-26 18:32, Axel Braun wrote:
Am Freitag, 26. Mai 2023, 17:41:09 CEST schrieb Peter Münster:
On Fri, May 26 2023, cagsm wrote:
waht do you mean exactly,
Suspend to disk.
It would be interesting to see what the issue is: open a terminal, log in as root, and run journalctl -j open a second terminal window and issue systemctl hibernate check the journal for error messages afterwards
You are not understanding the issue. It appears that the machine can hibernate and suspend by command correctly. The problem is that something called PowerDevil intercepts the close lid event, so that the machine doesn't even attempt to hibernate or suspend when the lid is closed. -- Cheers / Saludos, Carlos E. R. (from Elesar, using openSUSE Leap 15.4)
On Freitag, 26. Mai 2023 19:11:50 CEST Carlos E. R. wrote:
On 2023-05-26 18:32, Axel Braun wrote:
Am Freitag, 26. Mai 2023, 17:41:09 CEST schrieb Peter Münster:
On Fri, May 26 2023, cagsm wrote:
waht do you mean exactly,
Suspend to disk.
It would be interesting to see what the issue is: open a terminal, log in as root, and run journalctl -j open a second terminal window and issue systemctl hibernate check the journal for error messages afterwards
You are not understanding the issue.
It appears that the machine can hibernate and suspend by command correctly.
The problem is that something called PowerDevil intercepts the close lid event, so that the machine doesn't even attempt to hibernate or suspend when the lid is closed.
PowerDevil is the daemon, that should intercept this event. It is responsible for handling keypress events and lidclose events. All the configuration options in Systemsettings / Power Management are addressing PowerDevil - AFAIK.
-- Cheers / Saludos,
Carlos E. R.
Bye. Michael.
On Fri, May 26 2023, Peter Münster wrote:
Is it possible somewhere, to configure PowerDevil to not block the event?
Ok, I did not find any possibility... This is my workaround: 1.) Tell PowerDevil to hibernate, when lid closes: - create new file /etc/xdg/powermanagementprofilesrc - edit sections AC, Battery and LowBattery: "lidAction=2" 2.) Tell polkit, to allow the hibernation, even with open user sessions: - add a line to /etc/polkit-default-privs.local: "org.freedesktop.login1.hibernate-multiple-sessions yes" - execute "set_polkit_default_privs" Cheers, -- Peter
On 2023-05-30 13:21, Peter Münster wrote:
On Fri, May 26 2023, Peter Münster wrote:
Is it possible somewhere, to configure PowerDevil to not block the event?
Ok, I did not find any possibility...
This is my workaround:
1.) Tell PowerDevil to hibernate, when lid closes: - create new file /etc/xdg/powermanagementprofilesrc - edit sections AC, Battery and LowBattery: "lidAction=2"
On low battery, you might prefer hybrid sleep (whatever number it is).
2.) Tell polkit, to allow the hibernation, even with open user sessions: - add a line to /etc/polkit-default-privs.local: "org.freedesktop.login1.hibernate-multiple-sessions yes" - execute "set_polkit_default_privs"
Cheers,
-- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
On Tue, May 30 2023, Carlos E. R. wrote:
On low battery, you might prefer hybrid sleep
In general, hybrid sleep is the best choice in all sections: - no data loss, when battery discharges - fast resume, when battery is not discharged But for my use case, hibernating is always the best choice, because the laptop is rarely used and I don't want any battery discharging between 2 utilizations. Slow resuming is no problem for me. -- Peter
participants (6)
-
Axel Braun
-
cagsm
-
Carlos E. R.
-
Larry Len Rainey
-
mh@mike.franken.de
-
Peter Münster