5

I have the following in my supervisord.conf:

[program:cron]
command=service cron start
autostart=true
autorestart=false
stderr_logfile=/var/log/cron.err.log
stdout_logfile=/var/log/cron.out.log

Seems like it's failing?:

root@srv:/# supervisorctl
cron                             FATAL     Exited too quickly (process log may have details)

However it's running:

root@srv:/# ps aux | grep cron
root        52  0.0  0.1  26068  2464 ?        Ss   13:07   0:00 /usr/sbin/cron
root      3053  0.0  0.0  11284   936 ?        S+   13:08   0:00 grep --color=auto cron

Am I starting cron correctly with supervisor?

2 Answers 2

7

Possible to run cron in foreground?

command=service cron start

Should be instead:

command=cron -f
1

With supervisor the program you want to run, needs to stay on the foreground. You start cron as a service, so the program exits, and supervisor sees it as it stopped.

1
  • Ah makes sense. How do I fix so that cron is in the foreground? Commented Apr 21, 2017 at 13:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .