You are not logged in.

#1 2018-09-12 09:42:20

esrevinu
Member
Registered: 2013-12-12
Posts: 20

On gnome 3.30, power button acts as suspend-then-hibernate

Power-button-action is set to 'suspend', but when power button is pressed, the system goes into suspend mode and later turns off if not used for a period of time(default: 3 hours).
In other words, power button on Gnome 3.30 calls systemd-suspend-then-hibernate.service instead of systemd-suspend.service.
On KDE, this is not happening.

 9월 12 18:12:02 lettuce org.gnome.Shell.desktop[7161]: Window manager warning: Overwriting existing binding of keysym ff09 with keysym ff09 (keycode 17).
 9월 12 18:12:07 lettuce systemd-logind[1028]: Delay lock is active (UID 1000/esrevinu, PID 7216/mission-control) but inhibitor timeout is reached.
 9월 12 18:12:07 lettuce systemd[1]: Starting TLP suspend/resume...
 9월 12 18:12:07 lettuce systemd[1]: Started TLP suspend/resume.
 9월 12 18:12:07 lettuce audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=tlp-sleep comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
 9월 12 18:12:07 lettuce kernel: audit: type=1130 audit(1536743527.712:160): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=tlp-sleep comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
 9월 12 18:12:07 lettuce systemd[1]: Reached target Sleep.
 9월 12 18:12:07 lettuce systemd[1]: Starting Suspend; Hibernate if not used for a period of time...
 9월 12 18:12:07 lettuce systemd-sleep[10346]: Suspending system...
 9월 12 18:12:07 lettuce kernel: PM: suspend entry (deep)
 9월 12 18:12:25 lettuce kernel: PM: Syncing filesystems ... done.
 9월 12 18:12:25 lettuce kernel: Freezing user space processes ... (elapsed 0.003 seconds) done.
 9월 12 18:12:25 lettuce kernel: OOM killer disabled.
 9월 12 18:12:25 lettuce kernel: Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
 9월 12 18:12:25 lettuce kernel: Suspending console(s) (use no_console_suspend to debug)

Offline

#2 2018-09-18 11:05:08

jwang
Member
Registered: 2012-11-13
Posts: 1

Re: On gnome 3.30, power button acts as suspend-then-hibernate

Same behavior here. Searching around, I found this change titled "power: Add Suspend then Hibernate":
https://gitlab.gnome.org/GNOME/gnome-se … e8e6af61eb

It looks like the behavior is unconditional, i.e. it'll always hibernate if possible.

Also found this bug report: "cannot be configured to not hibernate if hardware supports it"
https://gitlab.gnome.org/GNOME/gnome-se … /issues/78

And this thread complaining about Fedora:
https://lwn.net/Articles/764996/

Simplest workaround is probably setting HibernateDelaySec as mentioned in the gitlab issue.

(This thread was the top hit for my Google keywords, so hopefully this link dump helps someone.)

Offline

#3 2018-09-20 03:05:39

mwillems
Member
Registered: 2014-08-09
Posts: 89

Re: On gnome 3.30, power button acts as suspend-then-hibernate

Yeah this is a definite bummer even for people (like me) who want delayed hibernation, because the new systemd delayed hibernation service is quirky and not so well documented (i.e. it doesn't seem to work correctly with certain configurations, like full disk encryption or swap files, and there seems to be no documented configuration for it other than the option for how long it waits to hibernate).  It's also an odd design choice as logind.conf still controls what happens with the lid switch and physical buttons, and they both default to suspend, so you get one behavior with an idle out and a different one with the lid switch.

The easiest workaround if you never want suspend-then-hibernate behavior is to just mask the systemd suspend-then-hibernate.target altogether by symlinking it to the suspend.target (put the symlink in /etc/systemd/system/).   That way you're guaranteed to get predictable behavior no matter what winds up calling suspend-then-hibernate.

Offline

#4 2018-09-20 05:36:42

mishoo
Member
Registered: 2017-01-23
Posts: 3
Website

Re: On gnome 3.30, power button acts as suspend-then-hibernate

Is there some way to disable it?  I'm not sure hibernation ever worked for me (long time since I last tried), my laptop just cold-booted today and that wasn't nice.

Offline

#5 2018-09-22 02:53:50

joffaMac
Member
Registered: 2016-10-11
Posts: 2

Re: On gnome 3.30, power button acts as suspend-then-hibernate

Thanks to those above for their advice - I certainly don't like having to re-boot each time when I only wanted my system to suspend.  I'm a noob user so just have a question re the advice:
"Simplest workaround is probably setting HibernateDelaySec as mentioned in the gitlab issue."

My system didn't have the file /etc/systemd/sleep.conf

So do I just create that file and then add:
[Sleep]
HibernateDelaySec=14400000

Thanks in advance

Offline

#6 2018-09-24 18:01:19

jancici
Member
From: svk
Registered: 2011-12-04
Posts: 190

Re: On gnome 3.30, power button acts as suspend-then-hibernate

I find this helpfull. BUT I have another problem:
I suspending laptop at evening and at morning it is power off, I need to power on and I can see some "errors" during boot, I think not properly unmount root partition.

I find out in journal that lapto is wake up adn trying do hibernation.

so I did add /etc/systemd/sleep.conf but with 432000 s what is 5 days.
there was error with that big number ...

Offline

#7 2018-09-27 08:44:02

bastiendurel
Member
Registered: 2018-09-27
Posts: 9

Re: On gnome 3.30, power button acts as suspend-then-hibernate

"infinity" should work to never hibernate in SuspendThenHibernate mode ; but there is another way :

As you can see, action_suspend() call dbus to get CanSuspendThenHibernate value, and use SuspendThenHibernate action only if this is "yes" ; you may configure systemd to report it as "no" via

sudo systemctl mask suspend-then-hibernate.target
bastien@data-bastien:~$ qdbus --system org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.CanSuspendThenHibernate
yes
bastien@data-bastien:~$ sudo systemctl mask suspend-then-hibernate.target
Created symlink /etc/systemd/system/suspend-then-hibernate.target → /dev/null.
bastien@data-bastien:~$ qdbus --system org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.CanSuspendThenHibernate
no

Last edited by bastiendurel (2018-09-27 08:45:52)

Offline

#8 2018-09-30 10:09:57

binaryanomaly
Member
Registered: 2011-06-19
Posts: 16

Re: On gnome 3.30, power button acts as suspend-then-hibernate

This "feature" was crashing my machine repeatedly before I finally found this thread. Wouldn't this justify that a warning should be issued to users?

I have for now disabled swap to not run into this issue again. But would have preferred to know before because in the worst case this behavior can cause data corruption / loss on the machine - a serious issue.

Offline

#9 2018-09-30 12:13:15

bastiendurel
Member
Registered: 2018-09-27
Posts: 9

Re: On gnome 3.30, power button acts as suspend-then-hibernate

Thez assumed hibernate resume will work if it is possible, which is wrong hmm

Offline

#10 2018-10-01 19:09:28

Veske
Member
Registered: 2015-01-13
Posts: 12

Re: On gnome 3.30, power button acts as suspend-then-hibernate

binaryanomaly wrote:

This "feature" was crashing my machine repeatedly before I finally found this thread. Wouldn't this justify that a warning should be issued to users?

I have for now disabled swap to not run into this issue again. But would have preferred to know before because in the worst case this behavior can cause data corruption / loss on the machine - a serious issue.

I had my boot partition get destroyed because of this shit. Not something you want to wake up to in the morning... How can such thing pass into mainline is beyond me.

Offline

#11 2018-10-02 07:43:04

5ulo
Member
From: Slovakia
Registered: 2012-05-04
Posts: 100

Re: On gnome 3.30, power button acts as suspend-then-hibernate

why?.. just WHY? I left my book in sleep mode at the night and morning was turned off. First time I thought I was crazy and turned it off.. but if that happened three times in a row I started to explore and came here..
Why is the book powering off if it's not capable to hybernate??? It's not good for computer, nor for me.. I have to run every f^&@(#ing app each boot (chrome, thunderbird, vscode, rambox etc....)

HibernateDelaySec=14400000

Tried and it didn't helped me out of this situation

Offline

#12 2018-10-02 07:49:12

binaryanomaly
Member
Registered: 2011-06-19
Posts: 16

Re: On gnome 3.30, power button acts as suspend-then-hibernate

5ulo wrote:

why?.. just WHY? I left my book in sleep mode at the night and morning was turned off. First time I thought I was crazy and turned it off.. but if that happened three times in a row I started to explore and came here..
Why is the book powering off if it's not capable to hybernate??? It's not good for computer, nor for me.. I have to run every f^&@(#ing app each boot (chrome, thunderbird, vscode, rambox etc....)

HibernateDelaySec=14400000

Tried and it didn't helped me out of this situation

Yep it's super annoying, plus dangerous.

Comment out swap in

/etc/fstab

and disable it with

swapoff /dev/yourpartition

This worked here.

Offline

#13 2018-10-02 07:57:29

bastiendurel
Member
Registered: 2018-09-27
Posts: 9

Re: On gnome 3.30, power button acts as suspend-then-hibernate

hibernation is basically "save state on swap then power off" ; so it looks like it powers off. The the boot process must be hibernate-aware to recover, otherwise it performs a cold boot with non-properly unmounted partitions.

Disabling swap may work, but disabling hibernation should have less side-effects (systemctl mask hibernate.target)
Disabling suspend-then-hibernate even less, as it prevents automatic hibernation while the computer is suspended (systemctl mask suspend-then-hibernate.target)

Offline

#14 2018-10-02 08:01:44

5ulo
Member
From: Slovakia
Registered: 2012-05-04
Posts: 100

Re: On gnome 3.30, power button acts as suspend-then-hibernate

Swap method is not acceptable method for me (although I have 16Gigs of RAM).. so thanks @bastiendurel.. I try the mask suspend-then-hibernate method.. Hope tomorrow will be no problem at all.

Offline

#15 2018-10-02 08:08:25

binaryanomaly
Member
Registered: 2011-06-19
Posts: 16

Re: On gnome 3.30, power button acts as suspend-then-hibernate

bastiendurel wrote:

Disabling swap may work, but disabling hibernation should have less side-effects (systemctl mask hibernate.target)
Disabling suspend-then-hibernate even less, as it prevents automatic hibernation while the computer is suspended (systemctl mask suspend-then-hibernate.target)

This is more elegant, agree.

One might ask though why this is not the default state. As far as I understand hibernate is never working out of the box with archlinux.

Offline

#16 2018-10-02 08:11:21

bastiendurel
Member
Registered: 2018-09-27
Posts: 9

Re: On gnome 3.30, power button acts as suspend-then-hibernate

One might try to report a bug against systemd wink

Offline

Board footer

Powered by FluxBB