summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikle Kolyada <zlogene@gentoo.org>2021-03-14 13:42:50 +0300
committerMikle Kolyada <zlogene@gentoo.org>2021-03-14 13:43:47 +0300
commit73726a7e03c87d7014fbdc71a0d4276980066d46 (patch)
tree4e727243632d06d8f3591f3a9e4f64cdaa8fc772 /app-metrics
parentx11-themes/kvantum: Bump to 0.19.0 (diff)
downloadgentoo-73726a7e03c87d7014fbdc71a0d4276980066d46.tar.gz
gentoo-73726a7e03c87d7014fbdc71a0d4276980066d46.tar.bz2
gentoo-73726a7e03c87d7014fbdc71a0d4276980066d46.zip
app-metrics/prometheus: Add systemd unit support
Bug: https://bugs.gentoo.org/695988 Package-Manager: Portage-3.0.13, Repoman-3.0.2 Signed-off-by: Mikle Kolyada <zlogene@gentoo.org>
Diffstat (limited to 'app-metrics')
-rw-r--r--app-metrics/prometheus/files/prometheus.service22
-rw-r--r--app-metrics/prometheus/prometheus-2.21.0-r1.ebuild (renamed from app-metrics/prometheus/prometheus-2.21.0.ebuild)7
2 files changed, 27 insertions, 2 deletions
diff --git a/app-metrics/prometheus/files/prometheus.service b/app-metrics/prometheus/files/prometheus.service
new file mode 100644
index 000000000000..ebd8a901d1fd
--- /dev/null
+++ b/app-metrics/prometheus/files/prometheus.service
@@ -0,0 +1,22 @@
+[Unit]
+Description=Prometheus
+Wants=network-online.target
+After=network-online.target
+
+[Service]
+Type=simple
+User=prometheus
+Group=prometheus
+ExecStart=/usr/bin/prometheus \
+ --web.enable-lifecycle \
+ --config.file=/etc/prometheus/prometheus.yml \
+ --storage.tsdb.path="/var/lib/prometheus/data" \
+ --web.console.templates=/etc/prometheus/consoles \
+ --web.console.libraries=/etc/prometheus/console_libraries \
+ --web.listen-address=0.0.0.0:9090 \
+ --web.enable-admin-api
+
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/app-metrics/prometheus/prometheus-2.21.0.ebuild b/app-metrics/prometheus/prometheus-2.21.0-r1.ebuild
index b4bb7a694d13..f2030b8dd9e1 100644
--- a/app-metrics/prometheus/prometheus-2.21.0.ebuild
+++ b/app-metrics/prometheus/prometheus-2.21.0-r1.ebuild
@@ -1,8 +1,10 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-inherit go-module
+
+inherit go-module systemd
+
MY_PV=v${PV/_rc/-rc.}
GIT_COMMIT=e83ef207b
@@ -44,6 +46,7 @@ src_install() {
dosym ../../usr/share/prometheus/console_libraries /etc/prometheus/console_libraries
dosym ../../usr/share/prometheus/consoles /etc/prometheus/consoles
+ systemd_dounit "${FILESDIR}"/prometheus.service
newinitd "${FILESDIR}"/prometheus.initd prometheus
newconfd "${FILESDIR}"/prometheus.confd prometheus
keepdir /var/log/prometheus /var/lib/prometheus