blob: dcc46e56a21c5ef27556b68b7d8d90b1b08f62b9 (
plain) (
blame)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: jakarta-tomcat%%TOMCAT_VERSION%%
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: FreeBSD shutdown
#
# Configuration settings for jakarta-tomcat%%TOMCAT_VERSION%% in /etc/rc.conf:
#
# jakarta_tomcat%%TOMCAT_VERSION%%_enable (bool):
# Set to "NO" by default.
# Set it to "YES" to enable jakarta-tomcat%%TOMCAT_VERSION%%
#
# jakarta_tomcat%%TOMCAT_VERSION%%_flags (str):
# Set to "" by default.
# Extra flags passed to start command
#
# jakarta_tomcat%%TOMCAT_VERSION%%_catalina_home (str)
# Set to "%%TOMCAT_HOME%%" by default.
# Set the CATALINA_HOME variable for the Tomcat process
#
# jakarta_tomcat%%TOMCAT_VERSION%%_catalina_base (str)
# Set to "%%TOMCAT_HOME%%" by default.
# Set the CATALINA_BASE variable for the Tomcat process
#
# jakarta_tomcat%%TOMCAT_VERSION%%_catalina_tmpdir (str)
# Set to "%%TOMCAT_HOME%%/temp" by default.
# Set the CATALINA_TMPDIR variable for the Tomcat process
#
# jakarta_tomcat%%TOMCAT_VERSION%%_stdout_log (str)
# Set to "%%STDOUT_LOG%%" by default.
# Set the location for the Tomcat process log (standard output)
#
# jakarta_tomcat%%TOMCAT_VERSION%%_stderr_log (str)
# Set to "%%STDERR_LOG%%" by default.
# Set the location for the Tomcat process log (error output)
#
# jakarta_tomcat%%TOMCAT_VERSION%%_java_home (str):
# jakarta_tomcat%%TOMCAT_VERSION%%_java_vendor (str):
# jakarta_tomcat%%TOMCAT_VERSION%%_java_version (str):
# jakarta_tomcat%%TOMCAT_VERSION%%_java_os (str):
# Specify the requirements of the Java VM to use. See javavm(1).
#
# jakarta_tomcat%%TOMCAT_VERSION%%_classpath (str):
# Set to "" by default.
# Addtional classes to add to the CLASSPATH
#
# jakarta_tomcat%%TOMCAT_VERSION%%_java_opts (str):
# Set to "" by default.
# Java VM args to use.
#
jakarta_tomcat%%TOMCAT_VERSION%%_enable="${jakarta_tomcat%%TOMCAT_VERSION%%_enable:-"NO"}"
jakarta_tomcat%%TOMCAT_VERSION%%_java_version="${jakarta_tomcat%%TOMCAT_VERSION%%_java_version:-"%%JAVA_VERSION%%"}"
jakarta_tomcat%%TOMCAT_VERSION%%_user="${jakarta_tomcat%%TOMCAT_VERSION%%_user:-"%%USER%%"}"
jakarta_tomcat%%TOMCAT_VERSION%%_catalina_home="${jakarta_tomcat%%TOMCAT_VERSION%%_catalina_home:-"%%TOMCAT_HOME%%"}"
jakarta_tomcat%%TOMCAT_VERSION%%_catalina_base="${jakarta_tomcat%%TOMCAT_VERSION%%_catalina_base:-"%%TOMCAT_HOME%%"}"
jakarta_tomcat%%TOMCAT_VERSION%%_catalina_tmpdir="${jakarta_tomcat%%TOMCAT_VERSION%%_catalina_tmpdir:-"%%TOMCAT_HOME%%/temp"}"
jakarta_tomcat%%TOMCAT_VERSION%%_stdout_log="${jakarta_tomcat%%TOMCAT_VERSION%%_stdout_log:-"%%STDOUT_LOG%%"}"
jakarta_tomcat%%TOMCAT_VERSION%%_stderr_log="${jakarta_tomcat%%TOMCAT_VERSION%%_stderr_log:-"%%STDERR_LOG%%"}"
. %%RC_SUBR%%
name="jakarta_tomcat%%TOMCAT_VERSION%%"
rcvar=`set_rcvar`
if [ -n "${jakarta_tomcat%%TOMCAT_VERSION%%_java_home}" ] ; then
export JAVA_HOME="${jakarta_tomcat%%TOMCAT_VERSION%%_java_home}"
fi
if [ -n "${jakarta_tomcat%%TOMCAT_VERSION%%_java_version}" ] ; then
export JAVA_VERSION="${jakarta_tomcat%%TOMCAT_VERSION%%_java_version}"
fi
if [ -n "${jakarta_tomcat%%TOMCAT_VERSION%%_java_vendor}" ] ; then
export JAVA_VENDOR="${jakarta_tomcat%%TOMCAT_VERSION%%_java_vendor}"
fi
if [ -n "${jakarta_tomcat%%TOMCAT_VERSION%%_java_os}" ] ; then
export JAVA_OS="${jakarta_tomcat%%TOMCAT_VERSION%%_java_os}"
fi
java_command="%%LOCALBASE%%/bin/java \
${jakarta_tomcat%%TOMCAT_VERSION%%_java_opts} \
-Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS \
-classpath %%TOMCAT_HOME%%/bin/bootstrap.jar:%%TOMCAT_HOME%%/bin/commons-logging-api.jar:${jakarta_tomcat%%TOMCAT_VERSION%%_classpath} \
-Dcatalina.base=${jakarta_tomcat%%TOMCAT_VERSION%%_catalina_base} \
-Dcatalina.home=${jakarta_tomcat%%TOMCAT_VERSION%%_catalina_home} \
-Djava.io.tmpdir=${jakarta_tomcat%%TOMCAT_VERSION%%_catalina_tmpdir} \
org.apache.catalina.startup.Bootstrap"
log_args=">> ${jakarta_tomcat%%TOMCAT_VERSION%%_stdout_log} \
2>> ${jakarta_tomcat%%TOMCAT_VERSION%%_stderr_log} "
procname="java"
required_files="${jakarta_tomcat%%TOMCAT_VERSION%%_catalina_home}/conf/server.xml"
command="/usr/sbin/daemon"
flags="${command} ${java_command} start ${jakarta_tomcat%%TOMCAT_VERSION%%_flags} ${log_args}"
stop_cmd="jakarta_tomcat%%TOMCAT_VERSION%%_stop"
jakarta_tomcat%%TOMCAT_VERSION%%_stop() {
echo "Stopping ${name}."
${java_command} stop
wait_for_pids
}
load_rc_config "${name}"
run_rc_command "$1"
|