

Tomcat server is properly running by using the port 8080: netstat -an | grep 8080 However, some inner conflicts stops this! Through above logs, I found Monit is trying to start tomcat automatically for every particular time (when it finds tomcat service was killed). info : 'tomcat' start: /etc/init.d/tomcat On investigating the Monit logs I found the following message: error : 'tomcat' failed, cannot open a connection to INET via TCP However, I was unable to start tomcat successfully (when its killed). Start program = "/etc/init.d/tomcat start" Configured this as my daemon service (and my tomcat server works properly).Īs I don't have pid file for this tomcat setup, I am planning to check tomcat's status and start it using the following code: #Check and restart tomcat service Downloaded the tomcat zip and extracted to a particular location I have actually configured tomcat as follows: The above code works perfectly and Monit restarts MySQL service (when its killed/stopped). If 5 restarts within 5 cycles then timeout

If failed host 127.0.0.1 port 3306 protocol mysql then restart

Start program = "/etc/init.d/mysql start" #Check and restart mysql serviceĬheck process mysqld with pidfile "/run/mysqld/mysqld.pid" My main goal in using Monit is to restart my - MySQL and Apache tomcat services automatically when they are killed/stopped. I have installed Monit using the following command in Ubuntu Linux 12.04.1 server sudo apt-get install monit
