You are not logged in.

#1 2020-06-30 23:22:18

jerryDaBaaws
Member
Registered: 2020-06-08
Posts: 115

Suspend while hibernating

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.target

What 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

#2 2020-07-01 01:51:42

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: Suspend while hibernating

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 lid

If 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)


My reposSome snippets

Heisenberg might have been here.

Offline

#3 2020-07-01 03:54:41

liewkj
Member
Registered: 2019-07-08
Posts: 210

Re: Suspend while hibernating

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

#4 2020-07-02 02:46:30

jerryDaBaaws
Member
Registered: 2020-06-08
Posts: 115

Re: Suspend while hibernating

@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

#5 2020-07-02 05:38:46

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: Suspend while hibernating

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.


My reposSome snippets

Heisenberg might have been here.

Offline

Board footer

Powered by FluxBB