You are not logged in.
Hi everyone,
Suspending the computer works fine if I manually press Whisker Menu's Suspend key, or if I run systemctl suspend.
But Xfce Power Manager doesn't put the computer to sleep after idling for 15 minutes.
What happens instead, is that the screen goes blank, but the suspend does not happen (the lights on my computer case do not flash). Upon waking it up and logging in, the tasks in my custom SystemD After=suspend.target service does not run. I need to run systemctl cancel for them to run.
If I turn the computer off, then the computer doesn't shut off. Instead it goes into suspend mode. After I press the power button, a line or 2 extra appears in the shutdown process, then the computer shuts down normally.
I've had this issue for a while now.
There is some error in journalctl --boot=0. This makes me think it's Nvidia driver having an error, but there's been a driver update lately, which didn't fix things. There are fewer errors reported though.
I really doubt this is the cause since manual suspend works fine:
░░ The system has now entered the suspend sleep state.
Nov 05 18:48:08 arch kernel: PM: suspend entry (deep)
Nov 05 18:48:08 arch kernel: [drm:drm_new_set_master [drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Nov 05 18:48:08 arch kernel: [drm:drm_new_set_master [drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Nov 05 18:48:08 arch wpa_supplicant[851]: nl80211: deinit ifname=wlp0s20f0u14 disabled_11b_rates=0
Some extra info:
- xfce4-power-manager version: 4.16.0. It runs on startup.
Offline
Lets try this to get some debug info.
First, if open, close the power manager settings window.
Second, if your computer is on battery power, run this command to set the timeout to one minute:
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/inactivity-on-battery -s 1
...otherwise, if plugged into a power source, run:
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/inactivity-on-ac -s 1
Third, run the power manager in debug mode - in a terminal window:
xfce4-power-manager -q
xfce4-power-manager --debug
Then wait one minute for it to trigger the suspend action. Post back all the debug content from the terminal window. Lets see what xfce4-power-manager says about all of this.
And can you also post back the results of:
xfconf-query -c xfce4-power-manager -lv
xfce4-power-manager --dump
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
Thanks for the suggestions. My computer is a desktop.
I did not setup hibernation, so there is no hibernate file/partition.
I ran the following commands:
$ xfconf-query --channel xfce4-power-manager --property /xfce4-power-manager/inactivity-on-ac --set 1
$ xfconf-query --channel xfce4-power-manager --property /xfce4-power-manager/dpms-on-ac-off --set 1
These were originally both 15 minutes.
The second command is also needed, or for some reason when I resume, there is no login manager, just a black screen with my mouse cursor. My login manager is the lightdm-webkit-theme-aether package in Arch Linux.
I then ran your command, with a minor addition to get a log file as well:
$ stdbuf --output=L --error=L xfce4-power-manager --debug &> xfce4_power_manager.log
I tried waiting and joining back 3 times, but all 3 times were fine. Perhaps I need to wait the normal 15 minutes for some reason?
The outputs of the other commands, after I set the timeouts back to 15 minutes:
$ xfconf-query --channel xfce4-power-manager --list --verbose
/xfce4-power-manager/dpms-enabled true
/xfce4-power-manager/dpms-on-ac-off 15
/xfce4-power-manager/inactivity-on-ac 15
/xfce4-power-manager/lock-screen-suspend-hibernate true
/xfce4-power-manager/logind-handle-lid-switch false
$ xfce4-power-manager --dump
---------------------------------------------------
Xfce power manager version 4.16.0
With policykit support
Without network manager support
---------------------------------------------------
Can suspend: True
Can hibernate: True
Authorised to suspend: True
Authorised to hibernate: True
Authorised to shutdown: True
Has battery: False
Has brightness panel: False
Has power button: True
Has hibernate button: True
Has sleep button: True
Has battery button: True
Has LID: False
Last edited by simonzack (2021-11-06 12:44:30)
Offline
I tried waiting and joining back 3 times, but all 3 times were fine. Perhaps I need to wait the normal 15 minutes for some reason?
Maybe try with 15 minutes, but I don't see why that should be any different. Its just a timeout. Does the log file (for both the 1 and 15 minute tests) have anything interesting? You should see when the timeout gets triggered - hoping maybe there is something else at that time when it fails.
Also have a read through https://docs.xfce.org/xfce/xfce4-power- … er-manager. By default, logind is inhibited. Perhaps set it up so logind handles the suspend function - to see if that helps (since "systemd suspend" works for you).
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
I tried using logind:
$ xfconf-query --channel xfce4-power-manager --property /xfce4-power-manager/logind-handle-suspend-key --create --type bool --set true
This resulted in the same issue somehow.
After that I set this back to false. I tried to run the following with inactivity-on-ac and dpms-on-ac-off both at 15 minutes:
$ xfce4-power-manager --quit
$ stdbuf --output=L --error=L xfce4-power-manager --no-daemon --debug &> ~/downloads_tmp/xfce4_power_manager.log
Here's the debug log. I wonder if you can see some issue here:
** (xfce4-power-manager:128053): WARNING **: 15:58:56.000: 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:128053): WARNING **: 15:58:56.000: 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 general-notification
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for critical-power-level
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 handle-brightness-keys
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for brightness-step-count
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for brightness-exponential
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for show-tray-icon
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for critical-power-action
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for power-button-action
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 lid-action-on-ac
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for lid-action-on-battery
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-level-on-battery
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-on-ac-sleep
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for dpms-on-battery-sleep
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for dpms-on-battery-off
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-on-battery
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 inactivity-sleep-mode-on-battery
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 brightness-on-battery
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-hibernate-key
TRACE[xfpm-xfconf.c:166] xfpm_xfconf_load(): Using default configuration for heartbeat-command
(xfce4-power-manager:128053): GLib-GObject-WARNING **: 15:58:56.015: ../glib/gobject/gsignal.c:2614: signal 'Changed' is invalid for instance '0x55d093988b60' 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 128053>, 'start-time': <uint64 2043028>}), '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 128053>, 'start-time': <uint64 2043028>}), '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 128053>, 'start-time': <uint64 2043028>}), '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 128053>, 'start-time': <uint64 2043028>}), '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: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 128053>, 'start-time': <uint64 2043028>}), '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 128053>, 'start-time': <uint64 2043028>}), '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-button.c:180] xfpm_button_xevent_key(): Grabbed key 124 : ((XfpmButtonKey) BUTTON_POWER_OFF)
(xfce4-power-manager:128053): xfce4-power-manager-WARNING **: 15:58:56.024: 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-manager.c:645] xfpm_manager_inhibit_sleep_systemd(): Inhibiting systemd sleep: handle-power-key:handle-hibernate-key:handle-lid-switch
(xfce4-power-manager:128053): xfce4-power-manager-WARNING **: 15:58:56.028: Failed to get keyboard max brightness level : GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/freedesktop/UPower/KbdBacklight”
TRACE[xfpm-polkit.c:241] xfpm_polkit_free_data(): Destroying Polkit data
TRACE[xfpm-manager.c:492] xfpm_manager_alarm_timeout_cb(): Alarm inactivity timeout id 3
Last edited by simonzack (2021-11-07 07:24:22)
Offline
You can see in the log file where it now sets up to use the logind suspend backend. Does your /etc/systemd/logind.conf contain default values - especially for "HandleSuspendKey"? (should be set to suspend).
Also, from your previous post:
I tried waiting and joining back 3 times, but all 3 times were fine.
Does this mean that when you set the timeout to 1 minute, the suspend action worked properly?
Edit: One more thing. What does the following return:
systemd-inhibit --list --no-pager
Last edited by ToZ (2021-11-07 11:10:44)
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
You can see in the log file where it now sets up to use the logind suspend backend.
That's interesting. It must be using logind automatically then. I just tried this today once more after deleting this line in ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml
<property name="logind-handle-suspend-key" type="bool" value="true"/>
and it also had the line:
TRACE[xfpm-power.c:210] xfpm_power_check_polkit_auth(): using logind suspend backend
Does your /etc/systemd/logind.conf contain default values - especially for "HandleSuspendKey"? (should be set to suspend).
Yes I never touched this file. It's pretty much entirely commented out, including the section:
[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#UserStopDelaySec=10
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#HandleRebootKey=reboot
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#RebootKeyIgnoreInhibited=no
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RuntimeDirectoryInodes=400k
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192
Edit: One more thing. What does the following return:
systemd-inhibit --list --no-pager
This gives:
WHO UID USER PID COMM WHAT WHY MODE
NetworkManager 0 root 697 NetworkManager sleep NetworkManager needs to turn off networks delay
Screen Locker 1000 xxx 1125 light-locker sleep Lock the screen on suspend/resume delay
xfce4-power-manager 1000 xxx 49440 xfce4-power-man handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch xfce4-power-manager handles these events block
3 inhibitors listed.
There's also Caffeine-ng, which I always make sure is turned off when I'm away. I don't think this is a cause to my issue, as if this is turned on then the screen doesn't even turn off.
Also, from your previous post:
I tried waiting and joining back 3 times, but all 3 times were fine.
Does this mean that when you set the timeout to 1 minute, the suspend action worked properly?
Yup just tried it now, and it works fine.
I logged the same info for both 15 minutes and 1 minute. Diffing the 2 files and there isn't really anything different, apart from timestamps and IDs.
Last edited by simonzack (2021-11-09 07:25:46)
Offline
There seems to be an inconsistency in your system configuration.
On a test system here, systemd inhibitor listing pre:
$ systemd-inhibit --list --no-pager
WHO UID USER PID COMM WHAT WHY MODE
UPower 0 root 471 upowerd sleep Pause device polling delay
xfce4-power-manager 1000 toz 1704 xfce4-power-man handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch xfce4-power-manager handles these events block
xfce4-screensaver 1000 toz 405 xfce4-screensav sleep Locking screen before sleep delay
3 inhibitors listed.
(note: the power manager is handling the suspend key)
Running:
xfconf-query --channel xfce4-power-manager --property /xfce4-power-manager/logind-handle-suspend-key --create --type bool --set true
Systemd inhibitor listing post:
$ systemd-inhibit --list --no-pager
WHO UID USER PID COMM WHAT WHY MODE
UPower 0 root 471 upowerd sleep Pause device polling delay
xfce4-power-manager 1000 toz 1704 xfce4-power-man handle-power-key:handle-hibernate-key:handle-lid-switch xfce4-power-manager handles these events block
xfce4-screensaver 1000 toz 405 xfce4-screensav sleep Locking screen before sleep delay
3 inhibitors listed.
Notice that it is no longer handling the suspend key. Your output seems to suggest that it is still handling the key?
What does the following return now:
xfconf-query -c xfce4-power-manager -lv
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
Notice that it is no longer handling the suspend key. Your output seems to suggest that it is still handling the key?
Ah I undid my previous change a few posts ago, so LoginD does not handle suspends, as that didn't seem to fix anything.
I just ran this now to make this a bit more explicit in my settings:
$ xfconf-query --channel xfce4-power-manager --property /xfce4-power-manager/logind-handle-suspend-key --create --type bool --set false
Current settings are:
$ xfconf-query --channel xfce4-power-manager --list --verbose
/xfce4-power-manager/dpms-enabled true
/xfce4-power-manager/dpms-on-ac-off 15
/xfce4-power-manager/inactivity-on-ac 15
/xfce4-power-manager/lock-screen-suspend-hibernate true
/xfce4-power-manager/logind-handle-lid-switch false
/xfce4-power-manager/logind-handle-suspend-key false
Offline
Hmm. I'm at a loss why this is't working for you. If it worked when you manually set it to 1 minute - what if you manually set t to 14 minutes. Does it work then?
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
Hmm it did work for 15 minutes just now, after I restarted and left the computer suspended.
From what I remember, I think the situation is that it works the first time but never the second time.
But good idea, maybe I can try other time intervals and see what happens.
Offline
I did post into another thread, but I also experience the problem discussed here...
Edit: One more thing. What does the following return:
systemd-inhibit --list --no-pager
Here is the output on my machine:
$ systemd-inhibit --list --no-pager
WHO UID USER PID COMM WHAT WHY MODE
NetworkManager 0 root 602 NetworkManager sleep NetworkManager needs to turn off networks delay
UPower 0 root 1354 upowerd sleep Pause device polling delay
Screen Locker 1000 gour 1797 light-locker sleep Lock the screen on suspend/resume delay
xfce4-power-manager 1000 gour 5270 xfce4-power-man handle-power-key:handle-hibernate-key:handle-lid-switch xfce4-power-manager handles these events block
4 inhibitors listed.
and I wonder whether it looks ok?
Offline
I did post into another thread, but I also experience the problem discussed here...
I've posted in your other thread. Perhaps best to continue your conversation over there and not take over @simonzack's thread.
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
[ Generated in 0.013 seconds, 8 queries executed - Memory usage: 662.71 KiB (Peak: 695.55 KiB) ]