Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-05-21 07:28:56

goosesensor
Member
Registered: 2019-01-22
Posts: 19

Screen lock tool failing on lid suspend

I've never been a bit fan of xfce4-screensaver, but I was messing with it the other day, uninstalled it, installed xscreensaver, messed with it, uninstalled it too, and now find that when I close the lid on my laptop I am presented with a dialog:

"None of the screen lock tools ran successfully, the screen will not be locked. Do you still want to continue to suspend the system? [No] [Yes]"

xflock4

works.

dm-tool lock

works.

xfconf-query -c xfce4-session -p /general/LockCommand -s"xflock4"

does not work.

xfconf-query -c xfce4-session -p /general/LockCommand -s"dm-tool lock"

does not work.

Re-installing xfce4-screensaver or xscreensaver does not work.

Where else might I look?

Offline

#2 2021-05-21 11:00:06

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Screen lock tool failing on lid suspend

Which distro and version of Xfce are you running?

What are the results of the following commands:

whoami
xfconf-query -c xfce4-session -p /general/LockCommand
ps -ef | grep xfce4-power-manager

What happens if you blank out the LockCommand setting?

xfconf-query -c xfce4-session -p /general/LockCommand -s ""

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 2021-05-22 01:24:26

goosesensor
Member
Registered: 2019-01-22
Posts: 19

Re: Screen lock tool failing on lid suspend

ToZ wrote:

Which distro and version of Xfce are you running?

arch, 4.16

ToZ wrote:

What are the results of the following commands:

whoami

"mkd" -- my username

ToZ wrote:
xfconf-query -c xfce4-session -p /general/LockCommand

"dm-tool lock"

ToZ wrote:
ps -ef | grep xfce4-power-manager

mkd          962     703  0 18:19 ?        00:00:00 xfce4-power-manager
mkd         2149    1258  0 18:20 pts/0    00:00:00 grep xfce4-power-manager


ToZ wrote:

What happens if you blank out the LockCommand setting?

xfconf-query -c xfce4-session -p /general/LockCommand -s ""

Unfortunately the same dialog appears when I close the lid.

Last edited by goosesensor (2021-05-22 01:26:07)

Offline

#4 2021-05-22 02:13:55

goosesensor
Member
Registered: 2019-01-22
Posts: 19

Re: Screen lock tool failing on lid suspend

One more detail -- when pressing the power button to display the "Ask" menu, and choosing "Suspend" I am presented with a dialog reading:

"Failed to suspend session.
Failed to lock the screen. [Close]"

Offline

#5 2021-05-22 11:57:36

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Screen lock tool failing on lid suspend

Can you post back:

xfce4-power-manager --dump

And try running xfce4-power-manager in debug mode:

xfce4-power-manager-q && xfce4-power-manager --debug

...and lets see the output.

Then, while still in debug mode, press the power button and let see what it says.


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

#6 2021-05-22 18:27:25

goosesensor
Member
Registered: 2019-01-22
Posts: 19

Re: Screen lock tool failing on lid suspend

ToZ wrote:

Can you post back:

xfce4-power-manager --dump
mkd@book ~ % xfce4-power-manager --dump
---------------------------------------------------
       Xfce power manager version 4.16.0
With policykit support
Without network manager support
---------------------------------------------------
Can suspend: True
Can hibernate: True
Authorized to suspend: True
Authorized to hibernate: True
Authorized to shutdown: True
Has battery: True
Has brightness panel: True
Has power button: True
Has hibernate button: True
Has sleep button: True
Has battery button: True
Has LID: True
ToZ wrote:

And try running xfce4-power-manager in debug mode:

xfce4-power-manager-q && xfce4-power-manager --debug

...and lets see the output.

mkd@book ~ % xfce4-power-manager -q && xfce4-power-manager --debug

** (xfce4-power-manager:7108): WARNING **: 11:20:21.827: Failed to get name owner: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.xfce.PowerManager': no such name

Xfce power manager is not running

** (xfce4-power-manager:7111): WARNING **: 11:20:21.869: Failed to get name owner: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.freedesktop.PowerManagement': no such name


** (xfce4-power-manager:7111): WARNING **: 11:20:21.869: Failed to get name owner: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.xfce.PowerManager': no such name

TRACE[xfpm-main.c:210] xfpm_start(): Starting the power manager
TRACE[xfpm-xfconf.c:679] xfpm_xfconf_init(): lock screen TRUE
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for show-brightness-popup
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for hibernate-button-action
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for sleep-button-action
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for battery-button-action
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for brightness-level-on-ac
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for brightness-slider-min-level
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for dpms-sleep-mode
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for inactivity-sleep-mode-on-ac
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for brightness-on-ac
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for logind-handle-power-key
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for logind-handle-suspend-key
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for logind-handle-hibernate-key
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for heartbeat-command
TRACE[xfpm-dpms.c:72] xfpm_dpms_set_timeouts(): Settings dpms: standby=0 suspend=0 off=1800


(xfce4-power-manager:7111): GLib-GObject-WARNING **: 11:20:21.906: ../glib/gobject/gsignal.c:2614: signal 'Changed' is invalid for instance '0x563078e2a4f0' of type 'GDBusProxy'
TRACE[xfpm-polkit.c:284] xfpm_polkit_init_data(): Using unix session polkit subject
TRACE[xfpm-polkit.c:342] xfpm_polkit_check_auth_intern(): polkit request: (('unix-process', {'pid': <uint32 7111>, 'start-time': <uint64 44538>}), 'org.freedesktop.login1.power-off', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:363] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.login1.power-off is authorized=TRUE
TRACE[xfpm-polkit.c:342] xfpm_polkit_check_auth_intern(): polkit request: (('unix-process', {'pid': <uint32 7111>, 'start-time': <uint64 44538>}), 'org.freedesktop.login1.reboot', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:363] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.login1.reboot is authorized=TRUE
TRACE[xfpm-polkit.c:342] xfpm_polkit_check_auth_intern(): polkit request: (('unix-process', {'pid': <uint32 7111>, 'start-time': <uint64 44538>}), 'org.freedesktop.login1.suspend', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:363] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.login1.suspend is authorized=TRUE
TRACE[xfpm-polkit.c:342] xfpm_polkit_check_auth_intern(): polkit request: (('unix-process', {'pid': <uint32 7111>, 'start-time': <uint64 44538>}), 'org.freedesktop.login1.hibernate', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:363] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.login1.hibernate is authorized=TRUE
TRACE[xfpm-power.c:930] xfpm_power_get_power_devices(): Power device detected at : /org/freedesktop/UPower/devices/line_power_AC
TRACE[xfpm-power.c:889] xfpm_power_add_device(): 'line-power' device added
TRACE[xfpm-power.c:930] xfpm_power_get_power_devices(): Power device detected at : /org/freedesktop/UPower/devices/battery_BAT0
TRACE[xfpm-power.c:889] xfpm_power_add_device(): 'battery' device added
TRACE[xfpm-power.c:898] xfpm_power_add_device(): Battery device type 'battery' detected at: /org/freedesktop/UPower/devices/battery_BAT0
TRACE[xfpm-button.c:180] xfpm_button_xevent_key(): Grabbed key 124 : ((XfpmButtonKey) BUTTON_POWER_OFF)

(xfce4-power-manager:7111): xfce4-power-manager-WARNING **: 11:20:21.914: could not map keysym 1008ffa8 to keycode

TRACE[xfpm-button.c:180] xfpm_button_xevent_key(): Grabbed key 213 : ((XfpmButtonKey) BUTTON_HIBERNATE)
TRACE[xfpm-button.c:180] xfpm_button_xevent_key(): Grabbed key 150 : ((XfpmButtonKey) BUTTON_SLEEP)
TRACE[xfpm-button.c:180] xfpm_button_xevent_key(): Grabbed key 233 : ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_UP)
TRACE[xfpm-button.c:180] xfpm_button_xevent_key(): Grabbed key 232 : ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-button.c:180] xfpm_button_xevent_key(): Grabbed key 244 : ((XfpmButtonKey) BUTTON_BATTERY)
TRACE[xfpm-button.c:180] xfpm_button_xevent_key(): Grabbed key 238 : ((XfpmButtonKey) BUTTON_KBD_BRIGHTNESS_UP)
TRACE[xfpm-button.c:180] xfpm_button_xevent_key(): Grabbed key 237 : ((XfpmButtonKey) BUTTON_KBD_BRIGHTNESS_DOWN)
TRACE[xfpm-power.c:930] xfpm_power_get_power_devices(): Power device detected at : /org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o001
TRACE[xfpm-power.c:889] xfpm_power_add_device(): 'line-power' device added
TRACE[xfpm-power.c:930] xfpm_power_get_power_devices(): Power device detected at : /org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o002
TRACE[xfpm-power.c:889] xfpm_power_add_device(): 'line-power' device added
TRACE[xfpm-dpms.c:72] xfpm_dpms_set_timeouts(): Settings dpms: standby=600 suspend=0 off=1200

TRACE[xfpm-dpms.c:347] xfpm_dpms_set_on_battery(): dpms on battery TRUE
TRACE[xfpm-power.c:1446] xfpm_update_blank_time(): Prev Timeout: 0 / New Timeout: 600
TRACE[xfpm-power.c:210] xfpm_power_check_polkit_auth(): using logind suspend backend
TRACE[xfpm-polkit.c:342] xfpm_polkit_check_auth_intern(): polkit request: (('unix-process', {'pid': <uint32 7111>, 'start-time': <uint64 44538>}), 'org.freedesktop.login1.suspend', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:363] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.login1.suspend is authorized=TRUE
TRACE[xfpm-polkit.c:342] xfpm_polkit_check_auth_intern(): polkit request: (('unix-process', {'pid': <uint32 7111>, 'start-time': <uint64 44538>}), 'org.freedesktop.login1.hibernate', @a{ss} {}, uint32 0, '')
TRACE[xfpm-polkit.c:363] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.login1.hibernate is authorized=TRUE
TRACE[xfpm-power.c:1446] xfpm_update_blank_time(): Prev Timeout: 600 / New Timeout: 600
TRACE[xfpm-power.c:1446] xfpm_update_blank_time(): Prev Timeout: 600 / New Timeout: 0
TRACE[xfpm-manager.c:645] xfpm_manager_inhibit_sleep_systemd(): Inhibiting systemd sleep: handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch

(xfce4-power-manager:7111): xfce4-power-manager-WARNING **: 11:20:21.919: Unable to set the kernel brightness switch parameter to 0.
TRACE[xfpm-backlight.c:262] xfpm_backlight_brightness_on_ac_settings_changed(): Alarm on ac timeout changed 9
TRACE[xfpm-backlight.c:283] xfpm_backlight_brightness_on_battery_settings_changed(): Alarm on battery timeout changed 120
ToZ wrote:

Then, while still in debug mode, press the power button and let see what it says.

Power button

TRACE[xfpm-button.c:114] xfpm_button_filter_x_events(): Key press: ((XfpmButtonKey) BUTTON_POWER_OFF)
TRACE[xfpm-manager.c:365] xfpm_manager_button_pressed_cb(): Received button press event: ((XfpmButtonKey) BUTTON_POWER_OFF)
TRACE[xfpm-manager.c:402] xfpm_manager_button_pressed_cb(): Shutdown request : : ((XfpmShutdownRequest) XFPM_ASK)

Selecting "Suspend" in the menu did not print anything additional.

Offline

#7 2021-05-22 22:44:54

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Screen lock tool failing on lid suspend

Did you get either of the previous messages display on the screen?

"None of the screen lock tools ran successfully, the screen will not be locked. Do you still want to continue to suspend the system? [No] [Yes]"

"Failed to suspend session.
Failed to lock the screen. [Close]"

There was a bug like this a while ago but it should have been fixed. Is your Arch fully updated?
Can you also try with a secondary test account on your computer to see if the problem replicates?


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

#8 2021-05-23 00:05:42

goosesensor
Member
Registered: 2019-01-22
Posts: 19

Re: Screen lock tool failing on lid suspend

ToZ wrote:

Did you get either of the previous messages display on the screen?

"None of the screen lock tools ran successfully, the screen will not be locked. Do you still want to continue to suspend the system? [No] [Yes]"

"Failed to suspend session.
Failed to lock the screen. [Close]"

Yes, they both still display when using --debug option.

ToZ wrote:

There was a bug like this a while ago but it should have been fixed. Is your Arch fully updated?

Yes it is fully updated.

ToZ wrote:

Can you also try with a secondary test account on your computer to see if the problem replicates?

I created a new user, logged into a new XFCE session via LightDM, set "When laptop lid is closed", to "Suspend" in Power Manager settings, and enabled "Lock screen before sleep" in the Session and Startup settings.

Oddly enough nothing at all happens when the lid is closed in this configuration.  I also did not see any messages running with --debug.

Offline

#9 2021-05-23 00:56:13

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Screen lock tool failing on lid suspend

goosesensor wrote:

Oddly enough nothing at all happens when the lid is closed in this configuration.  I also did not see any messages running with --debug.

Try handing lid processing off to systemd by running this command:

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

...and try again.


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

#10 2021-05-24 01:08:18

goosesensor
Member
Registered: 2019-01-22
Posts: 19

Re: Screen lock tool failing on lid suspend

ToZ wrote:
goosesensor wrote:

Oddly enough nothing at all happens when the lid is closed in this configuration.  I also did not see any messages running with --debug.

I think I may have been mistaken on this -- it seems as though sometimes there is just a rather long delay after closing the lid before anything happens (lock failure error message displays).

ToZ wrote:

Try handing lid processing off to systemd by running this command:

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

...and try again.

The system now suspends on lid close, but does not lock.

Setting logind-handle-lid-switch back to 'false' again results in the "None of the screen lock tools ran successfully, the screen will not be locked. [...]" dialog being displayed on lid close. 'xflock4' via xfce4-terminal still works.

Additionally, several times now the system has simply shut down immediately when pressing the power button instead of displaying the "Ask" dialog as configured in Power Manager -> System -> When laptop lid is closed.  This happens intermittently and seemingly at random.

Offline

#11 2021-05-24 01:22:55

goosesensor
Member
Registered: 2019-01-22
Posts: 19

Re: Screen lock tool failing on lid suspend

Setting 'logind-handle-lid-switch' to 'false', installing 'light-locker' and running it with 'light-locker --no-late-locking', setting xfce 'LockCommand' to 'light-locker-control -l' produces the right behavior, but it seems a little clunky.

Setting 'LockCommand' back to 'dm-tool lock' again produces the "None of the screen lock tools ran successfully, the screen will not be locked. [...]" dialog.

Last edited by goosesensor (2021-05-24 01:23:12)

Offline

#12 2021-05-24 03:09:11

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Screen lock tool failing on lid suspend

goosesensor wrote:

Setting 'LockCommand' back to 'dm-tool lock' again produces the "None of the screen lock tools ran successfully, the screen will not be locked. [...]" dialog.

What does the following return:

cat $(which xflock4) | grep -A12 LOCK_CMD

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

#13 2021-05-24 04:03:29

goosesensor
Member
Registered: 2019-01-22
Posts: 19

Re: Screen lock tool failing on lid suspend

ToZ wrote:
goosesensor wrote:

Setting 'LockCommand' back to 'dm-tool lock' again produces the "None of the screen lock tools ran successfully, the screen will not be locked. [...]" dialog.

What does the following return:

cat $(which xflock4) | grep -A12 LOCK_CMD
mkd@book ~ % cat $(which xflock4) | grep -A12 LOCK_CMD
LOCK_CMD=$(xfconf-query -c xfce4-session -p /general/LockCommand)

# Lock by xscreensaver or gnome-screensaver, if a respective daemon is running
for lock_cmd in \
    "$LOCK_CMD" \
    "xfce4-screensaver-command --lock" \
    "xscreensaver-command -lock" \
    "gnome-screensaver-command --lock"
do
    if [ ! -z "$lock_cmd" ]; then
        $lock_cmd >/dev/null 2>&1 && exit
    fi
done

# else run another access locking utility, if installed
for lock_cmd in \
  "xlock -mode blank" \

Offline

#14 2021-05-24 11:44:26

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Screen lock tool failing on lid suspend

By all accounts, this should work. I tested this on a spare computer:
- uninstalled xfce4-screensaver
- setup LockCommand to run "dm-tool lock"
...and it worked.

A bit of a reach here (assuming something is wrong in the config). Restart your computer but before you log into the Xfce session:

  • delete the contents of ~/.cache/sessions

  • rename ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml (to xfce4-power-manager.xml.BAK)

  • rename ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml (to xfce4-session.xml.BAK)

...then log into Xfce.

This will reset the power manger and session configurations to default. Now re-configure them to use LockCommand and whatever other power & lock settings you had and try again.

EDIT: Just search the bug tracking system and found two maybe-relevant bug reports:
- https://gitlab.xfce.org/xfce/xfce4-powe … /issues/83
- https://gitlab.xfce.org/xfce/xfce4-powe … /issues/51

Last edited by ToZ (2021-05-24 11:50:06)


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

#15 2021-05-28 01:47:59

goosesensor
Member
Registered: 2019-01-22
Posts: 19

Re: Screen lock tool failing on lid suspend

ToZ wrote:

By all accounts, this should work. I tested this on a spare computer:
- uninstalled xfce4-screensaver
- setup LockCommand to run "dm-tool lock"
...and it worked.

A bit of a reach here (assuming something is wrong in the config). Restart your computer but before you log into the Xfce session:

  • delete the contents of ~/.cache/sessions

  • rename ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml (to xfce4-power-manager.xml.BAK)

  • rename ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml (to xfce4-session.xml.BAK)

...then log into Xfce.

This will reset the power manger and session configurations to default. Now re-configure them to use LockCommand and whatever other power & lock settings you had and try again.

EDIT: Just search the bug tracking system and found two maybe-relevant bug reports:
- https://gitlab.xfce.org/xfce/xfce4-powe … /issues/83
- https://gitlab.xfce.org/xfce/xfce4-powe … /issues/51


Dang, same message.  I'll give those links a read.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.017 seconds, 10 queries executed - Memory usage: 661.62 KiB (Peak: 694.46 KiB) ]