2016-03-23 8:11 GMT+01:00 Cecil Westerhof <cldwester...@gmail.com>:

> Have you tried running from a root
>
>> crontab?
>>
>
> ​Just tried it and that works. One important difference: it returns an
> error code of 0 instead of 1.
> So probably I need to setup a systemd session. How am I going to do that?
>

​I understood that not on all systems a normal user has the ability to use
suspend and hibernate. Which makes sense. So I now use sudo in the script
and added to '/etc/sudoers':
    cecil ALL = (root) NOPASSWD: /bin/systemctl suspend
    cecil ALL = (root) NOPASSWD: /bin/systemctl hibernate

-- 
Cecil Westerhof
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to