chore: Restore log directory behavior (#14026)

fixes: #14019
This commit is contained in:
Joshua Powers 2023-10-02 11:04:36 -06:00 committed by GitHub
parent d9b335e814
commit 806826e191
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 10 deletions

View File

@ -47,11 +47,9 @@ if [[ ! -f /etc/telegraf/telegraf.conf ]] && [[ -f /etc/telegraf/telegraf.conf.s
fi
LOG_DIR=/var/log/telegraf
test -d $LOG_DIR || {
mkdir -p $LOG_DIR
chown -R -L telegraf:telegraf $LOG_DIR
chmod 755 $LOG_DIR
}
test -d $LOG_DIR || mkdir -p $LOG_DIR
chown -R -L telegraf:telegraf $LOG_DIR
chmod 755 $LOG_DIR
STATE_DIR=/var/lib/telegraf
test -d "$STATE_DIR" || {

View File

@ -26,11 +26,9 @@ fi
# Set up log directories
LOG_DIR=/var/log/telegraf
test -d $LOG_DIR || {
mkdir -p $LOG_DIR
chown -R -L telegraf:telegraf $LOG_DIR
chmod 755 $LOG_DIR
}
mkdir -p $LOG_DIR
chown -R -L telegraf:telegraf $LOG_DIR
chmod 755 $LOG_DIR
STATE_DIR=/var/lib/telegraf
test -d "$STATE_DIR" || {