From 1f56c9461baa87e5bebb0e5cd04c64cce4f5cafd Mon Sep 17 00:00:00 2001 From: marco Date: Mon, 26 Feb 2024 13:26:16 +0100 Subject: [PATCH] systemd: check configuration before attempting reload --- config/crowdsec.service | 1 + debian/crowdsec.service | 1 + rpm/SOURCES/crowdsec.unit.patch | 2 ++ 3 files changed, 4 insertions(+) diff --git a/config/crowdsec.service b/config/crowdsec.service index 147cae4946e..65a8d30bc5f 100644 --- a/config/crowdsec.service +++ b/config/crowdsec.service @@ -8,6 +8,7 @@ Environment=LC_ALL=C LANG=C ExecStartPre=/usr/local/bin/crowdsec -c /etc/crowdsec/config.yaml -t -error ExecStart=/usr/local/bin/crowdsec -c /etc/crowdsec/config.yaml #ExecStartPost=/bin/sleep 0.1 +ExecReload=/usr/local/bin/crowdsec -c /etc/crowdsec/config.yaml -t -error ExecReload=/bin/kill -HUP $MAINPID Restart=always RestartSec=60 diff --git a/debian/crowdsec.service b/debian/crowdsec.service index b65558f70d3..c1a5e403745 100644 --- a/debian/crowdsec.service +++ b/debian/crowdsec.service @@ -8,6 +8,7 @@ Environment=LC_ALL=C LANG=C ExecStartPre=/usr/bin/crowdsec -c /etc/crowdsec/config.yaml -t -error ExecStart=/usr/bin/crowdsec -c /etc/crowdsec/config.yaml #ExecStartPost=/bin/sleep 0.1 +ExecReload=/usr/bin/crowdsec -c /etc/crowdsec/config.yaml -t -error ExecReload=/bin/kill -HUP $MAINPID Restart=always RestartSec=60 diff --git a/rpm/SOURCES/crowdsec.unit.patch b/rpm/SOURCES/crowdsec.unit.patch index af9fe5c31e3..5173beb2710 100644 --- a/rpm/SOURCES/crowdsec.unit.patch +++ b/rpm/SOURCES/crowdsec.unit.patch @@ -9,5 +9,7 @@ +ExecStartPre=/usr/bin/crowdsec -c /etc/crowdsec/config.yaml -t -error +ExecStart=/usr/bin/crowdsec -c /etc/crowdsec/config.yaml #ExecStartPost=/bin/sleep 0.1 +-ExecReload=/usr/local/bin/crowdsec -c /etc/crowdsec/config.yaml -t -error ++ExecReload=/usr/bin/crowdsec -c /etc/crowdsec/config.yaml -t -error ExecReload=/bin/kill -HUP $MAINPID Restart=always