~dricottone/huttese-apk

3b9a1d9b0a0f72e6fcab9ce5ebf2ee9b1b7e825a — Drew DeVault 4 years ago 8fe476e
alertmanager: normalize initd/confd
M sr.ht/alertmanager-irc-relay/alertmanager-irc-relay.initd => sr.ht/alertmanager-irc-relay/alertmanager-irc-relay.initd +4 -3
@@ 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
}

M sr.ht/alertmanager/APKBUILD => sr.ht/alertmanager/APKBUILD +7 -5
@@ 1,7 1,7 @@
# Maintainer: Drew DeVault <sir@cmpwn.com>
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
}


M sr.ht/alertmanager/alertmanager.confd => sr.ht/alertmanager/alertmanager.confd +5 -2
@@ 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

M sr.ht/alertmanager/alertmanager.initd => sr.ht/alertmanager/alertmanager.initd +7 -7
@@ 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
}

M sr.ht/prometheus/prometheus.initd => sr.ht/prometheus/prometheus.initd +1 -0
@@ 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" \