Solved Xfce Reboot/Suspend GUI

I have installed FreeBSD 10.2 + XFCE. If you want to enable logout/reboot/suspend GUI, type:

# pkg info -D xfce4-session
and follow the instructions.
For me it works so:
Code:
# pkg info -D xfce4-session
xfce4-session-4.12.1_2:
Always:
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;
  }
 
Yesterday it worked for me, but now it don't.Why? Sorry...:(
This is my ~/.xinitrc:
Code:
exec startxfce4 --with-ck-launch

my rc.conf:
Code:
hostname="host"
keymap="it.iso.kbd"
wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
dbus_enabled="YES"
hald_enabled="YES"

I created this file /usr/local/etc/polkit-1/rules.d/51-default.rules:
Code:
polkit.addRule(function (action, subject) {
  if (action.id == "org.freedesktop.consolekit.system.restart" ||
      action.id == "org.freedesktop.consolekit.system.stop"
      && subject.isInGroup("unix-group:wheel")) {
    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("unix-group:wheel")) {
    return polkit.Result.YES;
  }
});
Help me please because I don't have any ideas anymore...
 
Ok solved! :beer::)
I was wrong to edit 51-default.rules file.
Thank you anyway. ;)
 
Last edited by a moderator:
Solved again! :D
I was wrong to type these rows.
Code:
dbus_enabled="YES"
hald_enabled="YES"
in rc.conf file.
I edited them them in exact way and now all works!:)
 
HI
Why didn't tell us what have you done to fix it? It could be helpful! did you append rules in the 50-defaults.rules or did you create a second file with any name?
 
In the post above iI already said to fix: iI edited the wrong rows:
Code:
dbus_enable[FILE]d[/FILE]="YES"
hald_enable[FILE]d[/FILE]="YES"
in rc.conf in this way:
Code:
dbus_enable="YES"
hald_enable="YES"
That's all.
 
Last edited by a moderator:
Back
Top