Unable to start service within script file initiated by cron - Raspberry Pi Forums
i've noticed deluged has tendency crash interested in monitoring service , restarting if necessary via cron, can't work.
here's cron job:
i've verified cron job firing , logic in script works intended (ie. if modify script write string file instead of line below see occur fine), critical line never works. here line initially:
realized sudo isn't allowed in script, service command requires root permissions. tried removing sudo line above , instead ran cron job root adding way:
didn't work. found out cron not knowing paths, , tried modifications line of script such as:
and
neither worked. tried adding "sudo" cron job, though it's supposed running root:
not sure else try.
here's cron job:
code: select all
* * * * * /home/pi/scripts/deluged-watcher.sh
code: select all
sudo service deluge-daemon restart &
code: select all
sudo crontab -e -u root
code: select all
/usr/sbin/service deluge-daemon restart &
code: select all
/etc/init.d/deluge-daemon restart &
code: select all
* * * * * sudo /home/pi/scripts/deluged-watcher.sh
cron entries run root privileges. possible service restarting , crashing again?
raspberrypi
Comments
Post a Comment