diff --git a/assets/runtime/functions.sh b/assets/runtime/functions.sh index b04c789..b907883 100755 --- a/assets/runtime/functions.sh +++ b/assets/runtime/functions.sh @@ -556,8 +556,11 @@ function initialize_datadir() function configure_logrotate() { log_info "Configuring logrotate ..." + local LOGROTATE_CONFIG_DIR='/etc/logrotate.d/salt' + local LOGROTATE_CONFIG_FILE="${LOGROTATE_CONFIG_DIR}/salt-common.logrotate" - rm -f /etc/logrotate.d/salt-common + rm -rf "${LOGROTATE_CONFIG_DIR}" + mkdir -p "${LOGROTATE_CONFIG_DIR}" # configure supervisord log rotation cat > /etc/logrotate.d/supervisord < /etc/logrotate.d/salt < "${LOGROTATE_CONFIG_FILE}" <> /etc/logrotate.d/salt <> "${LOGROTATE_CONFIG_FILE}" <