From 3fb3d398962037ba2465d136153ac814e5ec7483 Mon Sep 17 00:00:00 2001 From: Alejandro Andreu Date: Fri, 3 Mar 2017 17:52:19 +0100 Subject: [PATCH] Add workaround script for midonet-elk Change-Id: I69106707276a621dbf0887ecbf4cf0b98d033314 --- files/analytics/install-midonet-elk.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 files/analytics/install-midonet-elk.sh diff --git a/files/analytics/install-midonet-elk.sh b/files/analytics/install-midonet-elk.sh new file mode 100644 index 0000000..66fe858 --- /dev/null +++ b/files/analytics/install-midonet-elk.sh @@ -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