From 2cc8f35a13d452b6d680bcb3d955a73ea44b9771 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Mon, 13 Apr 2026 15:18:07 +0200 Subject: [PATCH] fix(sonarqube): clean up temp file after zip extraction The SonarQube update function (ct/sonarqube.sh) never deleted the downloaded zip file (~200-500 MB) from /tmp after extraction. On LXC containers with 4-8 GB disks, this accumulates with every update and can eventually fill the disk. Also add explicit cleanup in the install script instead of relying solely on cleanup_lxc() pattern matching. --- ct/sonarqube.sh | 1 + install/sonarqube-install.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/ct/sonarqube.sh b/ct/sonarqube.sh index 0ac979445..ab7cd3c47 100644 --- a/ct/sonarqube.sh +++ b/ct/sonarqube.sh @@ -43,6 +43,7 @@ function update_script() { RELEASE=$(get_latest_github_release "SonarSource/sonarqube") curl -fsSL "https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-${RELEASE}.zip" -o $temp_file unzip -q "$temp_file" -d /opt + rm -f "$temp_file" mv /opt/sonarqube-${RELEASE} /opt/sonarqube echo "${RELEASE}" > ~/.sonarqube msg_ok "Updated SonarQube" diff --git a/install/sonarqube-install.sh b/install/sonarqube-install.sh index 0856eb513..b84d7b03b 100644 --- a/install/sonarqube-install.sh +++ b/install/sonarqube-install.sh @@ -21,6 +21,7 @@ temp_file=$(mktemp) RELEASE=$(get_latest_github_release "SonarSource/sonarqube") curl -fsSL "https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-${RELEASE}.zip" -o $temp_file unzip -q "$temp_file" -d /opt +rm -f "$temp_file" mv /opt/sonarqube-* /opt/sonarqube $STD useradd -r -m -U -d /opt/sonarqube -s /bin/bash sonarqube chown -R sonarqube:sonarqube /opt/sonarqube