From be7d08bffc4919475e5c87355eda22e051ccc5b2 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Mon, 25 Mar 2024 14:47:56 +0100 Subject: [PATCH] logrotate: fix reload failures Do not attempt to run "systemctl reload" on the open5gs services, unless they are running. This fixes the logrotate service failing on this postrotate script, if units are not running or not installed. --- configs/logrotate/open5gs.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configs/logrotate/open5gs.in b/configs/logrotate/open5gs.in index 113b12a2c..73cf7abce 100644 --- a/configs/logrotate/open5gs.in +++ b/configs/logrotate/open5gs.in @@ -8,7 +8,9 @@ postrotate for i in nrfd scpd seppd pcrfd hssd ausfd udmd udrd upfd sgwcd sgwud smfd mmed amfd; do - systemctl reload open5gs-$i + if systemctl --quiet is-active open5gs-$i; then + systemctl reload open5gs-$i + fi done endscript }