From 806826e191a07c4485993f7b7185e66937f962fe Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Mon, 2 Oct 2023 11:04:36 -0600 Subject: [PATCH] chore: Restore log directory behavior (#14026) fixes: #14019 --- scripts/deb/post-install.sh | 8 +++----- scripts/rpm/post-install.sh | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/scripts/deb/post-install.sh b/scripts/deb/post-install.sh index 544a726bd..1f3c2ccf6 100644 --- a/scripts/deb/post-install.sh +++ b/scripts/deb/post-install.sh @@ -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" || { diff --git a/scripts/rpm/post-install.sh b/scripts/rpm/post-install.sh index d26695863..994570f9f 100644 --- a/scripts/rpm/post-install.sh +++ b/scripts/rpm/post-install.sh @@ -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" || {