-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtomcat7
executable file
·85 lines (77 loc) · 1.54 KB
/
tomcat7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
#
# chkconfig: - 80 20
# description: catalina-daemon
# Source function library.
. /etc/rc.d/init.d/functions
#export JAVA_HOME=/usr/java/default
export CATALINA_HOME=/opt/tomcat
export CATALINA_OPTS="-Xms512m -Xmx768m -XX:PermSize=128m -XX:MaxPermSize=128m"
export TOMCAT_USER=tomcat
export CATALINA_PID=$CATALINA_HOME/logs/catalina-daemon.pid
export CATALINA_OUT="$CATALINA_HOME/logs/catalina-daemon.out"
export CATALINA_TMP="$CATALINA_HOME/temp"
tomcat=$CATALINA_HOME/bin/catalina.sh
prog=tomcat
lockfile=${LOCKFILE-/var/lock/subsys/tomcat}
RETVAL=0
start() {
echo -n $"Starting $prog: "
$tomcat start
RETVAL=$?
if [ $RETVAL = 0 ]; then
echo_success
touch ${lockfile}
else
echo_failure
fi
echo
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
$tomcat stop
RETVAL=$?
if [ $RETVAL = 0 ]; then
echo_success
rm -f ${lockfile} ${CATALINA_PID}
else
echo_failure
fi
echo
return $RETVAL
}
version() {
$tomcat version
RETVAL=$?
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
condrestart)
if [ -f ${CATALINA_PID} ] ; then
stop
start
fi
;;
status)
status -p ${CATALINA_PID} $prog
RETVAL=$?
;;
version)
version
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|status|version}"
exit 1
esac
exit $RETVAL