From 515eace59b0c00ab9593b4d9893d50e4f6bb15b7 Mon Sep 17 00:00:00 2001 From: KoinuDayo Date: Thu, 27 Jul 2023 03:06:09 +0800 Subject: [PATCH] Changes: 1.Default retention time 2.Check Logrotate after Check User https://github.com/XTLS/Xray-core/discussions/2369#discussioncomment-6554217 --- install-release.sh | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/install-release.sh b/install-release.sh index d7ce1ca..d824cec 100755 --- a/install-release.sh +++ b/install-release.sh @@ -626,7 +626,6 @@ stop_xray() { install_with_logrotate() { install_software 'logrotate' 'logrotate' - check_install_user if [[ -z "$LOGROTATE_TIME" ]]; then LOGROTATE_TIME="00:00:00" fi @@ -655,20 +654,10 @@ EOF LOGROTATE_DIR='1' fi cat << EOF > /etc/logrotate.d/xray -/var/log/xray/access.log { +/var/log/xray/*.log { daily missingok - rotate 30 - compress - delaycompress - notifempty - create 0600 $INSTALL_USER_UID $INSTALL_USER_GID -} - -/var/log/xray/error.log { - daily - missingok - rotate 30 + rotate 7 compress delaycompress notifempty @@ -824,10 +813,13 @@ main() { [[ "$CHECK" -eq '1' ]] && check_update [[ "$REMOVE" -eq '1' ]] && remove_xray [[ "$INSTALL_GEODATA" -eq '1' ]] && install_geodata - [[ "$LOGROTATE" -eq '1' ]] && install_with_logrotate + # Check if the user is effective check_install_user + # Check Logrotate after Check User + [[ "$LOGROTATE" -eq '1' ]] && install_with_logrotate + # Two very important variables TMP_DIRECTORY="$(mktemp -d)" ZIP_FILE="${TMP_DIRECTORY}/Xray-linux-$MACHINE.zip"