35394e25a3
The package used to install fluentd on debian/ubuntu is not available for architectures other than x86_64. For those cases install fluentd as a gem until the package 'td-agent' is available for more architectures. Change-Id: Ic1b25b37d06b429a112f1418a79d385d505bb1e9
29 lines
900 B
Bash
29 lines
900 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_DISTRO}" =~ debian|ubuntu && "${KOLLA_BASE_ARCH}" == "x86_64" ]]; 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 [[ $(stat -c %U:%G /var/lib/${FLUENTD}) != "${USERGROUP}" ]]; then
|
|
sudo chown ${USERGROUP} /var/lib/${FLUENTD}
|
|
fi
|