Good Evening Everyone,
I wonder if somebody can tell me what this depends on.
I would like to allow a mortal FreeBSD user to shut down the computer
from an X desktop. XFCE is being used, which has shutdown and reboot
options in its main menu. When I startx as root, these items are
clickable in the menu. When the mortal user account does startx, the
same shutdown and reboot options in the XFCE manu are grayed out.
Now, the mortal user account is a member of the wheel and operator
groups, so it can perform a proper "shutdown -p now" in any command line
and the computer does power down nicely.
Also, as suggested by the xfce-session package, I have created a new
file named 40-desktopuser.rules in /usr/local/etc/polkit-1/rules.d/ with
the below contents:
polkit.addRule(function (action, subject) {
if (
action.id == "org.freedesktop.consolekit.system.restart" ||
action.id == "org.freedesktop.consolekit.system.stop"
&& subject.isInGroup("desktopuser")) {
return polkit.Result.YES;
}
});
polkit.addRule(function (action, subject) {
if (
action.id == "org.freedesktop.consolekit.system.suspend"
&& subject.isInGroup("desktopuser")) {
return polkit.Result.YES;
}
});
The mortal user has been added to the desktopuser group.
The user is still unable to shut down the PC from the XFCE menu, as the
item is still disabled. Unfortunatelly, I couldn't find how to confirm
if my rules from the .rules file are actually loaded and have effect.
The sample rules file that comes with the package mentiones to read
polkit(8), but man 8 polkit and man 8 PolKit finds no available manual
pages.
I also checked the Handbook to see if any recent updates provide
instructions on such settings, but found nothing related.
How do I enable the shutdown/reboot items in the XFCE menu? What does
the mortal user need in order to XFCE enable those menu items?
Ultimately, I plan to enable xdm or gdm, so that the computer starts
with a GUI automatically. Would that make the shutdown option available
for X users?
Regards,
Keve Nagy * Debrecen * Hungary
--
to contact me directly:
keve(at)safe-mail(dot)net