Bug 218322 - x11-wm/xfce4: only logout button is functional
Summary: x11-wm/xfce4: only logout button is functional
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-xfce mailing list
Depends on:
Reported: 2017-04-03 11:27 UTC by MMacD
Modified: 2017-04-28 18:06 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (xfce)


Note You need to log in before you can comment on or make changes to this bug.
Description MMacD 2017-04-03 11:27:13 UTC
The current (according to pkg upgrade) package, installed under 10.3 RELEASE, has non-functional exit buttons except for logout.  If I want to shut down the system in one step, I have to do it via the command line.
Comment 1 Olivier Duchateau 2017-04-05 17:13:54 UTC
I'm curious, what's your graphics card, and which driver is used?
Comment 2 MMacD 2017-04-06 11:42:14 UTC
It's the Nvidia 610 (the card is made by EVGA, iirc).  I'm using the v340 driver, which is quite stable.
Comment 3 Sergey V. Dyatko 2017-04-06 11:59:02 UTC
(In reply to duchateau.olivier from comment #1)

I'm not sure, but... 
right now I have all buttons 'active' -- logout/reboot/shutdown/sleep(?) (uptime 3h, w/o suspend-resume cycle(s))
but after suspend/resume (acpiconf -s3) I can press ony one - logout, reboot and others buttons are  inactive (gray color).
Comment 4 Ben Woods freebsd_committer 2017-04-09 03:29:43 UTC
I think the solution is provided if you look at the message provided as the xfce4-session package is installed (can be recalled with "pkg info -D xfce4-session"):
Comment 5 MMacD 2017-04-10 12:45:28 UTC
Nice catch, but what's a "group" ?
Comment 6 MMacD 2017-04-10 12:46:58 UTC
(In reply to duchateau.olivier from comment #1)
I was wrong about the driver, it's v359
Comment 7 Ben Woods freebsd_committer 2017-04-10 13:04:57 UTC
(In reply to MMacD from comment #5)
In FreeBSD and most unix like operating systems, every user is also a member of 1 or more groups.

The normal group a user is added to in FreeBSD to be allowed to shutdown the system is the "operator" group, so I recommend using that.
Comment 8 MMacD 2017-04-10 19:29:28 UTC
I wonder why it's not checking user-group membership for itself, if that's what "group" means in this context.
Comment 9 MMacD 2017-04-10 19:52:54 UTC
Yeh, I just grubbed around in it a bit:  it should definitely be an install-time option.  The xfce people apparently really dropped the spherical thing.

Since I'm busier than the proverbial long-tailed cat in the room full of rocking chairs, I'm  not even going to *try* to spend the time to learn the ins and outs of polkit.  I'll just wait til poor Olivier can somehow invent enough time to fix it.
Comment 10 Ben Woods freebsd_committer 2017-04-11 13:19:08 UTC
Hi MMacD,
Whilst I agree the current situation is not optimal, it is clearly explained in the message printed when the xfce4-session package is installed.

As root, create the file /usr/local/etc/polkit-1/rules.d/50-shutdown.rules with the following contents:
polkit.addRule(function (action, subject) {
	if ((action.id == "org.freedesktop.consolekit.system.restart" ||
	    action.id == "org.freedesktop.consolekit.system.stop" ||
	    action.id == "org.freedesktop.consolekit.system.suspend" ||
	    action.id == "org.freedesktop.consolekit.system.hibernate") &&
	    subject.isInGroup("operator")) {
		return polkit.Result.YES;

Then simply make sure your user is a member of the operator group. You may need a reboot to get the new config to take effect.
Comment 11 MMacD 2017-04-11 16:09:35 UTC
@Ben Did you get the impression that the rules are auto-interpreted?  I didn't.  To me that looks like compile-and-link code, not just config information.  Which suggests that there's a lot more work involved than just dropping those few lines into a leaf of a subtree!  But I'll try it anyway.  Maybe it'll surprise me.
Comment 12 MMacD 2017-04-11 17:07:56 UTC
No change. Whether I'm right about it not being interpreted, or the problem lies elsewhere, I don't know.  But adding that code didn't change anything.
Comment 13 MMacD 2017-04-28 18:06:28 UTC
I had added myself to the operator group, but that had no effect.

However, the latest pkg upgrade fixed this (but broke other things).