Xfce Forum

Sub domains
 

You are not logged in.

#1 2020-11-17 13:22:48

funkymaster
Member
Registered: 2020-11-17
Posts: 6

Housing power button shutdown at login does not work

Hello,

I just registered because I have a little problem here.
It is not possible to switch off the device with the hardware button on the login screen.

The following situation is given:
- Debian 10 Buster as a file server
- The system runs normally headless without a monitor or input devices
- xfce 4.12.5 + tigervnc to be able to use a desktop
- slick-greeter, because in rare cases the monitor and keyboard are used directly.
- apcupsd as a safeguard

The following behavior occurs when the power button is pressed:
- when a user is logged in, exactly what is set in the user's energy settings happens. So, asking, shutdown, etc.
- not logged in with lightdm-gtk-greeter: nothing happens
- not logged in with slick-greeter: a pop-up dialog window with the options "standby, hibernation, restart, shutdown" appears

I was only able to solve the problem by adding the following property.

xfconf-query -c xfce4-power-manager -p / xfce4-power-manager / logind-handle-power-key -n -t bool -s true

What puzzles me is that this is set in the file

/root/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml

The complete file looks like this:

<? xml version = "1.0" encoding = "UTF-8"?>

<channel name = "xfce4-power-manager" version = "1.0">
  <property name = "xfce4-power-manager" type = "empty">
    <property name = "power-button-action" type = "uint" value = "4" />
    <property name = "brightness-switch-restore-on-exit" type = "int" value = "- 1" />
    <property name = "brightness-switch" type = "int" value = "0" />
    <property name = "logind-handle-power-key" type = "bool" value = "true" />
  </property>
</channel>

The funny thing is that

power button action

property changes only affect a logged-in session.

The

logind-handle-power-key

property also takes effect before the login.

This is nice for my desired behavior, but still not entirely understandable, because that would mean that depending on the property, a distinction is made as to when, where and how it is evaluated.

The question is: Where can the power button behaviour at the login screen set up?
Because the user (root) settings don't work there. Only the bypass settings of root seem to be considered.

Thank you in advance!
Best regards!

Offline

#2 2020-11-17 19:51:58

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Housing power button shutdown at login does not work

Hello and welcome to the forums.

funkymaster wrote:

What puzzles me is that this is set in the file

/root/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml

This is puzzling. Are you logging in as root? Is xfce4-power-manager being run as root?


The question is: Where can the power button behaviour at the login screen set up?
Because the user (root) settings don't work there. Only the bypass settings of root seem to be considered.

My understanding of lightdm is that it uses its own power management routines. xfce4-power-manager is only effective during an active session.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2020-11-17 22:03:49

funkymaster
Member
Registered: 2020-11-17
Posts: 6

Re: Housing power button shutdown at login does not work

Hello and thank you for your reply.

ToZ wrote:

Hello and welcome to the forums.

funkymaster wrote:

What puzzles me is that this is set in the file

/root/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml

This is puzzling. Are you logging in as root? Is xfce4-power-manager being run as root?

Yes, via remote terminal as root. This behaviour is ok, so far.

The question is: Where can the power button behaviour at the login screen set up?
Because the user (root) settings don't work there. Only the bypass settings of root seem to be considered.

My understanding of lightdm is that it uses its own power management routines. xfce4-power-manager is only effective during an active session.

I would assume so too, but how can an xfce-power-manager setting like logind-handle-power-key affect a lightdm greeter screen when xfce-power-manger is not running at this time (before login)?

System-wide settings in

/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml

have no effect at all.

Thank you for the lightdm link, but i couldn't find any code parts causing a shutdown dialog or not and how to set up the behavior.
Instead I found some dialog handling on the slick-greeter code site.

Maybe I should ask there how to disable the shutdown dialog.
The behavior of the xfce4 power manager still remains a mystery to me.

Offline

#4 2020-11-17 23:24:01

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Housing power button shutdown at login does not work

funkymaster wrote:

I would assume so too, but how can an xfce-power-manager setting like logind-handle-power-key affect a lightdm greeter screen when xfce-power-manger is not running at this time (before login)?

I honestly don't see how it could. Perhaps something else is happening in the background and it looks like its this setting? But I don't know what it could be.

Maybe I should ask there how to disable the shutdown dialog.

lightdm-gtk-greeter has a companion lightdm-gtk-greeter-settings application that allows you the ability to add/remove login screen panel applets. For slick greeter, it looks like there is a "show-power" configuration settings that can be set in /etc/lightdm/slick-greeter.conf to disable it. See: https://github.com/linuxmint/slick-greeter. But it doesn't look like the shutdown dialog can be disabled.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2020-11-18 22:39:22

funkymaster
Member
Registered: 2020-11-17
Posts: 6

Re: Housing power button shutdown at login does not work

ToZ wrote:

lightdm-gtk-greeter has a companion lightdm-gtk-greeter-settings application that allows you the ability to add/remove login screen panel applets. For slick greeter, it looks like there is a "show-power" configuration settings that can be set in /etc/lightdm/slick-greeter.conf to disable it. See: https://github.com/linuxmint/slick-greeter. But it doesn't look like the shutdown dialog can be disabled.

Yes, thank you. I found out the same thing.


I've been able to check a few other things now.

On the headless fileserver, I have the following configuration:
- OS Debian 10 Buster stable
- xfce4/stable,now 4.12.5 all
- lightdm/stable,now 1.26.0-4 i386
- slick-greeter/stable,now 1.2.4-2 i386

Don't worry about the i386. This is old hardware to test. The behavior is identical on an amd64 machine.


The following configuration is available for comparison on a desktop PC:
- OS Debian testing
- xfce4/testing,now 4.14 all
- lightdm/testing,now 1.26.0-7 amd64
- slick-greeter/testing,now 1.4.1+dfsg.1-1 amd64


The interesting thing is that the power button on the desktop PC works as expected out of the box.


Server xfce 4.12.5 systemd-inhibit --list

WHO                          UID USER PID  COMM            WHAT                                                      WHY                                                       MODE
UPower                       0   root 1016 upowerd         sleep                                                     Pause device polling                                      delay
Unattended Upgrades Shutdown 0   root 517  unattended-upgr shutdown                                                  Stop ongoing upgrades or perform upgrades before shutdown delay
xfce4-power-manager          0   root 1066 xfce4-power-man handle-suspend-key:handle-hibernate-key:handle-lid-switch xfce4-power-manager handles these events                  block

3 inhibitors listed.

Desktop xfce 4.14 systemd-inhibit --list

WHO                          UID USER PID COMM            WHAT     WHY                                                                                          MODE
ModemManager                 0   root 584 ModemManager    sleep    ModemManager needs to reset devices                                                          delay
NetworkManager               0   root 545 NetworkManager  sleep    NetworkManager needs to turn off networks                                                    delay
UPower                       0   root 868 upowerd         sleep    Pause device polling                                                                         delay
Unattended Upgrades Shutdown 0   root 639 unattended-upgr shutdown Laufende Aktualisierungen anhalten oder Aktualisierungen vor dem Herunterfahren durchführen. delay

4 inhibitors listed.

To me it looks like xfce 4.12 is behaving incorrectly and 4.14 is behaving correctly. The behavior with 4.14 may have been changed / corrected in this point. From my point of view the issue is settled, because for the time being I can work with the logind-handle-power-key setting and, on the other hand, I expect the next Debian update to contain xfce 4.14 or higher. That would mean the matter would be off the table anyway (hopefully).


See the attached xfce-power-manager xml files for information.
I tried applying settings from one machine to the other and vice versa, but it had no effect.


Server xfce 4.12.5 /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml

<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfce4-power-manager" version="1.0">
  <property name="xfce4-power-manager" type="empty">
    <property name="power-button-action" type="uint" value="3"/>
  </property>
</channel>

Server xfce 4.12.5 /root/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml

<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfce4-power-manager" version="1.0">
  <property name="xfce4-power-manager" type="empty">
    <property name="power-button-action" type="uint" value="4"/>
    <property name="brightness-switch-restore-on-exit" type="int" value="1"/>
    <property name="brightness-switch" type="int" value="0"/>
    <property name="logind-handle-power-key" type="bool" value="true"/>
  </property>
</channel>

Server xfce 4.12.5 /home/user/...
unavailable



Desktop xfce 4.14 /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml

<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfce4-power-manager" version="1.0">
  <property name="xfce4-power-manager" type="empty">
    <property name="power-button-action" type="uint" value="3"/>
  </property>
</channel>

Desktop xfce 4.14 /root/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml

<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfce4-power-manager" version="1.0">
  <property name="xfce4-power-manager" type="empty">
    <property name="power-button-action" type="empty"/>
    <property name="show-tray-icon" type="bool" value="false"/>
  </property>
</channel>

Desktop xfce 4.14 /home/user/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml

<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfce4-power-manager" version="1.0">
  <property name="xfce4-power-manager" type="empty">
    <property name="power-button-action" type="empty"/>
    <property name="show-tray-icon" type="bool" value="false"/>
  </property>
</channel>

Thx!
Best regards!

Last edited by funkymaster (2020-11-18 22:42:02)

Offline

#6 2020-11-19 10:18:08

funkymaster
Member
Registered: 2020-11-17
Posts: 6

Re: Housing power button shutdown at login does not work

A quick note.


logind-handle-power-key can also be used system-wide in

/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml

instead of

/root/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml


The behavior before login remains the same with xfce 4.12.

Last edited by funkymaster (2020-11-19 10:19:18)

Offline

Board footer

Powered by FluxBB