How to suspend/hibernate remote system without root

Ali Abdallah aliov at xfce.org
Sun Nov 8 23:40:07 PST 2009


Maxim Levitsky wrote:
> dbus-send 
> --print-reply
> --system --dest=org.freedesktop.DeviceKit.Power
> /org/freedesktop/DeviceKit/Power org.freedesktop.DeviceKit.Power.Suspend
>
> But it fails with 'not authorized' message.
> Locally it works.
>
>   

You need to setup polkit authorization for the user to use the Suspend 
and Hibernate of devkit-power, most probably polkit authorization 
definitions are in /var/lib/polkit-1/localauthority/ and there should be 
a folder called 50-local.d, make a file there called
org.freedesktop.devicekit.power.pkla and contains something like

[Local Users]
Identity=unix-user:your_user_name
Action=org.freedesktop.devicekit.power.Suspend
ResultAny=yes
ResultInactive=no
ResultActive=yes


You can also use Action=org.freedesktop.devicekit.power.* to use both 
Suspend and Hibernate.

for more information have a look to man pklocalauthority
> Best regards,
> Maxim Levitky
>   

Best Regards,
Ali.
>
> _______________________________________________
> devkit-devel mailing list
> devkit-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/devkit-devel
>   



More information about the devkit-devel mailing list