kolla/docker/fluentd/extend_start.sh
Michal Nasiadka ef8d7a27ab Change fluentd to td-agent on CentOS
Fluentd packages in CentOS Opstools SIG repos is very old,
because of old-ish ruby (2.0) packaged with CentOS 7.

On the other hand - TreasureData packages for fluentd are packaged
with embedded ruby as dependencies - so this change moves to those.
Thanks to that we are able to move from fluentd 0.12 to 1.4.2.

Still we need ruby-devel for non-td-agent distros,
because we download monasca output plugin as source and build it
during installation.

* Bump up td.repo to version 3
* Merge sudoers into one file
* Change fluentd plugin install macro to reflect changes

Depends-On: https://review.opendev.org/679209/
Depends-On: https://review.opendev.org/679885/
Change-Id: I40a81103317ac044d9311b2505593056cf313bd2
2019-09-04 09:10:28 +00:00

29 lines
925 B
Bash

#!/bin/bash
# Give processes executed with the "kolla" group the permission to create files
# and sub-directories in the /var/log/kolla directory.
#
# Also set the setgid permission on the /var/log/kolla directory so that new
# files and sub-directories in that directory inherit its group id ("kolla").
if [[ "${KOLLA_BASE_ARCH}" == "x86_64" && "${KOLLA_BASE_DISTRO}" != "debian" ]]; then
USERGROUP="td-agent:kolla"
FLUENTD="td-agent"
else
USERGROUP="fluentd:kolla"
FLUENTD="fluentd"
fi
if [ ! -d /var/log/kolla ]; then
mkdir -p /var/log/kolla
fi
if [[ $(stat -c %U:%G /var/log/kolla) != "${USERGROUP}" ]]; then
sudo chown ${USERGROUP} /var/log/kolla
fi
if [[ $(stat -c %a /var/log/kolla) != "2775" ]]; then
sudo chmod 2775 /var/log/kolla
fi
if [[ (-d /var/lib/${FLUENTD}) && ($(stat -c %U:%G /var/lib/${FLUENTD}) != "${USERGROUP}") ]]; then
sudo chown ${USERGROUP} /var/lib/${FLUENTD}
fi