From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH] network: Only try to restart collectd if it is running Date: Fri, 19 Jan 2024 16:36:58 +0000 Message-ID: <20240119163658.805656-1-michael.tremer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3171026759887441005==" List-Id: --===============3171026759887441005== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 0e457894f..a96543354 100644 --- a/src/initscripts/networking/red.up/60-collectd +++ b/src/initscripts/networking/red.up/60-collectd @@ -1,6 +1,8 @@ #!/bin/bash =20 # 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 =20 -exit 1 +exit 0 --=20 2.39.2 --===============3171026759887441005==--