Lines 61-104
Link Here
|
61 |
: ${graylog_dir:="%%DATADIR%%"} |
61 |
: ${graylog_dir:="%%DATADIR%%"} |
62 |
: ${graylog_data_dir:="%%GRAYLOG_DATA_DIR%%"} |
62 |
: ${graylog_data_dir:="%%GRAYLOG_DATA_DIR%%"} |
63 |
: ${graylog_run_dir:="/var/run/graylog"} |
63 |
: ${graylog_run_dir:="/var/run/graylog"} |
64 |
: ${graylog_log_file:="/var/log/graylog-server.log"} |
64 |
: ${graylog_log_file:="/var/log/graylog/server.log"} |
65 |
|
65 |
|
|
|
66 |
java_options=" \ |
67 |
-Djava.awt.headless=true \ |
68 |
-Djava.net.preferIPv4Stack=true \ |
69 |
-Dapp=${name} \ |
70 |
-Dlog4j.configurationFile=${graylog_log_file} \ |
71 |
-Xms${graylog_min_mem} \ |
72 |
-Xmx${graylog_max_mem} \ |
73 |
-XX:-OmitStackTraceInFastThrow \ |
74 |
-XX:+AggressiveOpts \ |
75 |
-XX:+CMSClassUnloadingEnabled \ |
76 |
-XX:+CMSConcurrentMTEnabled \ |
77 |
-XX:+CMSParallelRemarkEnabled \ |
78 |
-XX:+DisableExplicitGC \ |
79 |
-XX:+HeapDumpOnOutOfMemoryError \ |
80 |
-XX:+ResizeTLAB \ |
81 |
-XX:+UseCMSInitiatingOccupancyOnly \ |
82 |
-XX:+UseCompressedOops \ |
83 |
-XX:+UseConcMarkSweepGC \ |
84 |
-XX:+UseFastAccessorMethods \ |
85 |
-XX:+UseParNewGC \ |
86 |
-XX:CMSInitiatingOccupancyFraction=75 \ |
87 |
-XX:NewRatio=1 \ |
88 |
" |
66 |
|
89 |
|
67 |
java_options=" -Xms${graylog_min_mem} \ |
90 |
app_pidfile="${graylog_run_dir}/${name}.pid" |
68 |
-Xmx${graylog_max_mem} \ |
91 |
pidfile="${graylog_run_dir}/daemon.pid" |
69 |
-XX:NewRatio=1 \ |
92 |
command="/usr/sbin/daemon" |
70 |
-XX:+ResizeTLAB \ |
|
|
71 |
-XX:+UseConcMarkSweepGC \ |
72 |
-XX:+CMSConcurrentMTEnabled \ |
73 |
-XX:+CMSClassUnloadingEnabled \ |
74 |
-XX:+UseParNewGC \ |
75 |
-XX:-OmitStackTraceInFastThrow" |
76 |
|
93 |
|
77 |
start_precmd="graylog_precmd" |
94 |
command_args=" \ |
|
|
95 |
-c \ |
96 |
-t ${name} \ |
97 |
-r \ |
98 |
-p ${app_pidfile} \ |
99 |
-P ${pidfile} \ |
100 |
%%LOCALBASE%%/bin/java \ |
101 |
${java_options} \ |
102 |
-jar ${graylog_dir}/graylog.jar server \ |
103 |
--configfile ${graylog_config}" |
78 |
|
104 |
|
79 |
pidfile="${graylog_run_dir}/${name}.pid" |
105 |
required_files="%%LOCALBASE%%/bin/java ${graylog_config}" |
80 |
command=/usr/bin/nohup |
|
|
81 |
|
106 |
|
82 |
command_args="%%LOCALBASE%%/bin/java -jar ${graylog_dir}/graylog.jar server \ |
|
|
83 |
--configfile \"${graylog_config}\" \ |
84 |
--pidfile \"${pidfile}\" \ |
85 |
>> \"${graylog_log_file}\" \ |
86 |
2>> \"${graylog_log_file}\" &" |
87 |
|
88 |
graylog_precmd() { |
107 |
graylog_precmd() { |
89 |
if [ ! -f "${graylog_config}" ]; then |
|
|
90 |
echo "Configuration file ${graylog_config} not found" |
91 |
exit 1 |
92 |
fi |
93 |
|
94 |
if [ ! -f "${graylog_log_file}" ]; then |
95 |
touch "${graylog_log_file}" |
96 |
chown "${graylog_user}:${graylog_group}" "${graylog_log_file}" |
97 |
chmod 640 "${graylog_log_file}" |
98 |
fi |
99 |
|
100 |
install -d -o ${graylog_user} -g ${graylog_group} -m 750 "${graylog_data_dir}" |
108 |
install -d -o ${graylog_user} -g ${graylog_group} -m 750 "${graylog_data_dir}" |
101 |
install -d -o ${graylog_user} -g ${graylog_group} -m 750 "${graylog_run_dir}" |
109 |
install -d -o ${graylog_user} -g ${graylog_group} -m 750 "${graylog_run_dir}" |
102 |
} |
110 |
} |
103 |
|
111 |
|
|
|
112 |
start_precmd="graylog_precmd" |
113 |
|
104 |
run_rc_command "$1" |
114 |
run_rc_command "$1" |