From: "Manuel Rüger" <mrueg@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/prometheus/files/, net-analyzer/prometheus/
Date: Fri, 12 Jan 2018 12:38:44 +0000 (UTC) [thread overview]
Message-ID: <1515760688.706a1294d62fcb7171151723539d60590c05eda6.mrueg@gentoo> (raw)
commit: 706a1294d62fcb7171151723539d60590c05eda6
Author: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 12 12:38:08 2018 +0000
Commit: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Fri Jan 12 12:38:08 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=706a1294
net-analyzer/prometheus: Add reload functionality to init script
Package-Manager: Portage-2.3.19, Repoman-2.3.6
net-analyzer/prometheus/files/prometheus-3.initd | 11 +++-
net-analyzer/prometheus/prometheus-2.0.0-r1.ebuild | 68 ++++++++++++++++++++++
2 files changed, 78 insertions(+), 1 deletion(-)
diff --git a/net-analyzer/prometheus/files/prometheus-3.initd b/net-analyzer/prometheus/files/prometheus-3.initd
index 5f6d6fe1426..ae151ef91fb 100644
--- a/net-analyzer/prometheus/files/prometheus-3.initd
+++ b/net-analyzer/prometheus/files/prometheus-3.initd
@@ -1,5 +1,5 @@
#!/sbin/openrc-run
-# Copyright 2016-2017 Gentoo Foundation
+# Copyright 2016-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
description="Prometheus monitoring system and time series database"
@@ -14,6 +14,15 @@ start_stop_daemon_args="--user ${user} --group ${group} \
--stdout /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log \
--stderr /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log"
+extra_started_commands="reload"
+
depend() {
after net
}
+
+reload() {
+ ebegin "Reloading ${SVCNAME}"
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+ eend $? "Failed to stop ${SVCNAME}"
+}
+
diff --git a/net-analyzer/prometheus/prometheus-2.0.0-r1.ebuild b/net-analyzer/prometheus/prometheus-2.0.0-r1.ebuild
new file mode 100644
index 00000000000..a51b71d9bb2
--- /dev/null
+++ b/net-analyzer/prometheus/prometheus-2.0.0-r1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit user golang-build golang-vcs-snapshot
+
+EGO_PN="github.com/prometheus/prometheus"
+MY_PV=${PV/_rc/-rc.}
+EGIT_COMMIT="v${MY_PV}"
+PROMETHEUS_COMMIT="0a74f98"
+ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64"
+
+DESCRIPTION="Prometheus monitoring system and time series database"
+HOMEPAGE="https://github.com/prometheus/prometheus"
+SRC_URI="${ARCHIVE_URI}"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE=""
+
+DEPEND="dev-util/promu"
+
+PROMETHEUS_HOME="/var/lib/prometheus"
+
+RESTRICT="test"
+
+pkg_setup() {
+ enewgroup prometheus
+ enewuser prometheus -1 -1 "${PROMETHEUS_HOME}" prometheus
+}
+
+src_prepare() {
+ default
+ sed -i -e "s/{{.Revision}}/${PROMETHEUS_COMMIT}/" src/${EGO_PN}/.promu.yml || die
+}
+
+src_compile() {
+ pushd src/${EGO_PN} || die
+ GOPATH="${S}" promu build -v || die
+ popd || die
+}
+
+src_install() {
+ pushd src/${EGO_PN} || die
+ dobin promtool prometheus
+ dodoc -r {documentation,{README,CHANGELOG,CONTRIBUTING}.md}
+ insinto /etc/prometheus
+ doins documentation/examples/prometheus.yml
+ insinto /usr/share/prometheus
+ doins -r console_libraries consoles
+ dosym ../../usr/share/prometheus/console_libraries /etc/prometheus/console_libraries
+ dosym ../../usr/share/prometheus/consoles /etc/prometheus/consoles
+ popd || die
+
+ newinitd "${FILESDIR}"/prometheus-3.initd prometheus
+ newconfd "${FILESDIR}"/prometheus.confd prometheus
+ keepdir /var/log/prometheus /var/lib/prometheus
+ fowners prometheus:prometheus /var/log/prometheus /var/lib/prometheus
+}
+
+pkg_postinst() {
+ if has_version '<net-analyzer/prometheus-2.0.0_rc0'; then
+ ewarn "Old prometheus 1.x TSDB won't be converted to the new prometheus 2.0 format"
+ ewarn "Be aware that the old data currently cannot be accessed with prometheus 2.0"
+ ewarn "This release requires a clean storage directory and is not compatible with"
+ ewarn "files created by previous beta releases"
+ fi
+}
next reply other threads:[~2018-01-12 12:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-12 12:38 Manuel Rüger [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-01-12 12:38 [gentoo-commits] repo/gentoo:master commit in: net-analyzer/prometheus/files/, net-analyzer/prometheus/ Manuel Rüger
2017-10-09 14:26 Manuel Rüger
2017-09-18 11:01 Manuel Rüger
2017-08-12 10:19 Manuel Rüger
2016-12-14 12:51 Manuel Rüger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1515760688.706a1294d62fcb7171151723539d60590c05eda6.mrueg@gentoo \
--to=mrueg@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox