Gnome 3 command used to hibernate

Everything about X, Gnome, KDE, ... and everything running on it

Gnome 3 command used to hibernate

Postby rond14 » 2017-10-29 07:09

Hello,

I'm using Gnome 3 on Debian Testing in my laptop and I have a problem with hibernation, if in terminal I use one of the following commands:

systemctl hibernate
pm-hibernate

The system hibernates and resumes with no problem, however when I use the power button while having this configuration:

org.gnome.settings-daemon.plugins.power.power-button-action='hibernate'

The system hibernates but the resume freezes. Therefore, I was wondering what it's the command that Gnome uses when 'hibernate' is set and if I could change this to use one of the others that work.
rond14
 
Posts: 5
Joined: 2017-10-29 07:07

Re: Gnome 3 command used to hibernate

Postby Head_on_a_Stick » 2017-10-29 07:20

rond14 wrote:I was wondering what it's the command that Gnome uses when 'hibernate' is set and if I could change this to use one of the others that work.

Good question :)

I don't know the answer but you could check the systemd journal to see if that records the method employed:
Code: Select all
# journalctl -xe

I'm in GNOME (3.26.1) atm and I can see that it controls the power button stuff:
Code: Select all
empty@Xanadu:~ $ systemd-inhibit
     Who: gdm (UID 120/gdm, PID 483/gsd-media-keys)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key
     Why: GNOME handling keypresses
    Mode: block

     Who: empty (UID 1000/empty, PID 750/gsd-power)
    What: sleep
     Why: GNOME needs to lock the screen
    Mode: delay

     Who: empty (UID 1000/empty, PID 747/gsd-media-keys)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key
     Why: GNOME handling keypresses
    Mode: block

     Who: UPower (UID 0/root, PID 404/upowerd)
    What: sleep
     Why: Pause device polling
    Mode: delay

     Who: Telepathy (UID 1000/empty, PID 710/mission-control)
    What: shutdown:sleep
     Why: Disconnecting IM accounts before suspend/shutdown...
    Mode: delay

     Who: gdm (UID 120/gdm, PID 487/gsd-power)
    What: sleep
     Why: GNOME needs to lock the screen
    Mode: delay

6 inhibitors listed.
empty@Xanadu:~ $

Have you tried disabling GNOME's handling of the power button and letting systemd take over instead?

If `systemctl suspend` works then perhaps that will do the trick.
"Only the mediocre are always at their best." — Jean Giraudoux
User avatar
Head_on_a_Stick
 
Posts: 6673
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Gnome 3 command used to hibernate

Postby rond14 » 2017-10-29 11:47

Thank you for your answer, I used journalctl -xe command but has not related information, probably because once I hibernate the laptop by using the power button the resume doesn't work (stays in black screen) and I have to make a hard reset.

Also, I tried disabling the power button handling (and configure systemd as the handler) however systemd-inhibit still shows GNOME as the handler, that's the reason I thought about changing the command used by GNOME :mrgreen:
rond14
 
Posts: 5
Joined: 2017-10-29 07:07

Re: Gnome 3 command used to hibernate

Postby Head_on_a_Stick » 2017-10-29 12:30

rond14 wrote:I used journalctl -xe command but has not related information, probably because once I hibernate the laptop by using the power button the resume doesn't work (stays in black screen) and I have to make a hard reset.

Good point.

You can enable persistent storage for the journal so that it "remembers" what happened before you have to reset it; do this either by editing /etc/systemd/journald.conf and changing the "Storage=" line to "persistent" or alternatively leave that file alone and create the necessary folder manually with:
Code: Select all
# mkdir -p /var/log/journal

Simply deleting that folder will reset the journal to non-persistent operation ;)

I tried disabling the power button handling (and configure systemd as the handler)

Please show us exactly how you tried to do this, perhaps you have made a mistake somewhere.

I must admit though that I do not actually know how to do that :D

Have you considered switching to a less "helpful" desktop environment?

For example, openbox doesn't manage these sort of things unless you force it to.
"Only the mediocre are always at their best." — Jean Giraudoux
User avatar
Head_on_a_Stick
 
Posts: 6673
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Gnome 3 command used to hibernate

Postby rond14 » 2017-10-31 14:55

I configured my journal to be persistent but there's no evidence of any command that GNOME uses.

On the other hand, what I do with systemd is the following:

1. Disable GNOME power button handling by setting to Action=Nothing in the Energy section of Gnome Tweak Tool.
2. Edit /etc/systemd/logind.conf to have this:

Code: Select all
HandlePowerKey=hibernate
PowerKeyIgnoreInhibited=yes

But, doesn't work and I think it's because in the logind.conf manual you can find this:

Code: Select all
PowerKeyIgnoreInhibited=, SuspendKeyIgnoreInhibited=, HibernateKeyIgnoreInhibited=, LidSwitchIgnoreInhibited=

Controls whether actions that systemd-logind takes when the power and sleep keys and the lid switch are triggered are subject to high-level inhibitor locks ("shutdown", "sleep", "idle"). Low level inhibitor locks ("handle-power-key", "handle-suspend-key", "handle-hibernate-key", "handle-lid-switch"), are always honored, irrespective of this setting.

So, GNOME still has the control. Right now my walkaround for this is to do nothing when power button is pressed and configure a combination of keys to trigger the hibernation. Anyway, It would be nice to know about this GNOME power button handling, and yes probably changing to other DE will make things easier 8)
rond14
 
Posts: 5
Joined: 2017-10-29 07:07

Re: Gnome 3 command used to hibernate

Postby RU55EL » 2017-10-31 16:19

Have you tried opening Tweak Tool in Gnome and changing the settings under power?

When power button is pressed action setting

and

When laptop lid is closed setting
User avatar
RU55EL
 
Posts: 313
Joined: 2014-04-07 03:42
Location: /home/russel

Re: Gnome 3 command used to hibernate

Postby rond14 » 2017-10-31 18:06

Yes, I tried that, when I use the Hibernate option there, doesn't resume.
rond14
 
Posts: 5
Joined: 2017-10-29 07:07

Re: Gnome 3 command used to hibernate

Postby RU55EL » 2017-10-31 18:30

Just shooting in the dark here...

What size is your swap partition and RAM?
User avatar
RU55EL
 
Posts: 313
Joined: 2014-04-07 03:42
Location: /home/russel

Re: Gnome 3 command used to hibernate

Postby rond14 » 2017-10-31 19:22

Swap: 8.5 GB
RAM: 5.7 GB

As far as I saw there is a problem with the video (Intel integrated) when resuming the laptop, but this only happens when GNOME is in charge of the hibernation, if I hibernate using command lines it's ok.
rond14
 
Posts: 5
Joined: 2017-10-29 07:07


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable