Load logfile.conf first to help debugging

Conf files in $COLLECTD_CONF_DIR are loaded in alphabetical order.

If there is an error loading the python plugin, the logfile plugin is not
loaded.
To help debugging, the logfile should be loaded first.

Changing logfile.conf to 01-logfile.conf should fix this issue by making
collectd load the logfile.conf first

Closes-Bug: #1657859

Change-Id: I1f748d61d6d9a291bcc32476ac17bb0d60fdc573
This commit is contained in:
Emma Foley 2017-01-19 18:30:03 +00:00
parent 7231032cba
commit 5bfb438f1c
2 changed files with 10 additions and 4 deletions

View File

@ -62,10 +62,10 @@ function adapt_collectd_conf {
touch $COLLECTD_LOG_FILE
fi
sudo cp $COLLECTD_CEILOMETER_DIR/etc/collectd.conf.d/logfile.conf $COLLECTD_CONF_DIR/
sudo cp $COLLECTD_CEILOMETER_DIR/etc/collectd.conf.d/logfile.conf $COLLECTD_CONF_DIR/01-logfile.conf
sudo sed -i 's|LogLevel.*$|LogLevel "'$COLLECTD_LOG_LEVEL'"|g' $COLLECTD_CONF_DIR/logfile.conf
sudo sed -i 's|File.*$|File "'$COLLECTD_LOG_FILE'"|g' $COLLECTD_CONF_DIR/logfile.conf
sudo sed -i 's|LogLevel.*$|LogLevel "'$COLLECTD_LOG_LEVEL'"|g' $COLLECTD_CONF_DIR/01-logfile.conf
sudo sed -i 's|File.*$|File "'$COLLECTD_LOG_FILE'"|g' $COLLECTD_CONF_DIR/01-logfile.conf
}
@ -75,7 +75,7 @@ function restore_collectd_conf {
if [ -f '$COLLECTD_CONF_DIR/collectd-ceilometer-plugin.conf' ]; then
sudo rm -f $COLLECTD_CONF_DIR/collectd-ceilometer-plugin.conf
sudo rm -f $COLLECTD_CONF_DIR/logfile.conf
sudo rm -f $COLLECTD_CONF_DIR/01-logfile.conf
fi
}

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Fixes 'bug 1657859 https://bugs.launchpad.net/collectd-ceilometer-plugin/+bug/1657859'.
Changed logfile.conf to 01-logfile.conf so it loads before the python
plugins, so debugging is easier.