1 |
Mick, |
2 |
|
3 |
On Friday, 2019-12-20 13:55:29 +0000, you wrote: |
4 |
|
5 |
> ... |
6 |
> If you can't run suspend/hibernate it may be polkit policies are not allowing |
7 |
> you to run these commands via dbus. However, polkit policies are |
8 |
> automatically installed/updated as required by the packages you have on your |
9 |
> system. For example, this is what I have on my desktop (KDE): |
10 |
> |
11 |
> $ pkaction | grep susp |
12 |
> org.freedesktop.login1.inhibit-handle-suspend-key |
13 |
> org.freedesktop.login1.suspend |
14 |
> org.freedesktop.login1.suspend-ignore-inhibit |
15 |
> org.freedesktop.login1.suspend-multiple-sessions |
16 |
> |
17 |
> $ pkaction | grep hibernate |
18 |
> org.freedesktop.login1.hibernate |
19 |
> org.freedesktop.login1.hibernate-ignore-inhibit |
20 |
> org.freedesktop.login1.hibernate-multiple-sessions |
21 |
> org.freedesktop.login1.inhibit-handle-hibernate-key |
22 |
|
23 |
Here it is: |
24 |
|
25 |
$ pkaction|\grep -E 'hiber|susp' |
26 |
org.freedesktop.consolekit.system.hibernate |
27 |
org.freedesktop.consolekit.system.hibernate-multiple-users |
28 |
org.freedesktop.consolekit.system.suspend |
29 |
org.freedesktop.consolekit.system.suspend-multiple-users |
30 |
$ |
31 |
|
32 |
And using "--verbose" I get: |
33 |
|
34 |
$ pkaction --action-id org.freedesktop.consolekit.system.hibernate --verbose |
35 |
org.freedesktop.consolekit.system.hibernate: |
36 |
description: Hibernate the system |
37 |
message: System policy prevents hibernating the system |
38 |
vendor: |
39 |
vendor_url: |
40 |
icon: |
41 |
implicit any: no |
42 |
implicit inactive: no |
43 |
implicit active: yes |
44 |
|
45 |
$ pkaction --action-id org.freedesktop.consolekit.system.suspend --verbose |
46 |
org.freedesktop.consolekit.system.suspend: |
47 |
description: Suspend the system |
48 |
message: System policy prevents suspending the system |
49 |
vendor: |
50 |
vendor_url: |
51 |
icon: |
52 |
implicit any: no |
53 |
implicit inactive: no |
54 |
implicit active: yes |
55 |
|
56 |
$ |
57 |
|
58 |
In "/etc/polkit-1/rules.d/" are only three rules files, the first and |
59 |
last one being copied by me from the internet somewhere, the second one |
60 |
being original: |
61 |
|
62 |
# cd /etc/polkit-1/rules.d |
63 |
# for f in *; do echo ---- $f; cat $f; done |
64 |
---- 10-admin.rules |
65 |
polkit.addAdminRule(function(action, subject) { |
66 |
return ["unix-group:wheel"]; |
67 |
}); |
68 |
---- 50-default.rules |
69 |
/* -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- */ |
70 |
|
71 |
// DO NOT EDIT THIS FILE, it will be overwritten on update |
72 |
// |
73 |
// Default rules for polkit |
74 |
// |
75 |
// See the polkit(8) man page for more information |
76 |
// about configuring polkit. |
77 |
|
78 |
polkit.addAdminRule(function(action, subject) { |
79 |
return ["unix-user:0"]; |
80 |
}); |
81 |
---- 50-org.freedesktop.NetworkManager.rules |
82 |
polkit.addRule(function(action, subject) { |
83 |
if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("plugdev")) { |
84 |
return polkit.Result.YES; |
85 |
} |
86 |
}); |
87 |
# |
88 |
|
89 |
> ... |
90 |
> These are the USE flags for polkit on this system: |
91 |
|
92 |
These are the polkit USE flags here: |
93 |
|
94 |
$ eix -l sys-auth/polkit|grep Installed |
95 |
Installed versions: 0.115-r4(15:10:56 22/10/19)(consolekit gtk introspection nls pam -elogind -examples -jit -kde -selinux -systemd -test) |
96 |
$ |
97 |
|
98 |
The only differences I see are that you are using "elogind" rather than |
99 |
"consolekit", and that I'm using "gtk" while you are using "kde". |
100 |
|
101 |
If someone could point me to any missing policy rules, I would be glad |
102 |
to add them. |
103 |
|
104 |
Sincerely, |
105 |
Rainer |