summaryrefslogtreecommitdiffstats
path: root/projectroot/etc/init.d/tomcat
diff options
context:
space:
mode:
Diffstat (limited to 'projectroot/etc/init.d/tomcat')
-rw-r--r--projectroot/etc/init.d/tomcat52
1 files changed, 52 insertions, 0 deletions
diff --git a/projectroot/etc/init.d/tomcat b/projectroot/etc/init.d/tomcat
new file mode 100644
index 000000000..8af34700c
--- /dev/null
+++ b/projectroot/etc/init.d/tomcat
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# This is a tomcat init.d script which is called by init(1) with [start|stop] as argument
+#
+
+ARGS="-classpath /usr/tomcat/bin/bootstrap.jar -Dcatalina.home=/usr/tomcat org.apache.catalina.startup.Bootstrap"
+
+for j in /usr/bin/jamvm /usr/bin/java $JAVA_HOME/bin/java; do
+ if [ -x "$j" ]; then
+ JAVA="$j"
+ break
+ fi
+done
+
+if [ -z "$JAVA" ]; then
+ echo java not found.
+ exit 1
+fi
+
+start_proc(){
+ mkdir -p /tmp/tomcat/temp
+ mkdir -p /tmp/tomcat/work
+ mkdir -p /tmp/tomcat/logs
+
+ $JAVA $ARGS start > /dev/null 2>&1 &
+}
+
+stop_proc(){
+ $JAVA $ARGS stop
+}
+
+
+case "$1" in
+ start)
+ start_proc
+ ;;
+ stop)
+ stop_proc
+ ;;
+ restart)
+ stop_proc
+ start_proc
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ echo ""
+ exit 1
+ ;;
+esac
+
+exit 0
+