Lines 34-50
Link Here
|
34 |
# Default value: %%GRAYLOG_DIR%% |
34 |
# Default value: %%GRAYLOG_DIR%% |
35 |
# Path the the graylog installation. |
35 |
# Path the the graylog installation. |
36 |
# |
36 |
# |
|
|
37 |
# graylog_data_dir (string): |
38 |
# Default vaule: %%GRAYLOG_DATA_DIR%% |
39 |
# Storage location for the graylog journal |
40 |
# |
37 |
# graylog_run_dir (string): |
41 |
# graylog_run_dir (string): |
38 |
# Default value: /var/graylog |
42 |
# Default value: /var/graylog |
39 |
# Path the the graylog run folder. |
43 |
# Path the the graylog run folder. |
40 |
# |
44 |
# |
41 |
# graylog_java_home (string): |
45 |
# graylog_log_file (string): |
42 |
# Default value: %%JAVA_HOME%% |
46 |
# Default value: /var/log/graylog-server.conf |
43 |
# Root directory of the desired Java SDK. |
47 |
# Path for the Graylog Server logfile |
44 |
# |
|
|
45 |
# graylog_log4j_config (string): |
46 |
# Default value: file://%%ETCDIR%%/graylog_logging.xml |
47 |
# Path to the log4j configuration file for graylog |
48 |
|
48 |
|
49 |
. /etc/rc.subr |
49 |
. /etc/rc.subr |
50 |
|
50 |
|
Lines 55-67
Link Here
|
55 |
: ${graylog_enable:="NO"} |
55 |
: ${graylog_enable:="NO"} |
56 |
: ${graylog_user:="%%GRAYLOGUSER%%"} |
56 |
: ${graylog_user:="%%GRAYLOGUSER%%"} |
57 |
: ${graylog_group:="%%GRAYLOGGROUP%%"} |
57 |
: ${graylog_group:="%%GRAYLOGGROUP%%"} |
58 |
: ${graylog_config:="%%ETCDIR%%/${name}.conf"} |
58 |
: ${graylog_config:="%%ETCDIR%%/server/server.conf"} |
59 |
: ${graylog_min_mem:="256m"} |
59 |
: ${graylog_min_mem:="256m"} |
60 |
: ${graylog_max_mem:="1g"} |
60 |
: ${graylog_max_mem:="1g"} |
61 |
: ${graylog_dir:="%%GRAYLOG_DIR%%"} |
61 |
: ${graylog_dir:="%%GRAYLOG_DIR%%"} |
62 |
: ${graylog_run_dir:="/var/graylog"} |
62 |
: ${graylog_data_dir:="%%GRAYLOG_DATA_DIR%%"} |
63 |
: ${graylog_java_home:="%%JAVA_HOME%%"} |
63 |
: ${graylog_run_dir:="/var/run/graylog"} |
64 |
: ${graylog_log4j_config="file://%%ETCDIR%%/graylog_logging.xml"} |
64 |
: ${graylog_log_file:="/var/log/graylog-server.log"} |
65 |
|
65 |
|
66 |
|
66 |
|
67 |
java_options=" -Xms${graylog_min_mem} \ |
67 |
java_options=" -Xms${graylog_min_mem} \ |
Lines 72-96
Link Here
|
72 |
-XX:+CMSConcurrentMTEnabled \ |
72 |
-XX:+CMSConcurrentMTEnabled \ |
73 |
-XX:+CMSClassUnloadingEnabled \ |
73 |
-XX:+CMSClassUnloadingEnabled \ |
74 |
-XX:+UseParNewGC \ |
74 |
-XX:+UseParNewGC \ |
75 |
-XX:-OmitStackTraceInFastThrow\ |
75 |
-XX:-OmitStackTraceInFastThrow" |
76 |
-Djava.library.path=${graylog_dir}/lib/sigar \ |
|
|
77 |
-Dlog4j.configuration=${graylog_log4j_config}" |
78 |
|
76 |
|
79 |
start_precmd="graylog_precmd" |
77 |
start_precmd="graylog_precmd" |
80 |
|
78 |
|
81 |
pidfile=/var/run/${name}.pid |
79 |
pidfile="${graylog_run_dir}/${name}.pid" |
82 |
command=/usr/sbin/daemon |
80 |
command=/usr/bin/nohup |
83 |
procname=`env JAVAVM_DRYRUN=true JAVA_VERSION=1.7+ %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -f 2 -d =` |
|
|
84 |
|
81 |
|
85 |
command_args="-p $pidfile -f /usr/local/bin/java ${java_options} -jar ${graylog_dir}/graylog.jar server --configfile ${graylog_config} --no-pid-file" |
82 |
command_args="java -jar /usr/local/graylog/graylog.jar server \ |
|
|
83 |
--configfile \"${graylog_config}\" \ |
84 |
--pidfile \"${pidfile}\" \ |
85 |
>> \"${graylog_log_file}\" \ |
86 |
2>> \"${graylog_log_file}\" &" |
86 |
|
87 |
|
87 |
graylog_precmd() { |
88 |
graylog_precmd() { |
88 |
/usr/bin/install -d -o ${graylog_group} -g ${graylog_group} -m 755 /var/log/graylog |
89 |
if [ ! -f "${graylog_config}" ]; then |
89 |
/usr/bin/install -d -o ${graylog_group} -g ${graylog_group} -m 755 /var/log/graylog/server |
90 |
echo "Configuration file ${graylog_config} not found" |
90 |
/usr/bin/install -d -o ${graylog_group} -g ${graylog_group} -m 755 ${graylog_run_dir} |
91 |
exit 1 |
91 |
touch $pidfile |
92 |
fi |
92 |
chown ${graylog_user}:${graylog_group} ${pidfile} |
93 |
|
93 |
cd ${graylog_run_dir} |
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}" |
101 |
install -d -o ${graylog_user} -g ${graylog_group} -m 750 "${graylog_run_dir}" |
94 |
} |
102 |
} |
95 |
|
103 |
|
96 |
run_rc_command "$1" |
104 |
run_rc_command "$1" |