You are not logged in.
I have the following 2 lines in a script run every minute :
echo "test" >> $HOME/test
/usr/bin/systemctl suspendThe script is run properly as the file 'test' is appended with 'test' every minute. But the suspend command doesn't work. Both command work when they are entered manually.
What could be causing this?
Offline
Do you run this as root?
Scio me nihil scire
Offline
To expand on what I think thegala is trying to get at, the use of systemctl's suspend, poweroff, etc. are all made available to a regular user through polkit and logind. So I am not sure that the cron daemon gets itself an authenticated session, making that suspend non-functional.
Offline