Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Xfce4, Suspend/Reboot/Shutdown grey.
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Warped_Dragon
Apprentice
Apprentice


Joined: 16 Sep 2004
Posts: 158
Location: Canada Eh?

PostPosted: Tue Jan 15, 2019 6:14 pm    Post subject: [SOLVED] Xfce4, Suspend/Reboot/Shutdown grey. Reply with quote

I'm having some issues getting Reboot/Shutdown/Suspend working from the panel in Xfce4. The options are greyed out.

This is a fresh install, done in December. They have been grey since I got Xfce4 installed and never did work. I seem to have everything I need, but apparently I've missed something. All commands (reboot, poweroff, shutdown -P now, pm-suspend) work fine either with sudo or as root.

Consolekit, Policykit, DBus, upower all installed.
Code:
warped@felucca ~ $ eix -I consolekit
[I] sys-auth/consolekit
     Installed versions:  1.2.1(12:04:34 PM 2019-01-12)(acl cgroups evdev pam pm-utils policykit udev -debug -doc -selinux -test KERNEL="linux")

warped@felucca ~ $ eix -I polkit
[I] sys-auth/polkit
     Installed versions:  0.115-r2(12:02:52 PM 2019-01-12)(gtk introspection nls pam -elogind -examples -jit -kde -selinux -systemd -test)

warped@felucca ~ $ eix -I dbus
[I] sys-apps/dbus
     Installed versions:  1.10.24(12:00:10 PM 2019-01-12)(X -debug -doc -elogind -selinux -static-libs -systemd -test -user-session ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="32 64 -x32" KERNEL="linux")

warped@felucca ~ $ eix -I upower
[I] sys-power/upower
     Installed versions:  0.99.8-r1(0/3)(12:01:18 PM 2019-01-12)(introspection -doc -ios -selinux KERNEL="linux -FreeBSD")

warped@felucca /var/log $ eix -I pm-utils
[I] sys-power/pm-utils
     Installed versions:  1.4.1-r7(12:00:40 PM 2019-01-12)(alsa -debug -ntp VIDEO_CARDS="radeon -intel")


I did find references to conflict issues between upower and pm-utils, but they are all several years old and seem to no longer apply. In fact, xfce4-power-manager requires pm-utils regardless of use flags, and xfce4-session pulls in pm-utils if you have upower enabled. I'm not sure it would be possible to have upower alone.
Code:
warped@felucca ~ $ equery d pm-utils
 * These packages depend on pm-utils:
sys-auth/consolekit-1.2.1 (pm-utils ? sys-power/pm-utils)
xfce-base/xfce4-session-4.12.1-r2 (upower ? sys-power/pm-utils)
xfce-extra/xfce4-power-manager-1.6.1 (sys-power/pm-utils)


Consolekit/Dbus are started and in the default runlevel:
Code:
warped@felucca ~ $ rc-update show | grep -e dbus -e consolekit
           consolekit |      default                           
                 dbus |      default                 
warped@felucca ~ $ rc-status | grep -e dbus -e consolekit
 dbus                                                              [  started  ]
 consolekit                                                        [  started  ]


User is a member of the relevant groups:
Code:
warped@felucca ~ $ groups
lp wheel audio cdrom video cdrw usb users lpadmin pcscd plugdev warped


PolicyKit has a rules file allowing wheel-group users a free pass:
Code:
felucca /home/warped # cat /etc/polkit-1/rules.d/10-admin.rules
polkit.addAdminRule(function(action, subject) {
    return ["unix-group:wheel"];
});


Starting Xfce4 via SLiM and ~/xinitrc:
Code:
warped@felucca ~ $ cat /etc/slim.conf | grep login_cmd
login_cmd           exec /bin/bash -login ~/.xinitrc %session

warped@felucca ~ $ cat ~/.xinitrc
#startxfce4 --with-ck-launch
ck-launch-session dbus-launch --sh-syntax --exit-with-session xfce4-session


Consolekit sessions exist after logging in:
Code:
warped@felucca ~ $ ck-list-sessions
Session1:
   unix-user = '1000'
   realname = '(null)'
   seat = 'Seat1'
   session-type = 'x11'
   session-class = 'user'
   session-state = 'active'
   active = TRUE
   x11-display = ':0.0'
   x11-display-device = '/dev/tty7'
   display-device = ''
   remote-host-name = ''
   is-local = TRUE
   on-since = '2019-01-15T16:52:28.648855Z'
   login-session-id = '1'
   XDG_RUNTIME_DIR = '/var/run/user/1000'
   VTNr = '7'
Session2:
   unix-user = '1000'
   realname = '(null)'
   seat = 'Seat1'
   session-type = 'unspecified'
   session-class = 'user'
   session-state = 'online'
   active = FALSE
   x11-display = ':0.0'
   x11-display-device = '/dev/tty7'
   display-device = ''
   remote-host-name = ''
   is-local = TRUE
   on-since = '2019-01-15T16:52:28.936781Z'
   login-session-id = '1'
   XDG_RUNTIME_DIR = '/var/run/user/1000'
   VTNr = '7'


Xfce4 power manager reports there is no authorization.
Code:
warped@felucca ~ $ xfce4-power-manager --dump
---------------------------------------------------
       Xfce power manager version 1.6.1
With policykit support
With network manager support
---------------------------------------------------
Can suspend: True
Can hibernate: True
Authorized to suspend: False
Authorized to hibernate: False
Authorized to shutdown: False
Has battery: True
Has brightness panel: True
Has power button: True
Has hibernate button: True
Has sleep button: True
Has LID: True


And lastly, my emerge --info:
https://pastebin.com/raw/UhMYXtH7

The newest forum post I can find on the subject is from last year, and doesn't really have a smoking gun to point to, just "I recompiled lots of things and it works now". I did try that, with no luck. Everything I've found older than that mention the upower/pm-utils conflict (which I believe was resolved, and regarding systemd and upower-pm-utils), a since-fixed SLiM bug, or lead the questioner step-by-step through setting things up as I have here and it Just Works.

Can anyone point me in the right direction? The fact that Xfce Power Manager reports a lack of authorization makes me suspect a problem with my PolicyKit setup, but I'm not sure what I am looking for.

PolicyKit entries in /var/logs/auth.log from first boot today:
Code:
felucca /var/log # cat auth.log | grep "Jan 15" | grep polkit
Jan 15 09:52:11 felucca polkitd[6028]: Loading rules from directory /etc/polkit-1/rules.d
Jan 15 09:52:12 felucca polkitd[6028]: Loading rules from directory /usr/share/polkit-1/rules.d
Jan 15 09:52:12 felucca polkitd[6028]: Finished loading, compiling and executing 6 rules
Jan 15 09:52:12 felucca polkitd[6028]: Acquired the name org.freedesktop.PolicyKit1 on the system bus
Jan 15 09:52:38 felucca polkitd[6028]: Registered Authentication Agent for unix-session:/org/freedesktop/ConsoleKit/Session2 (system bus name :1.18 [/usr/libexec/polkit-gnome-authentication-agent-1], object path /org/gnome/PolicyKit1/AuthenticationAgent, locale en_CA.utf8)



Edit: Solved. Did some more digging and found this post from 2015, which provided a different policykit rule than the one listed above that I had found earlier.

The Rule That Fixed It:
Code:
/* Allow members of the wheel group to execute any actions
 * without password authentication, similar to "sudo NOPASSWD:"
 */
polkit.addRule(function(action, subject) {
    if (subject.isInGroup("wheel")) {
        return polkit.Result.YES;
    }
});

_________________
No.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum