You are not logged in.
Pages: 1
This is a weird problem I'm facing with hibernate.
If I close my laptop lid after running hibernate command, it is suspending itself while in middle of hibernating.
Later on If I open the laptop lid it resumes and goes back to hibernating process again.
Here is my locker service
[Unit]
Description = Lock screen when going to sleep/suspend
Before=sleep.target
Before=suspend.target
[Service]
User=%I
Type=simple
Environment=DISPLAY=:0
ExecStart=/usr/bin/betterlockscreen --lock
TimeoutSec=infinity
ExecStartPost=/usr/bin/sleep 1
[Install]
WantedBy=sleep.target
WantedBy=suspend.targetWhat I'm supposed to do to make systemd ignore lid action change while in process of hibernating/powering off ?
PS: Both Hibernate and suspend works fine independently
Last edited by jerryDaBaaws (2020-06-30 23:24:14)
Offline
This behavior can be changed in /etc/systemd/logind.conf
#HandleLidSwitch=suspend #if you change this to hibernate it will hibernate when you close the laptop lidIf you prefer to use a drop-in for this, place a file with the change inside /etc/systemd/logind.conf.d/ with extension .conf
That of course if you prefer to close the lid instead of running hibernate manually...
If instead you prefer to do things by hand then use ignore.
More info can be found on: man 5 logind.conf
Last edited by GaKu999 (2020-07-01 01:53:32)
Offline
This can happen on Windows as well. You should not need to explicitly running hibernate command. You should simply close the lid and elect `suspend-then-hibernate` or Windows-like `HybridSleep` power policy. Personally, I chose `suspend-then-hibernate` and it worked well on several laptop/notebook models.
Offline
@GaKu999 I dont want to disable the lid function. All I want is that once I run 'systemctl hibernate', closing the lid ( auto suspend ) should not interfere with hibernation.
I don't want to disable suspend on closing lid.
It is just a minor inconvenience but it should not work like this.
Offline
I believe that if you use ‘LidSwitchIgnoreInhibited=no’ on ‘/etc/systemd/logind.conf’ you may achieve your desired behavior according to the manpage, since it defaults to yes that explains why you feel that issue.
Still that is untested by me, feel free to report if that works.
Offline
Pages: 1