Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Gnome 3 command used to hibernate

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
rond14
Posts: 6
Joined: 2017-10-29 07:07

Gnome 3 command used to hibernate

#1 Post by rond14 »

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.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Gnome 3 command used to hibernate

#2 Post by Head_on_a_Stick »

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

rond14
Posts: 6
Joined: 2017-10-29 07:07

Re: Gnome 3 command used to hibernate

#3 Post by rond14 »

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:

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Gnome 3 command used to hibernate

#4 Post by Head_on_a_Stick »

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

rond14
Posts: 6
Joined: 2017-10-29 07:07

Re: Gnome 3 command used to hibernate

#5 Post by rond14 »

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)

User avatar
RU55EL
Posts: 546
Joined: 2014-04-07 03:42
Location: /home/russel

Re: Gnome 3 command used to hibernate

#6 Post by RU55EL »

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

rond14
Posts: 6
Joined: 2017-10-29 07:07

Re: Gnome 3 command used to hibernate

#7 Post by rond14 »

Yes, I tried that, when I use the Hibernate option there, doesn't resume.

User avatar
RU55EL
Posts: 546
Joined: 2014-04-07 03:42
Location: /home/russel

Re: Gnome 3 command used to hibernate

#8 Post by RU55EL »

Just shooting in the dark here...

What size is your swap partition and RAM?

rond14
Posts: 6
Joined: 2017-10-29 07:07

Re: Gnome 3 command used to hibernate

#9 Post by rond14 »

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.

mln_falcon
Posts: 2
Joined: 2008-01-27 01:10

Re: Gnome 3 command used to hibernate

#10 Post by mln_falcon »

Hi,

I had exactly the same problem. pm-hibernate works but the Gnome hibernate function doesn't.

There is a visual difference between the two. When using the pm-hibernate from the command line, the screen briefly flicks off and then back on again before "freezing" and becoming unresponsive while the computer goes to sleep. The Gnome command on the other hand blanks the the screen immediately and remains off until the computer is finished powering down. But when it turns back on, the screen never comes back. I know it's turned back on and back at the desktop environment because the volume level can be heard if I adjust it with the keyboard keys. I normally can't access the tty's either (Although once I could but then gdm and gnome remained inactive and could not be restarted. Don't know how to replicate that behaviour)

After hours of searching the interned I found a solution. I was able to fix it by Setting Gnome to ignore the power button and adding the following to the beginning of my /etc/acpi/powerbutton-acpi-support.sh

Code: Select all


#! /bin/bash

/usr/sbin/pm-hibernate
exit 0

Probably not a great solution if anyone knows a better one please let me know.

Happy to file a bug report if someone can tell me what logs, etc. to include

rond14
Posts: 6
Joined: 2017-10-29 07:07

Re: Gnome 3 command used to hibernate

#11 Post by rond14 »

Hi, you have described exactly what happens to me :D

I think it deserves a bug report, although your description is detailed I'm not really sure if it's enough for the maintainers. Anyway, in my case I deactivated the power button and create a shortcut to call the hibernate command (Alt + Something) by going to Parameters > Peripherals > Keyboard.

Thank you for your response :)
mln_falcon wrote:Hi,

I had exactly the same problem. pm-hibernate works but the Gnome hibernate function doesn't.

There is a visual difference between the two. When using the pm-hibernate from the command line, the screen briefly flicks off and then back on again before "freezing" and becoming unresponsive while the computer goes to sleep. The Gnome command on the other hand blanks the the screen immediately and remains off until the computer is finished powering down. But when it turns back on, the screen never comes back. I know it's turned back on and back at the desktop environment because the volume level can be heard if I adjust it with the keyboard keys. I normally can't access the tty's either (Although once I could but then gdm and gnome remained inactive and could not be restarted. Don't know how to replicate that behaviour)

After hours of searching the interned I found a solution. I was able to fix it by Setting Gnome to ignore the power button and adding the following to the beginning of my /etc/acpi/powerbutton-acpi-support.sh

Code: Select all


#! /bin/bash

/usr/sbin/pm-hibernate
exit 0

Probably not a great solution if anyone knows a better one please let me know.

Happy to file a bug report if someone can tell me what logs, etc. to include

Post Reply