Script tomcat.sh
Jump to navigation
Jump to search
#!/bin/sh ### BEGIN INIT INFO # Provides: tomcat_server # Required-Start: $network # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start and stop tomcat_server ### END INIT INFO PATH="/sbin:/bin:/usr/sbin:/usr/bin"; COMMAND="/bin/su"; ARG_START="CATALINA_HOME=/srv/local/tomcat JAVA_HOME=/usr/lib/jvm/java-6-openjdk /srv/local/tomcat/bin/startup.sh;" ARG_STOP="CATALINA_HOME=/srv/local/tomcat JAVA_HOME=/usr/lib/jvm/java-6-openjdk /srv/local/tomcat/bin/shutdown.sh;" case "$1" in start) $COMMAND -c "${ARG_START}" tomcat; ;; restart|reload|force-reload) echo "Error: argument '$1' not supported" >&2; exit 3; ;; stop) $COMMAND -c "${ARG_STOP}" tomcat; ;; *) echo "Usage: {command} [start|stop]" >&2; exit 3; ;; esac # End