From 5bb59c7aace661d6b6b81bc85e117558140a3319 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 19 Jan 2024 16:35:34 +0000 Subject: [PATCH] network: Only try to restart collectd if it is running This updated version of this script avoids any errors if collectd is not running (yet) which might happen during the boot process. Signed-off-by: Michael Tremer --- src/initscripts/networking/red.up/60-collectd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/initscripts/networking/red.up/60-collectd b/src/initscripts/networking/red.up/60-collectd index 0e457894fd..a965433549 100644 --- a/src/initscripts/networking/red.up/60-collectd +++ b/src/initscripts/networking/red.up/60-collectd @@ -1,6 +1,8 @@ #!/bin/bash # Restart collectd because the ping plugin does not re-resolve "gateway" -exec /etc/init.d/collectd restart +if pgrep collectd &>/dev/null; then + exec /etc/init.d/collectd restart &>/dev/null +fi -exit 1 +exit 0 -- 2.39.5