1

I tried to configure supervisord as watchdog for tomcat, redis and some other services. The goal is to automatic restart if the services are crashed or stopped.

Here is my configuration for redis and tomat

[program:redis]
command=sudo /etc/init.d/redis-server start
autostart=true
autorestart=true
stderr_logfile=/var/log/supervisour_redis.err.log
stdout_logfile=/var/log/supervisour_redis.out.log
logfile_maxbytes=10MB

[program:tomcat]
command=sudo /root/apache-tomcat-7.0.75/bin/startup.sh
autostart=true
autorestart=true
stderr_logfile=/var/log/supervisour_tomcat.err.log
stdout_logfile=/var/log/supervisour_tomcat.out.log
logfile_maxbytes=10MB

But I'm not able to control the services completely. After restart of supervisor, I see

root@test:~/apache-tomcat-7.0.75/bin# supervisorctl 
redis                            BACKOFF    Exited too quickly (process log may have details)
tomcat                           BACKOFF    Exited too quickly (process log may have details) 

If I start tomcat with supervisor, it is showing error

supervisor> start tomcat
tomcat: ERROR (abnormal termination)

but the tomcat is starting(I have chacked with ps aux | grep tomcat). But I'm not able to STOP the tomcat. In redis case, supervisor says the service is stopped, but it not!

  • supervisord is designed to start a process that stays in the foreground - your calling the init script, which doesnt stay in the foreground, it backgrounds the java process and terminates, hence the abnormal termination. you need to have supervisord run what the init script runs. – keen Jul 10 '17 at 23:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.