Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/etc/init.d/tomcat
#! /bin/sh
# ==================================================================
# ______ __
# /_ __/___ ____ ___ _________ _/ /_
# / / / __ \/ __ `__ \/ ___/ __ `/ __/
# / / / /_/ / / / / / / /__/ /_/ / /_
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/
# Based On:
# http://www.springsource.com/files/uploads/tomcat/tomcatx-performance-tuning.pdf
# http://www.springsource.com/files/u1/PerformanceTuningApacheTomcat-Part2.pdf
# http://www.springsource.com/files/uploads/tomcat/tomcatx-large-scale-deployments.pdf
# ==================================================================
### BEGIN INIT INFO
# Provides: tomcat6
# Required-Start: $network $syslog $remote_fs
# Required-Stop: $network $syslog
# Default-Start:
# Default-Stop:
# Short-Description: Tomcat Server
# Description: Tomcat Server
#
### END INIT INFO
case $1 in
start)
cd /opt/tomcat
su -c "./server.sh start" tomcat
;;
stop)
cd /opt/tomcat
su -c "./server.sh stop" tomcat
;;
restart)
cd /opt/tomcat
su -c "./server.sh stop" tomcat
su -c "./server.sh start" tomcat
;;
esac
exit 0
@terrancesnyder
Copy link
Author

terrancesnyder commented May 27, 2011

Installation

sudo chmod 755 /etc/init.d/tomcat

suse

/sbin/insserv -d tomcat

ubuntu

sudo ln -s /etc/init.d/tomcat /etc/rc1.d/K99tomcat
sudo ln -s /etc/init.d/tomcat /etc/rc2.d/S99tomcat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment