collectd: move include line
authorFlorian Eckert <fe@dev.tdt.de>
Wed, 24 Jun 2020 14:09:56 +0000 (16:09 +0200)
committerFlorian Eckert <fe@dev.tdt.de>
Wed, 24 Jun 2020 18:09:09 +0000 (20:09 +0200)
Currently the init script generates a config file from uci, that has the
include line before the interval line. This means, that anything happening
in the include directory does not yet see the changed Interval.

Moving the include line before the uci generation process fix this issue.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
utils/collectd/files/collectd.init

index b07416f4e92f0cc2c748bb5f848525483fa411a8..7400194b07f942cd1b2a735a9c204165bd729d73 100644 (file)
@@ -310,10 +310,6 @@ process_config() {
        config_get BaseDir globals BaseDir "/var/run/collectd"
        printf "BaseDir \"%s\"\n" "$BaseDir" >> "$COLLECTD_CONF"
 
-       config_get Include globals Include "/tmp/collectd.d"
-       printf "Include \"%s\"\n" "$Include" >> "$COLLECTD_CONF"
-       mkdir -p "$Include"
-
        config_get PIDFile globals PIDFile "/var/run/collectd.pid"
        printf "PIDFile \"%s\"\n" "$PIDFile" >> "$COLLECTD_CONF"
 
@@ -332,6 +328,10 @@ process_config() {
        config_get Hostname globals Hostname "$(uname -n)"
        printf "Hostname \"%s\"\n" "$Hostname" >> "$COLLECTD_CONF"
 
+       config_get Include globals Include "/tmp/collectd.d"
+       printf "Include \"%s\"\n" "$Include" >> "$COLLECTD_CONF"
+       mkdir -p "$Include"
+
        printf "\n" >> "$COLLECTD_CONF"
 
        # PLUGIN CONFIG