]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
network: Only try to restart collectd if it is running
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 19 Jan 2024 16:36:58 +0000 (16:36 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 19 Jan 2024 16:37:24 +0000 (16:37 +0000)
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 <michael.tremer@ipfire.org>
src/initscripts/networking/red.up/60-collectd

index 0e457894fd4f15fc81a4c4dacb9ac5993feb8207..a965433549cc571654c1022551e3159427a618a6 100644 (file)
@@ -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