app-metrics/node_exporter: Add systemd-patched ebuild fpr version 0.18.1. #27

Merged
manuel merged 1 commit from feature/node_exporter into master 2019-11-10 23:13:59 +01:00
7 changed files with 117 additions and 0 deletions
Showing only changes of commit 11c2cbc03c - Show all commits

View file

@ -0,0 +1,6 @@
*node_exporter-0.18.1 (10 Nov 2019)
10 Nov 2019; <manuel@gentoo.org> +files/node_exporter-0.18.1-systemd.patch,
+files/node_exporter-1.initd, +files/node_exporter.confd, +metadata.xml,
+node_exporter-0.18.1.ebuild:
app-metrics/node_exporter: Add systemd-patched ebuild fpr version 0.18.1.

View file

@ -0,0 +1,7 @@
AUX node_exporter-0.18.1-systemd.patch 707 BLAKE2B 76a55c30cf7d528064a028396cbe6c057029d21b3fadd79c7af21532b55e3e52ac3a84e0ac318575a8bcce345cd8bb4bc0175007151f9e444719c33731adbcc2 SHA512 b129f354e7a08a8017e609afa5b94f223696755cfdcba575f5854db319897859c7824192f75c2fc446392a2fae16687ae745fa6f51cdded238b0e0eeb5560ab5
AUX node_exporter-1.initd 697 BLAKE2B 3c82d0d3f19f57e05dd1aee5be7397ff2c0f48ece8621ddac0f338fac83cf5ac76b82a6c158f07fdde1db64afbbc40f50305ac1380717b65f3f0d6fb2b90f013 SHA512 a51203241eca8aba0b0ec13afa1e8fed94bb9f3aaf48851f12e193ed7e395812cbb782fd41da793ac3dd79f978c5f71bf282ed144521c6ba718ca57bcc734dcf
AUX node_exporter.confd 111 BLAKE2B bb40370633c41a4f1283677ed16ad9734c7f180683e4d9d82be36ea5e63d3b8fc2a861a61c62e2e899209f7293588e3e7532ffe52ecb9aab4773a3943168d5dd SHA512 cce5db8eccf2ecfe1198aa8252b04fd6a96006f707e7132c2d01c5400d175551c3b9890c4d57fec9ccbe17594dfb937e1f99ead0e1c3fd8cf22930dabd70418d
DIST node_exporter-0.18.1.tar.gz 2110072 BLAKE2B 48c73d00cba892e34e95d40bd29c9ca70bc5748590f00cb7f8adcd25d8a9504f669d887b1273cc65316ca55b06c36d97a3e19a66382f35d5768db7c315981a13 SHA512 cf2b854fbec1ba39b18432cdc11ab507ebc5b2828e6b34b4f49af9b949fcd365cb3e5eb1e265d0825783810c6b1572a8b3512ec27a46e5c83f89a505590159c0
EBUILD node_exporter-0.18.1.ebuild 1482 BLAKE2B c3657b87f83fd9d96d890fc0f7f1d14a945a0f87e81e887ff7e62d6ef559477502d787db86c90df9a339d66df749c4f0e0b47a27a6049ce4e57b8dc7b88ee856 SHA512 a4e5531a335807a71496ef581b5fb167def5fc68a7960390e02a04c4b12cf5cbac3bd1b9ede5fbe4e8b0d0592854078b54f4aafe7116bbc60bde63f6cab6f13b
MISC ChangeLog 299 BLAKE2B 6c0510ec5b7739758aee9e21c3fc8344f4d48f3aa357af0c5f0ccb3698b6c0658faaa48860ee08e0550c1b72c52dd881637355f482dcdfd85c12847c80b155eb SHA512 e6b541e8d5c21adc241b02578552f73309d30d2fb6006fd70f16850fdeb18b9cf4b7dcd838295537f6eba318cddaaf05831a9db204f953e7bb86249a5a703753
MISC metadata.xml 337 BLAKE2B bd72b6097fead5eaf80082790d3712ae0893b118140b62f58639f0e5c56bebf57dbd0ccd0ea19af82b2dce88c88c494d88290f98df4818e4fad3f4386398d171 SHA512 aee4825d8b90a8fd84fb558b9af4b7eb889fcf81bae6c7b317a9d69f62b06dd0f0bc2aa91aa2c32f10ff91fdbf64b341d7e5adc3c65a5225c7e0e92d7a6b7816

View file

@ -0,0 +1,15 @@
Index: node_exporter-0.18.1/src/github.com/prometheus/node_exporter/examples/systemd/node_exporter.service
===================================================================
--- node_exporter-0.18.1.orig/src/github.com/prometheus/node_exporter/examples/systemd/node_exporter.service
+++ node_exporter-0.18.1/src/github.com/prometheus/node_exporter/examples/systemd/node_exporter.service
@@ -3,8 +3,8 @@ Description=Node Exporter
[Service]
User=node_exporter
-EnvironmentFile=/etc/sysconfig/node_exporter
-ExecStart=/usr/sbin/node_exporter $OPTIONS
+EnvironmentFile=/etc/sysconfig/node_exporter/sysconfig.node_exporter
+ExecStart=/usr/bin/node_exporter $OPTIONS
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,23 @@
#!/sbin/openrc-run
# Copyright 2016-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
description="Prometheus machine metrics exporter"
pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
user=${user:-${RC_SVCNAME}}
group=${group:-${RC_SVCNAME}}
command="/usr/bin/node_exporter"
command_args="${command_args:---collector.textfile.directory=/var/lib/node_exporter/}"
command_background="true"
start_stop_daemon_args="--user ${user} --group ${group} \
--stdout /var/log/node_exporter/${RC_SVCNAME}.log \
--stderr /var/log/node_exporter/${RC_SVCNAME}.log"
depend() {
after net
}
start_pre() {
checkpath -q -d -m 0755 -o ${user}:${group} /var/log/node_exporter
}

View file

@ -0,0 +1,2 @@
# arguments for prometheus node exporter
command_args="--collector.textfile.directory=/var/lib/node_exporter/"

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>manuel@fritteli.ch</email>
<name>Manuel Friedli</name>
</maintainer>
<upstream>
<remote-id type="github">prometheus/node_exporter</remote-id>
</upstream>
</pkgmetadata>

View file

@ -0,0 +1,53 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit user golang-build golang-vcs-snapshot systemd
EGO_PN="github.com/prometheus/node_exporter"
EGIT_COMMIT="v${PV/_rc/-rc.}"
NODE_EXPORTER_COMMIT="3db7773"
ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64"
DESCRIPTION="Prometheus exporter for machine metrics"
HOMEPAGE="https://github.com/prometheus/node_exporter"
SRC_URI="${ARCHIVE_URI}"
LICENSE="Apache-2.0"
SLOT="0"
IUSE=""
PATCHES=("${FILESDIR}/${P}-systemd.patch")
DEPEND=">=dev-lang/go-1.12
>=dev-util/promu-0.3.0"
pkg_setup() {
enewgroup ${PN}
enewuser ${PN} -1 -1 -1 ${PN}
}
src_prepare() {
default
sed -i -e "s/{{.Revision}}/${NODE_EXPORTER_COMMIT}/" src/${EGO_PN}/.promu.yml || die
}
src_compile() {
pushd src/${EGO_PN} || die
mkdir -p bin || die
GO111MODULE=on GOPATH="${S}" GOCACHE="${T}"/go-cache promu build -v --prefix node_exporter || die
popd || die
}
src_install() {
pushd src/${EGO_PN} || die
dobin node_exporter/node_exporter
dodoc {README,CHANGELOG,CONTRIBUTING}.md
systemd_dounit examples/systemd/node_exporter.service
insinto /etc/sysconfig/node_exporter
doins examples/systemd/sysconfig.node_exporter
popd || die
keepdir /var/lib/node_exporter /var/log/node_exporter
fowners ${PN}:${PN} /var/lib/node_exporter /var/log/node_exporter
newinitd "${FILESDIR}"/${PN}-1.initd ${PN}
newconfd "${FILESDIR}"/${PN}.confd ${PN}
}