Lines 10-28
Link Here
|
10 |
# |
10 |
# |
11 |
# activemq_enable (bool): Set to NO by default. |
11 |
# activemq_enable (bool): Set to NO by default. |
12 |
# Set it to YES to enable activemq. |
12 |
# Set it to YES to enable activemq. |
|
|
13 |
# |
13 |
# activemq_user (username): Set to activemq by default. |
14 |
# activemq_user (username): Set to activemq by default. |
14 |
# Set it to required username. |
15 |
# Set it to required username. |
|
|
16 |
# |
15 |
# activemq_group (group): Set to activemq by default. |
17 |
# activemq_group (group): Set to activemq by default. |
16 |
# Set it to required group. |
18 |
# Set it to required group. |
|
|
19 |
# |
17 |
# activemq_classpath (path): Set to %%DATADIR%% by default. |
20 |
# activemq_classpath (path): Set to %%DATADIR%% by default. |
18 |
# Set it to java classes directory. |
21 |
# Set it to java classes directory. |
|
|
22 |
# |
19 |
# activemq_home (path): Set to %%DATADIR%% by default. |
23 |
# activemq_home (path): Set to %%DATADIR%% by default. |
20 |
# Set it to java home directory. |
24 |
# Set it to java home directory. |
|
|
25 |
# |
21 |
# activemq_javargs (args): Set to -Xmx256M by default. |
26 |
# activemq_javargs (args): Set to -Xmx256M by default. |
22 |
# See java -h for available arguments. |
27 |
# See java -h for available arguments. |
|
|
28 |
# |
23 |
# activemq_stop_timeout (num): Set to "10" by default. |
29 |
# activemq_stop_timeout (num): Set to "10" by default. |
24 |
# Set the timeout in seconds to shutdown. |
30 |
# Set the timeout in seconds to shutdown. |
25 |
# |
31 |
# |
|
|
32 |
# activemq_java_home (path): Set the path to the jvm to use. |
33 |
# Set to openJDK18 by default. |
34 |
# |
35 |
# activemq_debug_precmd (bool): Give java command line that |
36 |
# will be run, when started for debugging outside |
37 |
# of being demonised. Helpful for people new to |
38 |
# activemq. |
39 |
# |
40 |
# activemq_audit_log (bool): Enable audit logging by default. |
41 |
# In production, you will have to evaluate enabling |
42 |
# this option (set to NO to disable), as it has |
43 |
# disk I/O and storage implications which may |
44 |
# impact expected performance. By disabling the |
45 |
# audit log, security logging maybe reduced |
46 |
# depending on your configuration. |
26 |
|
47 |
|
27 |
. /etc/rc.subr |
48 |
. /etc/rc.subr |
28 |
|
49 |
|
Lines 42-65
load_rc_config $name
Link Here
|
42 |
: ${activemq_javargs:='-Xmx512M -Dorg.apache.activemq.UseDedicatedTaskRunner=true -Djava.util.logging.config.file=logging.properties -Dcom.sun.management.jmxremote'} |
63 |
: ${activemq_javargs:='-Xmx512M -Dorg.apache.activemq.UseDedicatedTaskRunner=true -Djava.util.logging.config.file=logging.properties -Dcom.sun.management.jmxremote'} |
43 |
: ${activemq_stop_timeout:="10"} |
64 |
: ${activemq_stop_timeout:="10"} |
44 |
: ${activemq_hostname:=`/bin/hostname`} |
65 |
: ${activemq_hostname:=`/bin/hostname`} |
|
|
66 |
: ${activemq_java_home:='%%LOCALBASE%%/openjdk18/bin/java'} |
67 |
: ${activemq_debug_precmd:=NO} |
68 |
: ${activemq_audit_log:=YES} |
45 |
|
69 |
|
46 |
pidfile=/var/run/${name}.pid |
70 |
pidfile=/var/run/${name}.pid |
47 |
|
71 |
|
48 |
required_files="%%ETCDIR%%/activemq.xml" |
72 |
required_files="%%ETCDIR%%/activemq.xml" |
49 |
jar_file="%%DATADIR%%/bin/activemq.jar" |
73 |
jar_file="%%DATADIR%%/bin/activemq.jar" |
50 |
java_options=" -server -jar ${activemq_javargs} \ |
|
|
51 |
-Dactivemq.classpath=${activemq_classpath} \ |
52 |
-Dactivemq.conf=${activemq_conf} \ |
53 |
-Dactivemq.data=${activemq_data} \ |
54 |
-Dactivemq.logs=${activemq_logs} \ |
55 |
-Dactivemq.home=${activemq_home} \ |
56 |
-Dactivemq.base=${activemq_home} \ |
57 |
-Dactivemq.hostname=${activemq_hostname}" |
58 |
|
74 |
|
59 |
java_command="%%LOCALBASE%%/bin/java ${java_options} ${jar_file}" |
75 |
activemq_audit_args="" |
|
|
76 |
if checkyesno activemq_audit_log; then |
77 |
activemq_audit_args="-Dorg.apache.activemq.audit=true" |
78 |
fi |
79 |
|
80 |
jolokia_conf="file:${activemq_conf}/jolokia-access.xml" |
81 |
|
82 |
java_options="-server -jar ${activemq_javargs} \ |
83 |
-Dactivemq.classpath=${activemq_classpath} \ |
84 |
-Dactivemq.conf=${activemq_conf} \ |
85 |
-Dactivemq.data=${activemq_data} \ |
86 |
-Dactivemq.logs=${activemq_logs} \ |
87 |
-Dactivemq.home=${activemq_home} \ |
88 |
-Dactivemq.base=${activemq_home} \ |
89 |
-Djolokia.conf=${jolokia_conf} \ |
90 |
${activemq_audit_args} \ |
91 |
-Dactivemq.hostname=${activemq_hostname}" |
92 |
|
93 |
java_command="${activemq_java_home} ${java_options} ${jar_file}" |
60 |
|
94 |
|
61 |
command="/usr/sbin/daemon" |
95 |
command="/usr/sbin/daemon" |
62 |
command_args="-f -p ${pidfile} ${java_command} start" |
96 |
command_args="-p ${pidfile} -o ${activemq_logs}/daemon.log ${java_command} start" |
63 |
start_precmd="activemq_precmd" |
97 |
start_precmd="activemq_precmd" |
64 |
status_cmd="activemq_status" |
98 |
status_cmd="activemq_status" |
65 |
stop_cmd="activemq_stop" |
99 |
stop_cmd="activemq_stop" |
Lines 69-74
activemq_precmd() {
Link Here
|
69 |
chown ${activemq_user}:${activemq_group} ${pidfile} |
103 |
chown ${activemq_user}:${activemq_group} ${pidfile} |
70 |
/usr/bin/install -d -m 0750 -o ${activemq_user} -g ${activemq_group} ${activemq_logs} |
104 |
/usr/bin/install -d -m 0750 -o ${activemq_user} -g ${activemq_group} ${activemq_logs} |
71 |
/usr/bin/install -d -m 0750 -o ${activemq_user} -g ${activemq_group} ${activemq_data} |
105 |
/usr/bin/install -d -m 0750 -o ${activemq_user} -g ${activemq_group} ${activemq_data} |
|
|
106 |
if checkyesno activemq_debug_precmd; then |
107 |
echo "Starting with Java command: ${java_command}" |
108 |
fi |
72 |
} |
109 |
} |
73 |
|
110 |
|
74 |
activemq_stop() { |
111 |
activemq_stop() { |
75 |
- |
|
|