If you want to create a Service Daemon for Tomcat then follow the below steps
root@server[#] vi /etc/rc.d/init.d/tomcat
Add the below code
#!/bin/sh
JAVA_HOME=/usr/local/jdk; export JAVA_HOME
TOMCAT_HOME=/usr/local/jakarta/tomcat; export TOMCAT_HOME
$TOMCAT_HOME/bin/catalina.sh $*
Then
root@server[#] chmod 755 /etc/rc.d/init.d/tomcat
That’s all now you can start and stop tomcat as :
To Start Tomcat :
root@server[#] /etc/init.d/tomcat start
To Stop Tomcat :
root@server[#] /etc/init.d/tomcat stop
That’s all you are done.
