You are not logged in.

#1 2013-09-02 05:06:49

Gradient
Member
Registered: 2013-05-19
Posts: 101

'suspend' command in script run as a cronjob not working

I have the following 2 lines in a script run every minute :

echo "test" >> $HOME/test
/usr/bin/systemctl suspend

The 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

#2 2013-09-03 20:30:06

thegala
Member
Registered: 2013-08-27
Posts: 16

Re: 'suspend' command in script run as a cronjob not working

Do you run this as root?


Scio me nihil scire

Offline

#3 2013-09-03 20:33:50

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: 'suspend' command in script run as a cronjob not working

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

Board footer

Powered by FluxBB