diff options
author | Tomas Mozes <tmozes@sygic.com> | 2015-12-07 13:29:57 +0100 |
---|---|---|
committer | Tomas Mozes <tmozes@sygic.com> | 2015-12-07 13:29:57 +0100 |
commit | c846729fc6ea0db39ec9ea2496cc55a00bbcfdd7 (patch) | |
tree | cb7766e5501688b321d0f24b1ff327aee7dfdabf /app-admin/filebeat-bin/files | |
parent | games-util/xqf: ppc stable wrt bug #565886 (diff) | |
download | gentoo-c846729fc6ea0db39ec9ea2496cc55a00bbcfdd7.tar.gz gentoo-c846729fc6ea0db39ec9ea2496cc55a00bbcfdd7.tar.bz2 gentoo-c846729fc6ea0db39ec9ea2496cc55a00bbcfdd7.zip |
app-admin/filebeat-bin: new ebuild
Diffstat (limited to 'app-admin/filebeat-bin/files')
-rw-r--r-- | app-admin/filebeat-bin/files/filebeat.confd | 5 | ||||
-rw-r--r-- | app-admin/filebeat-bin/files/filebeat.initd | 47 | ||||
-rw-r--r-- | app-admin/filebeat-bin/files/filebeat.yml.example | 14 |
3 files changed, 66 insertions, 0 deletions
diff --git a/app-admin/filebeat-bin/files/filebeat.confd b/app-admin/filebeat-bin/files/filebeat.confd new file mode 100644 index 000000000000..188f447f265b --- /dev/null +++ b/app-admin/filebeat-bin/files/filebeat.confd @@ -0,0 +1,5 @@ +#FILEBEAT_USER="" +#FILEBEAT_GROUP="" +#FILEBEAT_CONFIG="" +#FILEBEAT_STATEDIR="" +#FILEBEAT_OPTS="" diff --git a/app-admin/filebeat-bin/files/filebeat.initd b/app-admin/filebeat-bin/files/filebeat.initd new file mode 100644 index 000000000000..3ffc340bb54d --- /dev/null +++ b/app-admin/filebeat-bin/files/filebeat.initd @@ -0,0 +1,47 @@ +#!/sbin/openrc-run +# Copyright 1999-2015 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_STATEDIR="${FILEBEAT_STATEDIR:-/var/lib/filebeat}" +FILEBEAT_OPTS="${FILEBEAT_OPTS:-}" + +command="/usr/bin/filebeat" +command_args="${FILEBEAT_OPTS}" +extra_commands="checkconfig" +command_background="true" +start_stop_daemon_args="--user ${FILEBEAT_USER}:${FILEBEAT_GROUP} \ + --chdir ${FILEBEAT_STATEDIR}" +pidfile="/run/filebeat/filebeat.pid" + +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} -configtest + eend $? "Configuration error. Please fix your configuration files." +} + +start_pre() { + checkconfig || return 1 + + checkpath -d -o "${FILEBEAT_USER}":"${FILEBEAT_GROUP}" -m750 "$(dirname "${pidfile}")" + checkpath -d -o "${FILEBEAT_USER}":"${FILEBEAT_GROUP}" -m750 "${FILEBEAT_STATEDIR}" +} + +stop() { + ebegin "Stopping filebeat" + start-stop-daemon --stop \ + --pidfile=${pidfile} \ + --retry=TERM/5/KILL/5 +} diff --git a/app-admin/filebeat-bin/files/filebeat.yml.example b/app-admin/filebeat-bin/files/filebeat.yml.example new file mode 100644 index 000000000000..06c599cc6f37 --- /dev/null +++ b/app-admin/filebeat-bin/files/filebeat.yml.example @@ -0,0 +1,14 @@ +filebeat: + prospectors: + - + paths: + - /var/log/*.log + - /var/log/debug + - /var/log/messages + - /var/log/syslog + input_type: log + +output: + elasticsearch: + hosts: ["localhost:9200"] + index: "logstash" |