[Top][All Lists]

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

monit with tomcat, PID problem

From: Ugo Bellavance
Subject: monit with tomcat, PID problem
Date: Thu, 29 Apr 2004 11:45:26 -0400


        I'm tring to monitor tomcat 4 with monit.  I'm using the binary 4.1.30 
distribution, with mod_jk2 to connect through apache.

The problem is that even if I have

echo $$ > /var/run/

in my startup script, the PID that is in /var/run/ is not the same as 
the one in ps, after launching tomcat.  This has probably something to do with 
the fact that tomcat spawns many childs at startup.

I ended up writing this line to put the correct pid in the .pid file: ps -ef | 
grep tomcat | awk '{print $2}'| sed 2,\$d > /var/run/

I guess I could run that in a cron job, but I think it is a hideous kludge and 
I don't like it much.

I ended up writing a script that restarts tomcat, then waits, then restarts 
httpd, whenever I don't get a connection on the port 8080.

Anyone had a better experience than me with that?

Ugo Bellavance
Camo-Route Inc.

reply via email to

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