kolla/docker/kibana/extend_start.sh
Jorge Niedbalski ebf343e3ce [kibana] symlink to the kibana executable under /opt/ (debian)
Kolla-ansible expects for /opt/kibana/bin/kibana to exists as
the default path location, centos/redhat distros have this location
set, so it would be desirable for debian to at least have a symlink
to the executable under the /opt path.

Closes-Bug: #1772750

Change-Id: I1034ecb1d909dcc357ffa904569ca7c8358386b1
Signed-off-by: Jorge Niedbalski <jorge.niedbalski@linaro.org>
2018-05-22 18:53:16 -04:00

18 lines
638 B
Bash

#!/bin/bash
KIBANA_LOG_DIR="/var/log/kolla/kibana"
KIBANA_DEFAULT_EXECUTABLE="/opt/kibana/bin/kibana"
# (niedbalski): debian installs under /usr/share, so lets create
# a symlink to the common executable location see LP #1772750.
if [[ ! -e ${KIBANA_DEFAULT_EXECUTABLE} ]] && [[ -f /usr/share/kibana/bin/kibana ]]; then
mkdir -p $(dirname ${KIBANA_DEFAULT_EXECUTABLE}) && ln -s /usr/share/kibana/bin/kibana ${KIBANA_DEFAULT_EXECUTABLE}
fi
if [[ ! -d "${KIBANA_LOG_DIR}" ]]; then
mkdir -p "${KIBANA_LOG_DIR}"
fi
if [[ $(stat -c %U:%G "${KIBANA_LOG_DIR}") != "kibana:kolla" ]]; then
chown kibana:kolla "${KIBANA_LOG_DIR}"
fi