From 51a5e4362eb85d7a743da2c28d46e12fcfce59a4 Mon Sep 17 00:00:00 2001 From: Andy Grunwald Date: Mon, 6 Jan 2025 17:07:02 +0100 Subject: [PATCH] Alertmanager: Change the way how the systemd unit file is written to disk Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> --- install/prometheus-alertmanager-install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install/prometheus-alertmanager-install.sh b/install/prometheus-alertmanager-install.sh index 824bba3d..10d20c7b 100644 --- a/install/prometheus-alertmanager-install.sh +++ b/install/prometheus-alertmanager-install.sh @@ -33,7 +33,7 @@ echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed Prometheus Alertmanager" msg_info "Creating Service" -service_path="/etc/systemd/system/prometheus-alertmanager.service" +cat </etc/systemd/system/prometheus-alertmanager.service echo "[Unit] Description=Prometheus Alertmanager Wants=network-online.target @@ -50,7 +50,8 @@ ExecStart=/usr/local/bin/alertmanager \ ExecReload=/bin/kill -HUP \$MAINPID [Install] -WantedBy=multi-user.target" >$service_path +WantedBy=multi-user.target" +EOF systemctl enable -q --now prometheus-alertmanager msg_ok "Created Service"