Solved xfce4 no abiltiy to shutdown and reboot that went away..

I did an pkg upgrade and some time afterwards , (when I wanted to reboot), I then noticed that the restart and shutdown options are now grayed out. from what I've looked up it is a not just me. I have yet to find the definite answer only the ability to check its status.

Code:
$ xfce4-power-manager --dump
---------------------------------------------------
       Xfce power manager version 1.6.5
With policykit support
Without 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: False
Has power button: True
Has hibernate button: False
Has sleep button: True
Has battery button: True
Has LID: True
Code:
$  pkg info -D xfce4-session
xfce4-session-4.14.0_1:
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;
  }
});
it does not say what file name to use. so I added it to this one in there but that is a do not edit file . file.
Code:
// 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"];
});

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



polkit.addRule(function (action, subject) {
  if (action.id == "org.freedesktop.consolekit.system.suspend"
      && subject.isInGroup("operator")) {
    return polkit.Result.YES;
  }
});
 
hahaha upon further investigation I discovered this after posting ... use this name
03-xfsm-shutdown-helper.rules
so I did then it works again....

okay that is a quicker answer to this issue, then going through 15 different post on this topic on how to fix this issue.

just do this, create the file in sudo nano /usr/local/etc/polkit-1/rules.d/xfce-shutdown.rules
then add your group you want to in the isInGroup("here") to control this action(s).
Code:
polkit.addRule(function (action, subject) {
  if ((action.id == "org.freedesktop.consolekit.system.restart" ||
      action.id == "org.freedesktop.consolekit.system.stop")
      && subject.isInGroup("operator")) {
    return polkit.Result.YES;
  }
});



polkit.addRule(function (action, subject) {
  if (action.id == "org.freedesktop.consolekit.system.suspend"
      && subject.isInGroup("operator")) {
    return polkit.Result.YES;
  }
});
 
Last edited:
I don't think the filename matters at all as long as it ends in .rules as it says in the pkg-message. Mine is called something like shutdown.rules and it still works fine.

And yes, for some reason this worked fine in xfce 4.12 without this file, but in xfce 4.14 this is required.
 
Mine was the same way too, but i just rebooted or shutdown from the terminal with no problem.

$:su
~: reboot or poweroff for shutdown.
I was never fond of kde , but i started using it yesterday and i was dissapointed on how sluggish it was. But after disabling all the special effects it feels even faster than xfce. I'm loving it.
 
Back
Top