<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-03-23 8:11 GMT+01:00 Cecil Westerhof <span dir="ltr"><<a href="mailto:cldwesterhof@gmail.com" target="_blank">cldwesterhof@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""></span>Have you tried running from a root<br><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
crontab?<br></blockquote></span><div><br><div style="font-family:courier new,monospace;display:inline">​Just tried it and that works. One important difference: it returns an error code of 0 instead of 1.<br>So probably I need to setup a systemd session. How am I going to do that?</div></div></div></div></div></blockquote><div dir="ltr"><br><div class="gmail_default" style="font-family:courier new,monospace;display:inline">​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':<br>    cecil ALL = (root) NOPASSWD: /bin/systemctl suspend<br>    cecil ALL = (root) NOPASSWD: /bin/systemctl hibernate<br><br>-- <br></div></div></div><div class="gmail_signature">Cecil Westerhof</div>
</div></div>