Dirtbag's Blog

Getting Apache Tomcat 5.5.X to start/stop correctly

[ link: tomcat_start_stop | tags: linux apache tomcat | updated: Fri, 17 Apr 2020 12:12:08 -0400 ]

I just installed apache-tomcat-5.5.25 on a redhat linux box from source with all the default settings, the tomcat server will start via the init script, but it will not shutdown for me.

So tomcat will start fine, and is listening on tcp port 8080, but when I run


/etc/init.d/tomcat stop

it seems to go through the motions, but I can see via netstat and ps that the server is still running. WTF?

so I did some digging into the start scrips and I see that in my /tomcat/bin/shutdown.sh script, there is


exec "$PRGDIR"/"$EXECUTABLE" stop "$@"

I changed this to be


exec "$PRGDIR"/"$EXECUTABLE" stop -force "$@"

which will force the script to issue a KILL signal to the process after the stop. Stop Catalina (followed by kill -KILL)"

so I tried that, and then it tells me:


"Kill failed: \$CATALINA_PID not set"

so then in the "/tomcat/bin/catalina.sh" file, I added the following near the top after all the comments:


CATALINA_PID="/var/run/tomcat.pid"

Now that pesky tomcat will stop when I tell that bitch to stop!

-db

Like this article? Buy me a beer!