diff options
author | 2015-12-09 16:17:12 +0800 | |
---|---|---|
committer | 2015-12-09 16:18:17 +0800 | |
commit | db7e9f350b3888481aa425a19ccc08b7ae441eaa (patch) | |
tree | 5e8f2e3ee5198b1c26689b9380e62c4f3ebee324 /app-admin | |
parent | net-fs/samba: Bump to version 4.2.6 (diff) | |
parent | app-admin/filebeat-bin: removing empty IUSE and (R)DEPEND as suggested by idella (diff) | |
download | gentoo-db7e9f350b3888481aa425a19ccc08b7ae441eaa.tar.gz gentoo-db7e9f350b3888481aa425a19ccc08b7ae441eaa.tar.bz2 gentoo-db7e9f350b3888481aa425a19ccc08b7ae441eaa.zip |
Merge remote-tracking branch 'remotes/hydrapolic/filebeat'
Pull request: https://github.com/gentoo/gentoo/pull/444
Diffstat (limited to 'app-admin')
-rw-r--r-- | app-admin/filebeat-bin/Manifest | 2 | ||||
-rw-r--r-- | app-admin/filebeat-bin/filebeat-bin-1.0.0.ebuild | 49 | ||||
-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/metadata.xml | 10 |
5 files changed, 113 insertions, 0 deletions
diff --git a/app-admin/filebeat-bin/Manifest b/app-admin/filebeat-bin/Manifest new file mode 100644 index 000000000000..430abbc6f618 --- /dev/null +++ b/app-admin/filebeat-bin/Manifest @@ -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 diff --git a/app-admin/filebeat-bin/filebeat-bin-1.0.0.ebuild b/app-admin/filebeat-bin/filebeat-bin-1.0.0.ebuild new file mode 100644 index 000000000000..96d830c7b279 --- /dev/null +++ b/app-admin/filebeat-bin/filebeat-bin-1.0.0.ebuild @@ -0,0 +1,49 @@ +# 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" + +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} + + newconfd "${FILESDIR}/${MY_PN}.confd" ${MY_PN} + newinitd "${FILESDIR}/${MY_PN}.initd" ${MY_PN} + + insinto /etc/${MY_PN} + newins ${MY_PN}.yml ${MY_PN}.yml.example + + 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 +} 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..6de6d2780691 --- /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="-c ${FILEBEAT_CONFIG} ${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/metadata.xml b/app-admin/filebeat-bin/metadata.xml new file mode 100644 index 000000000000..fe6f9ccf1a7e --- /dev/null +++ b/app-admin/filebeat-bin/metadata.xml @@ -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> |