Machine shuts down instead of suspend on hardware button

If none of the more specific forums is the right place to ask

Machine shuts down instead of suspend on hardware button

Postby andoru » 2021-01-13 13:05

I've set the power button to suspend to RAM in xfce4-power-manager, but for some reason, sometimes when I press that button, it shuts down instead.
This has started happening after a recent upgrade done a week ago.
Could anyone point me in the right direction to fix this?
andoru
 
Posts: 267
Joined: 2014-03-14 16:59

Re: Machine shuts down instead of suspend on hardware button

Postby Head_on_a_Stick » 2021-01-13 19:43

andoru wrote:This has started happening after a recent upgrade done a week ago.

So you're running sid then? I am aware that I've probably asked you before but I interact with literally hundreds of posters and my memory isn't that good & I don't have the energy or inclination to trawl through your post history.

Have you checked /etc/systemd/logind.conf? The HandlePowerKey= & PowerKeyIgnoreInhibited= options may be relevant. Read the man page for details.

See also
Code: Select all
systemd-inhibit
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13280
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Machine shuts down instead of suspend on hardware button

Postby andoru » 2021-01-13 20:36

Yes, I'm on sid, sorry for not mentioning that from the get-go.
And you're quite right, HandlePowerKey was set to shutdown. Changed it to HandlePowerKey=suspend, and will report back if this fixed the issue. Thanks!
Also, #PowerKeyIgnoreInhibited=no, shouldn't that be a 'yes'?
Also, speaking of xfce4-power-manager, I've set it to suspend the PC after some period of inactivity (under System -> Sleep mode), but it seems that setting is also ignored. What's going on with this app? It seems useless as it makes no changes.
andoru
 
Posts: 267
Joined: 2014-03-14 16:59

Re: Machine shuts down instead of suspend on hardware button

Postby Head_on_a_Stick » 2021-01-14 11:45

Did you check the systemd-inhibit output? That will show if the logind.conf settings will actually have any effect.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13280
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Machine shuts down instead of suspend on hardware button

Postby andoru » 2021-01-14 15:16

Getting this output:

Code: Select all
$ $ systemd-inhibit
WHO                 UID  USER   PID  COMM            WHAT                      >
ModemManager        0    root   703  ModemManager    sleep                     >
NetworkManager      0    root   583  NetworkManager  sleep                     >
UPower              0    root   1656 upowerd         sleep                     >
Screen Locker       1000 andoru 1587 light-locker    sleep                     >
xfce4-power-manager 1000 andoru 1624 xfce4-power-man handle-power-key:handle-su>

5 inhibitors listed.


Not sure if this is how it's supposed to be like.
andoru
 
Posts: 267
Joined: 2014-03-14 16:59

Re: Machine shuts down instead of suspend on hardware button

Postby Head_on_a_Stick » 2021-01-14 15:31

The output is piped to a pager so either use the arrow keys to see the rest of it or pass the --no-pager (--no-p for short) switch.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13280
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Machine shuts down instead of suspend on hardware button

Postby andoru » 2021-01-15 13:28

Code: Select all
WHO                 UID  USER   PID  COMM            WHAT                                                                       WHY                                       MODE
ModemManager        0    root   703  ModemManager    sleep                                                                      ModemManager needs to reset devices       delay
NetworkManager      0    root   583  NetworkManager  sleep                                                                      NetworkManager needs to turn off networks delay
UPower              0    root   1656 upowerd         sleep                                                                      Pause device polling                      delay
Screen Locker       1000 andoru 1587 light-locker    sleep                                                                      Lock the screen on suspend/resume         delay
xfce4-power-manager 1000 andoru 1624 xfce4-power-man handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch xfce4-power-manager handles these events  block

5 inhibitors listed.
andoru
 
Posts: 267
Joined: 2014-03-14 16:59

Re: Machine shuts down instead of suspend on hardware button

Postby andoru » 2021-01-16 12:47

After testing some more, found out that this happens only on the login screen, but not when I'm logged in. I'm using lightdm/lightlocker/lightdm-gtk-greeter and I can't for the life of me figure out how to configure it not to do so. I've tried looking at the conf files (/etc/lightdm) but I can't seem to find any relevant setting for this so I'm guessing it might be a bug, as it did not do this previously.
andoru
 
Posts: 267
Joined: 2014-03-14 16:59

Re: Machine shuts down instead of suspend on hardware button

Postby Head_on_a_Stick » 2021-01-16 18:41

The output shows that xfce4-power-manager is controlling the hardware buttons so changing logind.conf will have no effect.

andoru wrote:this happens only on the login screen

The xfce4-power-manager settings applied by your user would not be used for the login screen so that is to be expected. Perhaps logind.conf will have an affect there, have you tried changing it?

andoru wrote:it did not do this previously.

Xfce has just transitioned to the 4.16 version so you may have to adapt to the new configuration techniques.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13280
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Machine shuts down instead of suspend on hardware button

Postby andoru » 2021-01-16 18:59

Yes, I did change logind.conf, but so far it still does the same thing.
andoru
 
Posts: 267
Joined: 2014-03-14 16:59


Return to General Questions

Who is online

Users browsing this forum: Jimmyfd and 12 guests

fashionable