monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: monit unable to start Tomcat


From: Ramesh B
Subject: Re: monit unable to start Tomcat
Date: Fri, 3 Aug 2007 07:08:39 -0700 (PDT)

Thank you Martin. Your idea sparked some thought and eventually lead to the
fix.

All Tomcat needs for starting is JAVA_HOME environment variable. Here is a
snippet from /etc/init.d/tomcat

export JAVA_HOME=/appl/java

start() {
        echo -n $"Starting Tomcat Java server: "
        daemon su -c /appl/tomcat/bin/startup.sh dmsadm
        echo
        return $RETVAL
}

Though JAVA_HOME is set and defined in this file monit was unable to start
tomcat. (I still don't know why).

I wanted to try calling tomcat startup script directly from monit. so I've
added the following line to /appl/tomcat/startup.sh

export JAVA_HOME=/appl/java

Next change I made was to monitrc, where I've replaced 

# Tomcat
check process tomcat with pidfile "/var/run/tomcat.pid"
       start program = "/etc/init.d/tomcat start"
       stop program  = "/etc/init.d/tomcat stop"
       if failed port 8080 then alert

with 

# Tomcat
check process tomcat with pidfile "/var/run/tomcat.pid"
       start program = "/appl/tomcat/bin/startup.sh"
         as uid 528 gid 528
       stop program = "/appl/tomcat/bin/shutdown.sh"
         as uid 528 gid 528
       if failed port 8080 then alert

With these changes monit is now able to start, stop, restart tomcat without
any issues.
-- 
View this message in context: 
http://www.nabble.com/monit-unable-to-start-Tomcat-tf4208803.html#a11984053
Sent from the monit-general mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]