Skip to content

Instantly share code, notes, and snippets.

@terrancesnyder
Created May 23, 2011 00:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save terrancesnyder/986036 to your computer and use it in GitHub Desktop.
Save terrancesnyder/986036 to your computer and use it in GitHub Desktop.
/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

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