mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-23 11:17:21 -08:00
app-admin/filebeat-bin: new ebuild
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
DIST filebeat-1.0.0-i686.tar.gz 3069805 SHA256 f184fe7d5cd566bdf1a48f79cd52c0d3ef960782b2076e8df67836e0ed36dc37 SHA512 c4df33524249aef574f923c67be56e22f8eb24a51933178a90b080cc59aec772052c653bf551f198c08e63c7cb03fa9f346dc7c5cee31c586270c532655486df WHIRLPOOL e2be905de1aa0749bfb419bff50fc1952dc7dc5b2d127045709f08e6e6cb38faae1372d64515c4157949138cdbd10888aea0e0fe4e98f57d69a73873eb578483
|
||||
DIST filebeat-1.0.0-x86_64.tar.gz 3260387 SHA256 f0bcc2dc9ae720a672fe5f4b22c0d132f7131d4d07484f4100453c7122f0561a SHA512 823450554ec6d7ae43ff064e967ad8d5bef95077404738feac7f7ae5ef74000e051042ea3734423b883bab9102d90a4e707d9c0d03c88abe2f34862f02d01ed4 WHIRLPOOL 5a6b9b532d090a87724f17af3727cca772f48602c39cb9d82593f3c4f4ab722f295db647ba4d0152bf3baa41134b5561c2e9655a02d47c25e228af64122e3609
|
||||
@@ -0,0 +1,53 @@
|
||||
# Copyright 1999-2015 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Id$
|
||||
|
||||
EAPI=5
|
||||
|
||||
MY_PN=${PN/-bin/}
|
||||
MY_P=${MY_PN}-${PV}
|
||||
|
||||
DESCRIPTION="Lightweight log shipper for Logstash and Elasticsearch"
|
||||
HOMEPAGE="https://www.elastic.co/products/beats"
|
||||
SRC_URI="amd64? ( https://download.elastic.co/beats/${MY_PN}/${MY_P}-x86_64.tar.gz )
|
||||
x86? ( https://download.elastic.co/beats/${MY_PN}/${MY_P}-i686.tar.gz )"
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND="${DEPEND}"
|
||||
|
||||
src_unpack() {
|
||||
if use amd64; then
|
||||
S="${WORKDIR}/${MY_P}-x86_64"
|
||||
elif use x86; then
|
||||
S="${WORKDIR}/${MY_P}-i686"
|
||||
fi
|
||||
|
||||
default
|
||||
}
|
||||
|
||||
src_install() {
|
||||
keepdir /etc/${MY_PN}
|
||||
keepdir /var/lib/${MY_PN}
|
||||
|
||||
fperms 0750 /var/lib/${MY_PN}
|
||||
|
||||
insinto /etc/${MY_PN}
|
||||
doins "${FILESDIR}/filebeat.yml.example"
|
||||
|
||||
newconfd "${FILESDIR}/${MY_PN}.confd" ${MY_PN}
|
||||
newinitd "${FILESDIR}/${MY_PN}.initd" ${MY_PN}
|
||||
|
||||
dobin ${MY_PN}
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
if [[ ! -e /etc/${MY_PN}/${MY_PN}.yml ]]; then
|
||||
elog "Before starting filebeat, you need to create a configuration file at:"
|
||||
elog "/etc/${MY_PN}/${MY_PN}.yml"
|
||||
fi
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
#FILEBEAT_USER=""
|
||||
#FILEBEAT_GROUP=""
|
||||
#FILEBEAT_CONFIG=""
|
||||
#FILEBEAT_STATEDIR=""
|
||||
#FILEBEAT_OPTS=""
|
||||
@@ -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
|
||||
}
|
||||
@@ -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"
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<herd>proxy-maintainers</herd>
|
||||
<maintainer>
|
||||
<email>hydrapolic@gmail.com</email>
|
||||
<name>Tomas Mozes</name>
|
||||
<description>Proxy maintainer</description>
|
||||
</maintainer>
|
||||
</pkgmetadata>
|
||||
Reference in New Issue
Block a user