diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
commit | 8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch) | |
tree | 7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-admin/graylog2/files | |
parent | 30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff) |
gentoo resync : 14.07.2018
Diffstat (limited to 'app-admin/graylog2/files')
-rw-r--r-- | app-admin/graylog2/files/confd | 7 | ||||
-rw-r--r-- | app-admin/graylog2/files/confd-r1 | 9 | ||||
-rw-r--r-- | app-admin/graylog2/files/confd-r2 | 12 | ||||
-rw-r--r-- | app-admin/graylog2/files/initd | 54 | ||||
-rw-r--r-- | app-admin/graylog2/files/initd-r1 | 55 | ||||
-rw-r--r-- | app-admin/graylog2/files/initd-r2 | 31 |
6 files changed, 168 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/confd-r1 b/app-admin/graylog2/files/confd-r1 new file mode 100644 index 000000000000..23b632ac4338 --- /dev/null +++ b/app-admin/graylog2/files/confd-r1 @@ -0,0 +1,9 @@ +GRAYLOG_CONFIG_FILE="/etc/graylog2/graylog.conf" +GRAYLOG_GROUP="graylog" +GRAYLOG_LOG_DIR="/var/log/graylog2" +GRAYLOG_INSTALL_DIR="/usr/share/graylog2" +GRAYLOG_DATA_DIR="/var/lib/graylog2" +GRAYLOG_USER="graylog" +GRAYLOG_OPTIONS="" +GRAYLOG_PID_FILE="/run/graylog2/graylog.pid" +JAVA_OPTS="-Djava.library.path=$GRAYLOG_INSTALL_DIR/lib/sigar -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/confd-r2 b/app-admin/graylog2/files/confd-r2 new file mode 100644 index 000000000000..97eac6ac77fa --- /dev/null +++ b/app-admin/graylog2/files/confd-r2 @@ -0,0 +1,12 @@ +GRAYLOG_CONFIG_FILE="/etc/graylog2/graylog.conf" +GRAYLOG_DATA_DIR="/var/lib/graylog2" +GRAYLOG_GROUP="graylog" +GRAYLOG_INSTALL_DIR="/usr/share/graylog2" +GRAYLOG_LOG_DIR="/var/log/graylog2" +GRAYLOG_OPTIONS="" +GRAYLOG_USER="graylog" + +JAVA_OPTS="-Djava.library.path=$GRAYLOG_INSTALL_DIR/lib/sigar -Xms1g -Xmx1g -XX:NewRatio=1 -server -XX:+ResizeTLAB -XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:-OmitStackTraceInFastThrow" + +# Please adjust according to your bind address +rc_need="net.lo" diff --git a/app-admin/graylog2/files/initd b/app-admin/graylog2/files/initd new file mode 100644 index 000000000000..20c2143e96c9 --- /dev/null +++ b/app-admin/graylog2/files/initd @@ -0,0 +1,54 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +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 $? +} diff --git a/app-admin/graylog2/files/initd-r1 b/app-admin/graylog2/files/initd-r1 new file mode 100644 index 000000000000..cc068808ebf3 --- /dev/null +++ b/app-admin/graylog2/files/initd-r1 @@ -0,0 +1,55 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +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" + + ebegin "Starting Graylog" + + checkpath -d -o "${GRAYLOG_USER}:${GRAYLOG_GROUP}" -m750 "${GRAYLOG_DATA_DIR}" + checkpath -d -o "${GRAYLOG_USER}:${GRAYLOG_GROUP}" -m750 "${GRAYLOG_DATA_DIR}/data" + checkpath -d -o "${GRAYLOG_USER}:${GRAYLOG_GROUP}" -m750 "${GRAYLOG_DATA_DIR}/data/contentpacks" + checkpath -d -o "${GRAYLOG_USER}:${GRAYLOG_GROUP}" -m750 "${GRAYLOG_DATA_DIR}/data/journal" + + start-stop-daemon \ + --start \ + --exec "${JAVA_HOME}/bin/java" \ + --user ${GRAYLOG_USER} \ + --group ${GRAYLOG_GROUP} \ + --background \ + --chdir ${GRAYLOG_INSTALL_DIR} \ + --stdout ${GRAYLOG_LOG_DIR}/graylog.stdout.log \ + --stderr ${GRAYLOG_LOG_DIR}/graylog.stderr.log \ + -- ${JAVA_OPTS} -jar ${GRAYLOG_INSTALL_DIR}/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 $? +} diff --git a/app-admin/graylog2/files/initd-r2 b/app-admin/graylog2/files/initd-r2 new file mode 100644 index 000000000000..c6177eef41d0 --- /dev/null +++ b/app-admin/graylog2/files/initd-r2 @@ -0,0 +1,31 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +command="/usr/bin/java" +command_args="${JAVA_OPTS} -jar ${GRAYLOG_INSTALL_DIR}/graylog.jar server -f ${GRAYLOG_CONFIG_FILE} --no-pid-file ${GRAYLOG_OPTIONS}" +command_background="true" +command_user="${GRAYLOG_USER}:${GRAYLOG_GROUP}" +pidfile="/run/${RC_SVCNAME}.pid" + +output_log="${GRAYLOG_LOG_DIR}/graylog.stdout.log" +error_log="${GRAYLOG_LOG_DIR}/graylog.stderr.log" +directory="${GRAYLOG_INSTALL_DIR}" +required_files="${GRAYLOG_CONFIG_FILE}" + +depend() { + use dns +} + +start_pre() { + local d + for d in \ + "${GRAYLOG_DATA_DIR}" \ + "${GRAYLOG_DATA_DIR}/data" \ + "${GRAYLOG_DATA_DIR}/data/contentpacks" \ + "${GRAYLOG_DATA_DIR}/data/journal" \ + "${GRAYLOG_LOG_DIR}"; do + + checkpath -d -o "${GRAYLOG_USER}":"${GRAYLOG_GROUP}" -m750 "${d}" + done +} |