shutdown machine from crontab

Ed Greshko ed.greshko at greshko.com
Wed Sep 16 21:45:17 UTC 2015


On 09/17/15 03:05, Antonio Olivares wrote:
> Tried it and it does not poweroff machine via crontab.  However, from
> $ systemctl poweroff
>
> does poweroff machine.  What could be preventing it from shutting down.  I will try the -f option suggested also, then report back.

If you were to ssh into the machine and enter "systemctl poweroff" or "/usr/bin/poweroff" you'd find that it would prompt you for a password.  This is the same thing that is happening when using the crontab, but of course you can't supply the password in that case.

One option, if you don't want to use root's crontab, would be to make an entry in the sudoers file to allow you to use the poweroff command via sudo without supplying a password.

-- 
It seems most people that say they are "done talking about it" never really are until given the last word.


More information about the users mailing list