Linux tips and tricks for faster and easier administration Linux servers and applications! Troubleshooting and solutions!

Friday, 20 June 2014

How to make startup script for automated tomcat start after reboot on Linux

I you are good system admin then one of first things after installation of some new application is to make that application start after system reboot!
Some application(glassfish, websphere) have mechanism to make startup script during installation but there are application that do not do that!

In case that your developers team create new JAVA application that is running under tomcat, here is how my(and yours) startup script (should)look like

Location of this script should be in /etc/init.d/ folder. You can named it like you want. We can called it tomcat-aps.

Ok, so how to test it if your script is running OK?

First,make it executable!

#chmod +x tomcat-aps

Now, check if there are any java process running or even better go to log folder of your tomcat application. This should be located in /location_of_tomcat/logs and see content of catalina.out file. It is best to tail this file