Xfce GDBus.Error:org.freedesktop.ConsoleKit.Manager.Error.InsufficientPermission: Not Authorized

Running xfce4 from lightdm.
Since upgrading all the ports, and xfce going from 4.18 to 4.20, I now get this persistent error message on the desktop.

Power Manager
GDBus.Error:org.freedesktop.ConsoleKit.Manager.Error.InsufficientPermission: Not Authorized

Dunno what it is all about, but I would like to get rid of it.
 
Is DBus itself running? sysrc dbus_enable="YES" and service dbus start. Another (related) issue might be ConsoleKit (or whatever it's called nowadays). Within XFCE. open a terminal and enter ck-list-sessions, it should show some information, similar to this:
Code:
dice@williscorto:~ % ck-list-sessions
Session1:
        unix-user = '1001'
        realname = 'SirDice'
        seat = 'seat0'
        session-type = 'x11'
        session-class = 'user'
        session-state = 'active'
        session-service = 'unspecified'
        active = TRUE
        x11-display = ':0.0'
        x11-display-device = '/dev/ttyv8'
        display-device = ''
        remote-host-name = ''
        is-local = TRUE
        on-since = '2024-12-25T18:39:44.736409Z'
        login-session-id = ''
        XDG_RUNTIME_DIR = '/var/run/user/1001'
        VTNr = '9'

It's been a while since I last used XFCE but if I remember correctly the power manager required some additional permissions, I think it was configured by default for the operator group. But I'm not entirely sure if that's still the case. Easy enough to try; pw groupmod operator -m <user> to add your user account to the operator group.
 
Is DBus itself running? ...
service dbus status
dbus is running as pid 2693.

ck-list-sessions
Code:
	unix-user = '1000'
	realname = 'Geezer'
	seat = 'seat0'
	session-type = 'unspecified'
	session-class = 'user'
	session-state = 'online'
	session-service = 'unspecified'
	active = FALSE
	x11-display = ':0'
	x11-display-device = '/dev/ttyv8'
	display-device = '/dev/   ?   '
	remote-host-name = ''
	is-local = TRUE
	on-since = '2025-01-07T05:37:39.919788Z'
	login-session-id = ''
	XDG_RUNTIME_DIR = '/var/run/user/1000'
	VTNr = '9'

grep operator /etc/group
operator:*:5:root,geezer
 
SirDice

Thank you for the thumbs up. I think I have done every thing right. But I am still getting this error.

I have even turned notifications off for the Power Manager, but it seems to get tuned back on automatically.

Is this time for a PR?
 
Oh, I see some things have changed, check out the pkg-message of x11-wm/xfce4-session:
Code:
# pkg info -D xfce4-session
xfce4-session-4.18.4:
On install:
To be able to shutdown or reboot your system, you'll have to add .rules
files in /usr/local/etc/polkit-1/rules.d directory. Which looks
like this (replace PUTYOURGROUPHERE by your group):

polkit.addRule(function (action, subject) {
  if ((action.id == "org.freedesktop.consolekit.system.restart" ||
      action.id == "org.freedesktop.consolekit.system.stop")
      && subject.isInGroup("PUTYOURGROUPHERE")) {
    return polkit.Result.YES;
  }
});

For those who have working suspend/resume:

polkit.addRule(function (action, subject) {
  if (action.id == "org.freedesktop.consolekit.system.suspend"
      && subject.isInGroup("PUTYOURGROUPHERE")) {
    return polkit.Result.YES;
  }
});
{ there's more but not relevant right now }

I think you might need to add another rule, specifically for power-manager, then use the operator group for PUTYOURGROUPHERE. Although I have no idea which action.id the power-manager uses.

ConsoleKit/PolicyKit acts like a gatekeeper, you can use this to selectively allow users to modify certain (desktop) settings or lock them down. I suspect there's simply no 'default' rule that allows using the power-manager by any 'regular' user.
 
I have not followed the pkg message. I entirely skipped it (my mistake), but I can suspend/restart/turn-off/change user. In my /usr/local/etc/polkit-1/rules.d directory I have only one file: 50-default.rules (the date is 2024.10.17, probably when it was installed). The content is:
Code:
/* -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- */

// DO NOT EDIT THIS FILE, it will be overwritten on update
//
// Default rules for polkit
//
// See the polkit(8) man page for more information
// about configuring polkit.

polkit.addAdminRule(function(action, subject) {
    return ["unix-group:wheel"];
});

I never changed it, it was installed by x11-wm/xfce4 version 4.18, upgraded to 4.20
 

Attachments

  • xfce4_exit.png
    xfce4_exit.png
    37.7 KB · Views: 49
I have not followed the pkg message. I entirely skipped it (my mistake), but I can suspend/restart/turn-off/change user. In my /usr/local/etc/polkit-1/rules.d directory I have only one file: 50-default.rules (the date is 2024.10.17, probably when it was installed).

Yes, I have got that as well.

In the meantime, I have been running xfce4-power-manager --debug and watching the trace.

Coinciding with the error notifications I get:
Code:
(xfce4-power-manager:85535): xfce4-power-manager-WARNING **: 23:26:12.526: Failed to suspend via ConsoleKit: GDBus.Error:org.freedesktop.ConsoleKit.Manager.Error.InsufficientPermission: Not Authorized
TRACE[xfpm-suspend.c:201] xfpm_suspend_try_action(): Executing command: pkexec /usr/local/sbin/xfce4-pm-helper --suspend
==== AUTHENTICATING FOR org.xfce.power.xfce4-pm-helper ====
Authentication is required to place the system in suspend or hibernate mode
Authenticating as: Geezer (geezer)

** (process:97035): WARNING **: 23:26:12.540: Error reading line from helper: nothing to read
==== AUTHENTICATION FAILED ====

It is trying to suspend - which I really do not want - it is a desktop workstation and server. Can't find anywhere to turn this off.

In the meantime, I have ln -s /usr/bin/true /usr/local/sbin/xfce4-pm-helper which is a really horrible kludge. (Didn't work anyway.)
 
Well, I'm on a virtual machine (VirtualBox), there are things that works differently respect to bare metal, it depends on many things (host system hardware, host system OS type, host system emulator type and version, guest system OS type, etc.).

In my /etc/rc.conf, powerd is not enabled: it does not work (I guess because the VM). Running the command xfce4-power-manager --debug the result is:
Code:
~> xfce4-power-manager --debug
Gestore dell'energia di Xfce: È in esecuzione un altro gestore dell'energia
it say Xfce power manager: Another power manager is being executed (I do not know what is that other power manager). In Xfce settings manager for the power manager all is disabled except the 'Screen' tab, the power device (last tab) is line_power_hwxacpixacline.
 
Back
Top