aboutsummaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorPalle Girgensohn <girgen@FreeBSD.org>2017-05-31 17:31:52 +0000
committerPalle Girgensohn <girgen@FreeBSD.org>2017-05-31 17:31:52 +0000
commita5d6040a5c8c58fafc5c4b14edc0080e388c9625 (patch)
treece2289d62881106eb5fee10ad30dc761c4ad868a /sysutils
parent3f19a12307841c5242c25755ad5860f06c10c4de (diff)
downloadports-a5d6040a5c8c58fafc5c4b14edc0080e388c9625.tar.gz
ports-a5d6040a5c8c58fafc5c4b14edc0080e388c9625.zip
Notes
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/graylog/Makefile13
-rw-r--r--sysutils/graylog/distinfo6
-rw-r--r--sysutils/graylog/files/graylog.in77
-rw-r--r--sysutils/graylog/files/log4j2.xml.in43
-rw-r--r--sysutils/graylog/files/pkg-message.in12
-rw-r--r--sysutils/graylog/files/server.conf.in (renamed from sysutils/graylog/files/server.conf.sample.in)0
-rw-r--r--sysutils/graylog/pkg-plist2
7 files changed, 111 insertions, 42 deletions
diff --git a/sysutils/graylog/Makefile b/sysutils/graylog/Makefile
index 671f39e329ac..9b500e45ae1b 100644
--- a/sysutils/graylog/Makefile
+++ b/sysutils/graylog/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= graylog
-PORTVERSION= 2.2.2
+PORTVERSION= 2.2.3
CATEGORIES= sysutils java
MASTER_SITES= https://packages.graylog2.org/releases/graylog/ \
http://packages.graylog2.org/releases/graylog/
@@ -14,26 +14,29 @@ LICENSE= GPLv3+
USES= tar:tgz
USE_JAVA= yes
-JAVA_VERSION= 1.7+
+JAVA_VERSION= 1.8+
JAVA_EXTRACT= yes
NO_ARCH= yes
JAVA_RUN= yes
NO_BUILD= yes
USE_RC_SUBR= graylog
-SUB_FILES= server.conf.sample pkg-message
+SUB_FILES= server.conf log4j2.xml pkg-message
GRAYLOGUSER?= graylog
GRAYLOGGROUP?= ${GRAYLOGUSER}
USERS= ${GRAYLOGUSER}
GROUPS= ${GRAYLOGGROUP}
GRAYLOG_DATA_DIR= /var/db/graylog
+GRAYLOG_LOGS_DIR= /var/log/graylog
SUB_LIST= GRAYLOGUSER=${GRAYLOGUSER} \
GRAYLOGGROUP=${GRAYLOGGROUP} \
+ GRAYLOG_LOGS_DIR=${GRAYLOG_LOGS_DIR} \
GRAYLOG_DATA_DIR=${GRAYLOG_DATA_DIR}
PLIST_SUB= GRAYLOG_DATA_DIR=${GRAYLOG_DATA_DIR} \
+ GRAYLOG_LOGS_DIR=${GRAYLOG_LOGS_DIR} \
GRAYLOGUSER=${GRAYLOGUSER} \
GRAYLOGGROUP=${GRAYLOGGROUP} \
PORTVERSION=${PORTVERSION}
@@ -42,8 +45,10 @@ do-install:
${MKDIR} ${STAGEDIR}${DATADIR}/plugin
${MKDIR} ${STAGEDIR}${ETCDIR}/server
${MKDIR} ${STAGEDIR}${GRAYLOG_DATA_DIR}
+ ${MKDIR} ${STAGEDIR}${GRAYLOG_LOGS_DIR}
${INSTALL_DATA} ${WRKSRC}/graylog.jar ${STAGEDIR}${DATADIR}
(cd ${WRKSRC}/plugin && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/plugin)
- ${INSTALL_DATA} ${WRKDIR}/server.conf.sample ${STAGEDIR}${ETCDIR}/server/server.conf.sample
+ ${INSTALL_DATA} ${WRKDIR}/server.conf ${STAGEDIR}${ETCDIR}/server/server.conf.sample
+ ${INSTALL_DATA} ${WRKDIR}/log4j2.xml ${STAGEDIR}${ETCDIR}/server/log4j2.xml.sample
.include <bsd.port.mk>
diff --git a/sysutils/graylog/distinfo b/sysutils/graylog/distinfo
index 1dcf1318e9ae..095eb239fdc9 100644
--- a/sysutils/graylog/distinfo
+++ b/sysutils/graylog/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1488634660
-SHA256 (graylog-2.2.2.tgz) = 46f419d422f6e5816b29333c8510524f1bbc910d6bf00136adb3899a985fceb4
-SIZE (graylog-2.2.2.tgz) = 99956086
+TIMESTAMP = 1492723318
+SHA256 (graylog-2.2.3.tgz) = 3de01e7cb8ebc02a7f06cec1c88eded3b717762447bf1b56bff8744f7f5ea80b
+SIZE (graylog-2.2.3.tgz) = 99971278
diff --git a/sysutils/graylog/files/graylog.in b/sysutils/graylog/files/graylog.in
index e9ab56b9d115..1c740d1d86e6 100644
--- a/sysutils/graylog/files/graylog.in
+++ b/sysutils/graylog/files/graylog.in
@@ -42,8 +42,8 @@
# Default value: /var/graylog
# Path to the graylog run folder.
#
-# graylog_log_file (string):
-# Default value: /var/log/graylog-server.log
+# graylog_log_config (string):
+# Default value: %%ETCDIR%%/server/log4j2.xml
# Path to the Graylog Server logfile
. /etc/rc.subr
@@ -60,45 +60,58 @@ load_rc_config $name
: ${graylog_max_mem:="1g"}
: ${graylog_dir:="%%DATADIR%%"}
: ${graylog_data_dir:="%%GRAYLOG_DATA_DIR%%"}
+: ${graylog_logs_dir:="%%GRAYLOG_LOGS_DIR%%"}
: ${graylog_run_dir:="/var/run/graylog"}
-: ${graylog_log_file:="/var/log/graylog-server.log"}
+: ${graylog_log_config:="%%ETCDIR%%/server/log4j2.xml"}
+java_options=" \
+ -Djava.awt.headless=true \
+ -Djava.net.preferIPv4Stack=true \
+ -Dapp=${name} \
+ -Dlog4j.configurationFile=${graylog_log_config} \
+ -Xms${graylog_min_mem} \
+ -Xmx${graylog_max_mem} \
+ -XX:-OmitStackTraceInFastThrow \
+ -XX:+AggressiveOpts \
+ -XX:+CMSClassUnloadingEnabled \
+ -XX:+CMSConcurrentMTEnabled \
+ -XX:+CMSParallelRemarkEnabled \
+ -XX:+DisableExplicitGC \
+ -XX:+HeapDumpOnOutOfMemoryError \
+ -XX:+ResizeTLAB \
+ -XX:+UseCMSInitiatingOccupancyOnly \
+ -XX:+UseCompressedOops \
+ -XX:+UseConcMarkSweepGC \
+ -XX:+UseFastAccessorMethods \
+ -XX:+UseParNewGC \
+ -XX:CMSInitiatingOccupancyFraction=75 \
+ -XX:NewRatio=1 \
+ "
-java_options=" -Xms${graylog_min_mem} \
- -Xmx${graylog_max_mem} \
- -XX:NewRatio=1 \
- -XX:+ResizeTLAB \
- -XX:+UseConcMarkSweepGC \
- -XX:+CMSConcurrentMTEnabled \
- -XX:+CMSClassUnloadingEnabled \
- -XX:+UseParNewGC \
- -XX:-OmitStackTraceInFastThrow"
+app_pidfile="${graylog_run_dir}/${name}.pid"
+pidfile="${graylog_run_dir}/daemon.pid"
+command="/usr/sbin/daemon"
-start_precmd="graylog_precmd"
-
-pidfile="${graylog_run_dir}/${name}.pid"
-command=/usr/bin/nohup
+command_args=" \
+ -c \
+ -t ${name} \
+ -r \
+ -p ${app_pidfile} \
+ -P ${pidfile} \
+ %%LOCALBASE%%/bin/java \
+ ${java_options} \
+ -jar ${graylog_dir}/graylog.jar server \
+ --no-pid-file \
+ --configfile ${graylog_config}"
-command_args="%%LOCALBASE%%/bin/java -jar ${graylog_dir}/graylog.jar server \
- --configfile \"${graylog_config}\" \
- --pidfile \"${pidfile}\" \
- >> \"${graylog_log_file}\" \
- 2>> \"${graylog_log_file}\" &"
+required_files="%%LOCALBASE%%/bin/java ${graylog_config}"
graylog_precmd() {
- if [ ! -f "${graylog_config}" ]; then
- echo "Configuration file ${graylog_config} not found"
- exit 1
- fi
-
- if [ ! -f "${graylog_log_file}" ]; then
- touch "${graylog_log_file}"
- chown "${graylog_user}:${graylog_group}" "${graylog_log_file}"
- chmod 640 "${graylog_log_file}"
- fi
-
install -d -o ${graylog_user} -g ${graylog_group} -m 750 "${graylog_data_dir}"
+ install -d -o ${graylog_user} -g ${graylog_group} -m 750 "${graylog_logs_dir}"
install -d -o ${graylog_user} -g ${graylog_group} -m 750 "${graylog_run_dir}"
}
+start_precmd="graylog_precmd"
+
run_rc_command "$1"
diff --git a/sysutils/graylog/files/log4j2.xml.in b/sysutils/graylog/files/log4j2.xml.in
new file mode 100644
index 000000000000..9b9c6f743eb6
--- /dev/null
+++ b/sysutils/graylog/files/log4j2.xml.in
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration packages="org.graylog2.log4j" shutdownHook="disable" monitorInterval="15">
+ <Appenders>
+ <Console name="STDOUT" target="SYSTEM_OUT">
+ <PatternLayout pattern="%d %-5p: %c - %m%n"/>
+ </Console>
+ <File name="FreeBSD-logs" fileName="%%GRAYLOG_LOGS_DIR%%/server.log">
+ <PatternLayout>
+ <Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
+ </PatternLayout>
+ </File>
+
+ <!-- Internal Graylog log appender. Please do not disable. This makes internal log messages available via REST calls. -->
+ <Memory name="graylog-internal-logs" bufferSize="500"/>
+ </Appenders>
+ <Loggers>
+ <!-- Application Loggers -->
+ <Logger name="org.graylog2" level="info"/>
+ <Logger name="com.github.joschi.jadconfig" level="warn"/>
+ <!-- this emits a harmless warning for ActiveDirectory every time which we can't work around :( -->
+ <Logger name="org.apache.directory.api.ldap.model.message.BindRequestImpl" level="error"/>
+ <!-- Prevent DEBUG message about Lucene Expressions not found. -->
+ <Logger name="org.elasticsearch.script" level="warn"/>
+ <!-- Disable messages from the version check -->
+ <Logger name="org.graylog2.periodical.VersionCheckThread" level="off"/>
+ <!-- Suppress crazy byte array dump of Drools -->
+ <Logger name="org.drools.compiler.kie.builder.impl.KieRepositoryImpl" level="warn"/>
+ <!-- Silence chatty natty -->
+ <Logger name="com.joestelmach.natty.Parser" level="warn"/>
+ <!-- Silence Kafka log chatter -->
+ <Logger name="kafka.log.Log" level="warn"/>
+ <Logger name="kafka.log.OffsetIndex" level="warn"/>
+ <!-- Silence useless session validation messages -->
+ <Logger name="org.apache.shiro.session.mgt.AbstractValidatingSessionManager" level="warn"/>
+ <Root level="warn">
+ <AppenderRef ref="STDOUT"/>
+ <AppenderRef ref="graylog-internal-logs"/>
+ </Root>
+ <Root level="error">
+ <AppenderRef ref="FreeBSD-logs"/>
+ </Root>
+ </Loggers>
+</Configuration>
diff --git a/sysutils/graylog/files/pkg-message.in b/sysutils/graylog/files/pkg-message.in
index 0c080fcc8d53..7a805558a457 100644
--- a/sysutils/graylog/files/pkg-message.in
+++ b/sysutils/graylog/files/pkg-message.in
@@ -1,10 +1,16 @@
======================================================================
-Please see %%ETCDIR%% for sample versions of
-server.conf
+Please see %%ETCDIR%% for sample versions of server.conf and log4j2.xml
For GeoIP support you need to install the net/GeoIP port and
-configure the path to the GeoIP databases in the Graylog Web Interface
+configure the path to the GeoIP databases in the Graylog Web Interface.
When running graylog in a jail, you need to set enforce_statfs for the jail.
+
+For a single-node installation, install:
+
+- databases/mongodb
+- textproc/elasticsearch2
+
+And ensure that the elasticsearch cluster name matches that used by graylog.
======================================================================
diff --git a/sysutils/graylog/files/server.conf.sample.in b/sysutils/graylog/files/server.conf.in
index e48dd0ea57fe..e48dd0ea57fe 100644
--- a/sysutils/graylog/files/server.conf.sample.in
+++ b/sysutils/graylog/files/server.conf.in
diff --git a/sysutils/graylog/pkg-plist b/sysutils/graylog/pkg-plist
index 4b459b9b3213..bfa69a82eabd 100644
--- a/sysutils/graylog/pkg-plist
+++ b/sysutils/graylog/pkg-plist
@@ -1,4 +1,5 @@
@sample(%%GRAYLOGUSER%%,%%GRAYLOGGROUP%%,440) %%ETCDIR%%/server/server.conf.sample
+@sample(%%GRAYLOGUSER%%,%%GRAYLOGGROUP%%,440) %%ETCDIR%%/server/log4j2.xml.sample
%%DATADIR%%/graylog.jar
%%DATADIR%%/plugin/graylog-plugin-anonymous-usage-statistics-%%PORTVERSION%%.jar
%%DATADIR%%/plugin/graylog-plugin-beats-%%PORTVERSION%%.jar
@@ -7,3 +8,4 @@
%%DATADIR%%/plugin/graylog-plugin-map-widget-%%PORTVERSION%%.jar
%%DATADIR%%/plugin/graylog-plugin-pipeline-processor-%%PORTVERSION%%.jar
@dir(%%GRAYLOGUSER%%,%%GRAYLOGGROUP%%,440) %%GRAYLOG_DATA_DIR%%
+@dir(%%GRAYLOGUSER%%,%%GRAYLOGGROUP%%,440) %%GRAYLOG_LOGS_DIR%%