and saved it as /home/steve/bin/sleep.sh. If I execute this from the command line it works.
I have written the following crontab:
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.XXQM14 installed on Thu Aug 16 21:03:25 2012)
# (Cronie version 4.2)
30 22 * * * /home/steve/bin/sleep.sh > /home/steve/cron.txt 2>&1
When this executes, it leaves the following error message:
Error org.freedesktop.UPower.GeneralError: not authorized
You might think that is a bit stupid to answer, but it is what you asked for.
Shutting dow the system (all variants of course. including hibernation, etc.) is typicaly a superuser task (what, when all end-users could do that at will?). Now it could be that a (or more) desktop user(s) are allowed to do this via the freedesktop.org mechanism. But when you run a script in the background, there is no desktop at all.
> robin_listas;2480423 Wrote:
>> There are two commands to directly suspend/hibernate a machine:
>> pm-hibernate or pm-suspend
>> (needs being root), or powersave -U or -u that runs as user if user is
> Actually, I ended up writing a root-level crontab that uses pm-suspend
> and this works. I was just trying to find a way to do this without
> having to be root.
You can configure your user to be able to run pm-suspend without
password in sudoers.
Better yeet: YaST > Sudoers.
openSUSE 11.4 (x86_64) 126.96.36.199-0.20-default main host
openSUSE 12.1 (x86_64) 3.4.8-1-desktop Tumbleweed in VirtualBox
openSUSE 12.1 (i586) 3.1.10-1.16-desktop in EeePC 900