monit-general
[Top][All Lists]
Advanced

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

Re: Monit - Tomcat failed to start


From: Martin Pala
Subject: Re: Monit - Tomcat failed to start
Date: Tue, 12 Jun 2012 08:02:23 +0200

Hello,

Monit sets spartan environment when execution the program (for security 
reasons):  only "PATH=/bin:/usr/bin:/sbin:/usr/sbin" is set, all other 
variables are dropped.

If you've added the JAVA_HOME and CATALINA_PID to startup.sh, it is likely your 
tomcat startup script depends also on some additional environment variables 
(other then JAVA_HOME and CATALINA_PID).

You can log the start/stop script output by wrapping it for example like this:
--8<--
start program = "/bin/bash -c 
'/home/s398721/apache-tomcat-7.0.27/bin/startup.sh >  /tmp/start.out 2>&1'" 
with uid s398721 gid s398721
--8<--

Regards,
Martin


On Jun 12, 2012, at 12:35 AM, Josh Claros wrote:

> Hello,
> 
> i am running Monit as root Tomcat as user s398721
> 
> on Catalina.sh i set this:
> 
> JAVA_HOME=/usr/java/jdk1.6.0_32
> CATALINA_PID=/home/s398721/apache-tomcat-7.0.27/bin/file.pid
> 
> and monitrc:
> 
>    check process tomcat with pidfile 
> /home/s398721/apache-tomcat-7.0.27/bin/fil
> e.pid
>       start program = "/home/s398721/apache-tomcat-7.0.27/bin/startup.sh"
>        with uid s398721 gid s398721
>        stop program = "/home/s398721/apache-tomcat-7.0.27/bin/shutdown.sh"
>       with uid s398721 gid s398721
>       if failed port 8080 and protocol http then start
>       if failed port 8080 then alert
> 
> when tomcat goes down i get this error when it tries to restart it:
> 
> 
> PDT Jun 11 06:08:46] error    : 'tomcat' process is not running
> [PDT Jun 11 06:08:48] info     : 'tomcat' trying to restart
> [PDT Jun 11 06:08:48] info     : 'tomcat' start:
> /home/s398721/apache-tomcat-7.0.27/bin/startup.sh
> [PDT Jun 11 06:09:18] error    : 'tomcat' failed to start
> 
> 
> AM I MISSING SOMETHING??? i tried setting the JAVA_HOME on the
> startup.sh script as well.
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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