Subject: [PATCH] community/prometheus: add reload to init.d

From: Drew DeVault <[email-masked]>
Date: Mon, 6 Jan 2020 12:19:45 -0500

---
 community/prometheus/APKBUILD         | 4 ++--
 community/prometheus/prometheus.initd | 8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/community/prometheus/APKBUILD b/community/prometheus/APKBUILD
index e5594d6942..1e46bc83dc 100644
--- a/community/prometheus/APKBUILD
+++ b/community/prometheus/APKBUILD
@@ -1,7 +1,7 @@
 # Maintainer: Drew DeVault <[email-masked]>
 pkgname=prometheus
 pkgver=2.15.1
-pkgrel=3
+pkgrel=4
 pkgdesc="The Prometheus monitoring system and time series database"
 url="https://github.com/prometheus/prometheus"
 arch="all"
@@ -72,4 +72,4 @@ package() {
 
 sha512sums="b08dfa48bddb6e007cd0fd4553847e824d6adfc047d97151b8dd12dbd1f67cfb9301824b320f1cabe9644159e6968b3fd2ee8104a5d53822a9965423c4bb47b5  prometheus-2.15.1.tar.gz
 24b34e586238d5b331639aa5c43b6a927692f251af2cea2787335eab30d2fc7d46975059595db4697ae0dc1d35b5e23cfc4e4b2e424442c209a05283ca22a239  prometheus.confd
-bdc179cb3b8b5d3416e74a0b31002bd7b456b204404579dd40c38cade43eb26b106d16ea2597755035035eca567d34bfa44913eaa28870c3f22e1105d47908ab  prometheus.initd"
+8845d50026c1cea525dae392fa95e06e0b20184325fa0af78e50b5fbc18dabf5526d2ef61798e1e9041840633c6057958e84ef8cce314a7b68ca67fc42bc4fe5  prometheus.initd"
diff --git a/community/prometheus/prometheus.initd b/community/prometheus/prometheus.initd
index 446466225b..173f8adfb1 100644
--- a/community/prometheus/prometheus.initd
+++ b/community/prometheus/prometheus.initd
@@ -7,6 +7,8 @@ command_args="--config.file=$prometheus_config_file \
 	--storage.tsdb.path=$prometheus_storage_path \
 	--storage.tsdb.retention.time=$prometheus_retention_time"
 command_user="prometheus:prometheus"
+pidfile="/run/${RC_SVCNAME}.pid"
+extra_started_commands="reload"
 
 start_pre() {
 	[ -n "$output_log" ] && checkpath -f "$output_log" \
@@ -15,3 +17,9 @@ start_pre() {
 		-m 644 -o prometheus:prometheus
 	checkpath -d "$prometheus_storage_path" -m 755 -o prometheus:prometheus
 }
+
+reload() {
+	ebegin "Reloading $RC_SERVNAME"
+	start-stop-daemon --signal HUP --exec "$command" --pidfile "$pidfile"
+	eend $?
+}
-- 
2.24.1