I have done a lot of things since this morning and gave up. And hence asking here. Here is what I tried:
1. Modify polkit rules
Code: Select all
# cat /etc/polkit-1/rules.d/01-default.rules
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.upower.suspend" ||
action.id == "org.freedesktop.upower.hibernate") {
return polkit.Result.YES;
}
});Code: Select all
# cat /etc/polkit-1/localauthority/50-local.d/org.freedesktop.upower.pkla
[Local Users]
Identity=unix-group:wheel
Action=org.freedesktop.upower.*
ResultAny=yes
ResultInactive=no
ResultActive=yesIt doesn't make a difference if I replace "org.freedesktop.upower.suspend" with "org.freedesktop.login1.Manager".
Also, I get the following error, the code in powerdevil is poking the same values from dbus system bus, and hence concluding that suspend is not supported:
Code: Select all
# qdbus --system org.freedesktop.UPower /org/freedesktop/UPower SuspendAllowed
QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed
QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed
Error: org.freedesktop.DBus.Error.AccessDenied
Rejected send message, 3 matched rules; type="method_call", sender=":1.47" (uid=0 pid=28705 comm="qdbus --system org.freedesktop.UPower /org/freedes") interface="(unset)" member="SuspendAllowed" error name="(unset)" requested_reply="0" destination="org.freedesktop.UPower" (uid=0 pid=27197 comm="/usr/lib/upower/upowerd ")What the heck do I need to do to allow access to these methods in dbus?
<rant>
whoever did this disabling of suspend by default in dbus, did a great injustice to the public at large.
</rant>
