From 3b9a1d9b0a0f72e6fcab9ce5ebf2ee9b1b7e825a Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 5 Jan 2020 10:42:46 -0500 Subject: [PATCH] alertmanager: normalize initd/confd --- .../alertmanager-irc-relay.initd | 7 ++++--- sr.ht/alertmanager/APKBUILD | 12 +++++++----- sr.ht/alertmanager/alertmanager.confd | 7 +++++-- sr.ht/alertmanager/alertmanager.initd | 14 +++++++------- sr.ht/prometheus/prometheus.initd | 1 + 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/sr.ht/alertmanager-irc-relay/alertmanager-irc-relay.initd b/sr.ht/alertmanager-irc-relay/alertmanager-irc-relay.initd index 4b77cc6..71ee26b 100644 --- a/sr.ht/alertmanager-irc-relay/alertmanager-irc-relay.initd +++ b/sr.ht/alertmanager-irc-relay/alertmanager-irc-relay.initd @@ -8,7 +8,8 @@ command_user="prometheus:prometheus" pidfile="/run/${RC_SVCNAME}.pid" start_pre() { - checkpath -f "/var/log/alertmanager.initd" -m 644 -o prometheus:prometheus - checkpath -f "$config_file" -m 740 -o prometheus:prometheus - checkpath -d "$storage_path" -m 755 -o prometheus:prometheus + [ -n "$output_log" ] && checkpath -f "$output_log" \ + -m 644 -o prometheus:prometheus + [ -n "$error_log" ] && checkpath -f "$error_log" \ + -m 644 -o prometheus:prometheus } diff --git a/sr.ht/alertmanager/APKBUILD b/sr.ht/alertmanager/APKBUILD index 8597bf8..d4e78cf 100644 --- a/sr.ht/alertmanager/APKBUILD +++ b/sr.ht/alertmanager/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Drew DeVault pkgname=alertmanager pkgver=0.19.0 -pkgrel=0 +pkgrel=1 pkgdesc="Prometheus Alertmanager" url="https://github.com/prometheus/alertmanager" arch="all" @@ -19,14 +19,16 @@ options="!check" # timing-dependent upstream failures build() { go build \ - -gcflags "all=-trimpath=$PWD" \ - -asmflags "all=-trimpath=$PWD" \ + -trimpath \ + -mod=vendor \ -ldflags "-extldflags $LDFLAGS" \ + -tags netgo \ ./cmd/alertmanager go build \ - -gcflags "all=-trimpath=$PWD" \ - -asmflags "all=-trimpath=$PWD" \ + -trimpath \ + -mod=vendor \ -ldflags "-extldflags $LDFLAGS" \ + -tags netgo \ ./cmd/amtool } diff --git a/sr.ht/alertmanager/alertmanager.confd b/sr.ht/alertmanager/alertmanager.confd index c5d3a18..5c21c6a 100644 --- a/sr.ht/alertmanager/alertmanager.confd +++ b/sr.ht/alertmanager/alertmanager.confd @@ -1,2 +1,5 @@ -config_file=/etc/alertmanager/alertmanager.yml -storage_path=/var/lib/alertmanager/data +alertmanager_config_file=/etc/alertmanager/alertmanager.yml +alertmanager_storage_path=/var/lib/alertmanager/data + +output_log=/var/log/alertmanager.log +error_log=/var/log/alertmanager.log diff --git a/sr.ht/alertmanager/alertmanager.initd b/sr.ht/alertmanager/alertmanager.initd index 9a85721..59daca7 100644 --- a/sr.ht/alertmanager/alertmanager.initd +++ b/sr.ht/alertmanager/alertmanager.initd @@ -2,15 +2,15 @@ name="alertmanager" description="alert manager for the prometheus monitoring system" supervisor=supervise-daemon -supervise_daemon_args="-1 /var/log/alertmanager.log -2 /var/log/alertmanager.log" -command=/usr/bin/alertmanager -command_args="--config.file=$config_file \ - --storage.path=$storage_path" +command=/usr/bin/prometheus +command_args="--config.file=$alertmanager_config_file \ + --storage.path=$alertmanager_storage_path" command_user="prometheus:prometheus" pidfile="/run/${RC_SVCNAME}.pid" start_pre() { - checkpath -f "/var/log/alertmanager.initd" -m 644 -o prometheus:prometheus - checkpath -f "$config_file" -m 740 -o prometheus:prometheus - checkpath -d "$storage_path" -m 755 -o prometheus:prometheus + [ -n "$output_log" ] && checkpath -f "$output_log" \ + -m 644 -o prometheus:prometheus + [ -n "$error_log" ] && checkpath -f "$error_log" \ + -m 644 -o prometheus:prometheus } diff --git a/sr.ht/prometheus/prometheus.initd b/sr.ht/prometheus/prometheus.initd index 4464662..764a8cd 100644 --- a/sr.ht/prometheus/prometheus.initd +++ b/sr.ht/prometheus/prometheus.initd @@ -7,6 +7,7 @@ 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" start_pre() { [ -n "$output_log" ] && checkpath -f "$output_log" \ -- 2.45.2