summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Vroon <chainsaw@gentoo.org>2016-11-14 14:21:26 +0000
committerTony Vroon <chainsaw@gentoo.org>2016-11-14 14:22:23 +0000
commitb3d68487e1569d50014d8c029efd3c6a861783b1 (patch)
tree564f1e676c391c97a448fd47326610ef08482399 /app-admin/graylog2/files
parentdev-ros/mavros: remove old (diff)
downloadgentoo-b3d68487e1569d50014d8c029efd3c6a861783b1.tar.gz
gentoo-b3d68487e1569d50014d8c029efd3c6a861783b1.tar.bz2
gentoo-b3d68487e1569d50014d8c029efd3c6a861783b1.zip
app-admin/graylog2: New addition. Original ebuild by Guillaume Ceccarelli with some minor changes by me. Reviewed by dwfreed, iamben & K_F in #gentoo-dev.
Diffstat (limited to 'app-admin/graylog2/files')
-rw-r--r--app-admin/graylog2/files/confd7
-rw-r--r--app-admin/graylog2/files/initd55
2 files changed, 62 insertions, 0 deletions
diff --git a/app-admin/graylog2/files/confd b/app-admin/graylog2/files/confd
new file mode 100644
index 000000000000..58291368f353
--- /dev/null
+++ b/app-admin/graylog2/files/confd
@@ -0,0 +1,7 @@
+GRAYLOG_CONFIG_FILE="/etc/graylog2/graylog.conf"
+GRAYLOG_GROUP="graylog"
+GRAYLOG_LOG_DIR="/var/log/graylog2"
+GRAYLOG_USER="graylog"
+GRAYLOG_OPTIONS=""
+GRAYLOG_PID_FILE="/run/graylog2/graylog.pid"
+JAVA_OPTS="-Xms1g -Xmx1g -XX:NewRatio=1 -server -XX:+ResizeTLAB -XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:-OmitStackTraceInFastThrow"
diff --git a/app-admin/graylog2/files/initd b/app-admin/graylog2/files/initd
new file mode 100644
index 000000000000..1a1f562bcbb3
--- /dev/null
+++ b/app-admin/graylog2/files/initd
@@ -0,0 +1,55 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+export JAVA_HOME=`java-config --jre-home`
+
+checkconfig() {
+ if [ ! -r "${GRAYLOG_CONFIG_FILE}" ]; then
+ eerror "GRAYLOG_CONFIG_FILE doesn't point to a readable config file"
+ fi
+}
+
+depend() {
+ need net
+}
+
+start() {
+ checkconfig || return 1
+
+ [ -e `dirname "$GRAYLOG_PID_FILE"` ] || \
+ install -d -o${GRAYLOG_USER} -g${GRAYLOG_GROUP} -m750 `dirname "$GRAYLOG_PID_FILE"`
+
+ [ -e "$GRAYLOG_LOG_DIR" ] || \
+ install -d -o${GRAYLOG_USER} -g${GRAYLOG_GROUP} -m750 "$GRAYLOG_LOG_DIR"
+
+ CLASSPATH="$(java-config -r)"
+ CLASSPATH="${CLASSPATH}:$(java-config -d --classpath sigar)"
+
+ ebegin "Starting Graylog"
+
+ start-stop-daemon \
+ --start \
+ --exec "${JAVA_HOME}/bin/java" \
+ --user ${GRAYLOG_USER} \
+ --group ${GRAYLOG_GROUP} \
+ --env CLASSPATH="${CLASSPATH}" \
+ --background \
+ --chdir /usr/share/graylog2 \
+ --stdout ${GRAYLOG_LOG_DIR}/graylog.stdout.log \
+ --stderr ${GRAYLOG_LOG_DIR}/graylog.stderr.log \
+ -- ${JAVA_OPTS} -Djava.library.path=`java-config --lib sigar` -classpath "${CLASSPATH}" -jar /usr/share/graylog2/graylog.jar server -f "${GRAYLOG_CONFIG_FILE}" -p "${GRAYLOG_PID_FILE}" ${GRAYLOG_OPTIONS}
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Graylog"
+
+ start-stop-daemon \
+ --stop \
+ --pidfile "${GRAYLOG_PID_FILE}"
+
+ eend $?
+}