I have some cronjobs that I always used and worked fine. But now, trying to move everything to Docker
containers, I'm running into these errors:
/usr/bin/service: 127: /usr/bin/service: stop: not found
/usr/bin/service: 128: exec: start: not found
They occur when executing things like "service restart nginx"
these cronjobs. Note that the same commands work fine outside the cronjobs.
The PATH is correctly set in /etc/crontab
. Adding it to the individual cronfiles in /etc/cron.d
doesn't work either. I also tried changing SHELL=/bin/sh
to SHELL=/bin/bash
(even though it's insecure, but wanted to try) in /etc/crontab
, didn't work.
Any ideas?