Add workaround script for midonet-elk

Change-Id: I69106707276a621dbf0887ecbf4cf0b98d033314
This commit is contained in:
Alejandro Andreu 2017-03-03 17:52:19 +01:00
parent 52ec895139
commit 3fb3d39896
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
#!/bin/bash -eux
#
# WORKAROUND:
# In some cases the package midonet-elk doesn't get installed properly
# and some of the packaged files are not placed where they should
# (e.g. /etc/logstash/conf.d/midonet.conf)
# Check if MidoNet logstash configuration file is there
if [ -f /etc/logstash/conf.d/midonet.conf ]; then
exit 0
fi
# Purge midonet-elk and reinstall it, the hard way
rpm -e --justdb --nodeps midonet-elk
yumdownloader --destdir /tmp/ midonet-elk
yum localinstall /tmp/midonet-elk*.rpm
cd /
rpm2cpio /tmp/midonet-elk*.rpm | cpio -idmv
rm /tmp/midonet-elk*.rpm
# Restart logstash if already running
systemctl status logstash.service | grep running > /dev/null && systemctl restart logstash.service || true
exit 0