diff options
author | Tomas Mozes <hydrapolic@gmail.com> | 2017-11-29 10:32:33 +0100 |
---|---|---|
committer | Patrice Clement <monsieurp@gentoo.org> | 2017-12-03 01:11:35 +0100 |
commit | 4307d6bea4f81e26100fe4a9f3587988565d6bfa (patch) | |
tree | fd184f29cd4ad5f6fc29cdc36d99dc6d912aca8c /app-admin/filebeat/files | |
parent | app-cdr/cdrdao: stable 1.2.3-r4 for hppa, bug #608946 (diff) | |
download | gentoo-4307d6bea4f81e26100fe4a9f3587988565d6bfa.tar.gz gentoo-4307d6bea4f81e26100fe4a9f3587988565d6bfa.tar.bz2 gentoo-4307d6bea4f81e26100fe4a9f3587988565d6bfa.zip |
app-admin/filebeat: version bump to 6.0.0.
Package-Manager: Portage-2.3.16, Repoman-2.3.6
Closes: https://github.com/gentoo/gentoo/pull/6343
Diffstat (limited to 'app-admin/filebeat/files')
-rw-r--r-- | app-admin/filebeat/files/filebeat.initd.1 | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/app-admin/filebeat/files/filebeat.initd.1 b/app-admin/filebeat/files/filebeat.initd.1 new file mode 100644 index 000000000000..2cb33ba8ebc0 --- /dev/null +++ b/app-admin/filebeat/files/filebeat.initd.1 @@ -0,0 +1,43 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +FILEBEAT_USER="${FILEBEAT_USER:-root}" +FILEBEAT_GROUP="${FILEBEAT_GROUP:-root}" +FILEBEAT_CONFIG="${FILEBEAT_CONFIG:-/etc/filebeat/filebeat.yml}" +FILEBEAT_DATADIR="${FILEBEAT_DATADIR:-/var/lib/filebeat}" +FILEBEAT_LOGDIR="${FILEBEAT_LOGDIR:-/var/log/filebeat}" +FILEBEAT_OPTS="${FILEBEAT_OPTS:-}" + +command="/usr/bin/filebeat" +command_args="-c ${FILEBEAT_CONFIG} ${FILEBEAT_OPTS} -path.config $(dirname $FILEBEAT_CONFIG) \ + -path.data ${FILEBEAT_DATADIR} -path.home ${FILEBEAT_DATADIR} -path.logs ${FILEBEAT_LOGDIR}" +command_background="true" +command_user="${FILEBEAT_USER}:${FILEBEAT_GROUP}" +extra_commands="checkconfig" +pidfile="/run/filebeat.pid" +retry="TERM/5/KILL/5" +start_stop_daemon_args="--chdir ${FILEBEAT_DATADIR}" + +depend() { + use net + after elasticsearch +} + +checkconfig() { + if [ ! -e ${FILEBEAT_CONFIG} ]; then + eend "Please create a configuration file at ${FILEBEAT_CONFIG}" + return 1 + fi + + ebegin "Checking your configuration" + ${command} ${command_args} test config + eend $? "Configuration error. Please fix your configuration files." +} + +start_pre() { + checkconfig || return 1 + + checkpath -d -o "${FILEBEAT_USER}":"${FILEBEAT_GROUP}" -m750 "${FILEBEAT_DATADIR}" + checkpath -d -o "${FILEBEAT_USER}":"${FILEBEAT_GROUP}" -m750 "${FILEBEAT_LOGDIR}" +} |