fixes issue with rpm /var/log/telegraf permissions (#7909)

This commit is contained in:
Steven Soroka 2020-07-28 11:26:09 -04:00 committed by GitHub
parent 02454315ab
commit 93a08f8d92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -43,6 +43,15 @@ if [[ ! -d /etc/telegraf/telegraf.d ]]; then
mkdir -p /etc/telegraf/telegraf.d
fi
# If 'telegraf.conf' is not present use package's sample (fresh install)
if [[ ! -f /etc/telegraf/telegraf.conf ]] && [[ -f /etc/telegraf/telegraf.conf.sample ]]; then
cp /etc/telegraf/telegraf.conf.sample /etc/telegraf/telegraf.conf
fi
test -d $LOG_DIR || mkdir -p $LOG_DIR
chown -R -L telegraf:telegraf $LOG_DIR
chmod 755 $LOG_DIR
# Distribution-specific logic
if [[ -f /etc/redhat-release ]] || [[ -f /etc/SuSE-release ]]; then
# RHEL-variant logic