#!/bin/sh
# chkconfig: 2345 10 90
# description: Start and Stop redis
# Simple Redis init.d script conceived to work on Linux systems
# as it does use of the /proc filesystem.
export CATALINA_HOME=/opt/tomcat8/
case "$1" in
start)
${CATALINA_HOME}/bin/startup.sh
exit 0
;;
stop)
${CATALINA_HOME}/bin/shutdown.sh
exit 0
;;
debug)
${CATALINA_HOME}/bin/shutdown.sh
${CATALINA_HOME}/bin/catalina.sh run
exit 0
;;
force-reload|restart)
${CATALINA_HOME}/bin/startup.sh
${CATALINA_HOME}/bin/shutdown.sh
exit 0
;;
*)
echo "Usage: /etc/init.d/tomcat {start|stop|restart|force-reload|debug}"
exit 1
;;
esac
exit 0
cp tomcat /etc/init.d/tomcat
chmod 777 /etc/init.d/tomcat
echo "service tomcat start" >> /etc/rc.d/rc.local
chkconfig --add tomcat
chkconfig tomcat on
chkconfig --list
chmod +x /etc/rc.d/rc.local