Mick,

On Friday, 2019-12-20 13:55:29 +0000, you wrote:

> ...
> If you can't run suspend/hibernate it may be polkit policies are not allowing 
> you to run these commands via dbus.  However, polkit policies are 
> automatically installed/updated as required by the packages you have on your 
> system.  For example, this is what I have on my desktop (KDE):
> 
> $ pkaction | grep susp
> org.freedesktop.login1.inhibit-handle-suspend-key
> org.freedesktop.login1.suspend
> org.freedesktop.login1.suspend-ignore-inhibit
> org.freedesktop.login1.suspend-multiple-sessions
> 
> $ pkaction | grep hibernate
> org.freedesktop.login1.hibernate
> org.freedesktop.login1.hibernate-ignore-inhibit
> org.freedesktop.login1.hibernate-multiple-sessions
> org.freedesktop.login1.inhibit-handle-hibernate-key

Here it is:

$ pkaction|\grep -E 'hiber|susp'
org.freedesktop.consolekit.system.hibernate
org.freedesktop.consolekit.system.hibernate-multiple-users
org.freedesktop.consolekit.system.suspend
org.freedesktop.consolekit.system.suspend-multiple-users
$

And using "--verbose" I get:

   $ pkaction --action-id org.freedesktop.consolekit.system.hibernate --verbose
   org.freedesktop.consolekit.system.hibernate:
     description:       Hibernate the system
     message:           System policy prevents hibernating the system
     vendor:            
     vendor_url:        
     icon:              
     implicit any:      no
     implicit inactive: no
     implicit active:   yes

   $ pkaction --action-id org.freedesktop.consolekit.system.suspend --verbose
   org.freedesktop.consolekit.system.suspend:
     description:       Suspend the system
     message:           System policy prevents suspending the system
     vendor:            
     vendor_url:        
     icon:              
     implicit any:      no
     implicit inactive: no
     implicit active:   yes

   $

In "/etc/polkit-1/rules.d/"  are only  three rules files,  the first and
last one being copied by me from the internet somewhere,  the second one
being original:

   # cd /etc/polkit-1/rules.d
   # for f in *; do echo ---- $f; cat $f; done
   ---- 10-admin.rules
   polkit.addAdminRule(function(action, subject) {
       return ["unix-group:wheel"];
   });
   ---- 50-default.rules
   /* -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- */

   // 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-user:0"];
   });
   ---- 50-org.freedesktop.NetworkManager.rules
   polkit.addRule(function(action, subject) {
       if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && 
subject.isInGroup("plugdev")) {
           return polkit.Result.YES;
       }
   });
   #

> ...
> These are the USE flags for polkit on this system:

These are the polkit USE flags here:

   $ eix -l sys-auth/polkit|grep Installed
        Installed versions:  0.115-r4(15:10:56 22/10/19)(consolekit gtk 
introspection nls pam -elogind -examples -jit -kde -selinux -systemd -test)
   $

The only differences I see are  that you are using "elogind" rather than
"consolekit", and that I'm using "gtk" while you are using "kde".

If someone could point me  to any missing policy rules,  I would be glad
to add them.

Sincerely,
  Rainer

Reply via email to