From 97aeeed8b65dfe4f90bcc83777312369a0087b4a Mon Sep 17 00:00:00 2001 From: librelad Date: Sun, 24 May 2026 21:57:38 +0100 Subject: [PATCH] fix(install): silence pre-install requirement-check noise MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On a fresh install the requirement checks run before the things they probe exist, leaking raw command stderr: - check_install_type.sh: `$( (id -u "$user") )` printed "id: 'dockerinstall': no such user" to the terminal AND — since id's error goes to stderr, not the captured stdout — the next line's `[[ "$ISUSER" == *"no such user"* ]]` could never match, so the rootless-user-absent branch was dead. Add `2>&1` (matching siblings on lines 25/31): no leak, and the check now works. - grep on $sysctl (the rootless marker conf, absent until rootless is set up) printed "grep: /etc/sysctl.d/99-libreportal-rootless.conf: No such file or directory". Add -s to the four $sysctl greps (check_docker_rootless, rootless_start_setup, rootless_docker x2); "marker absent" is still detected (non-zero exit), just without the file-not-found message. Co-Authored-By: Claude Opus 4.7 Signed-off-by: librelad --- scripts/checks/requirements/check_docker_rootless.sh | 2 +- scripts/checks/requirements/check_install_type.sh | 2 +- scripts/docker/install/rootless/rootless_docker.sh | 4 ++-- scripts/docker/install/rootless/rootless_start_setup.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/checks/requirements/check_docker_rootless.sh b/scripts/checks/requirements/check_docker_rootless.sh index fd31a98..1525602 100755 --- a/scripts/checks/requirements/check_docker_rootless.sh +++ b/scripts/checks/requirements/check_docker_rootless.sh @@ -4,7 +4,7 @@ checkDockerRootlessRequirement() { if [[ $CFG_DOCKER_INSTALL_TYPE == "rootless" ]]; then ### Docker Rootless - if grep -q "ROOTLESS" $sysctl; then + if grep -qs "ROOTLESS" $sysctl; then isSuccessful "Docker Rootless appears to be installed." else isNotice "Docker Rootless does not appear to be installed." diff --git a/scripts/checks/requirements/check_install_type.sh b/scripts/checks/requirements/check_install_type.sh index 6ae6a2a..ae5d8b5 100755 --- a/scripts/checks/requirements/check_install_type.sh +++ b/scripts/checks/requirements/check_install_type.sh @@ -31,7 +31,7 @@ checkInstallTypeRequirement() ISACT=$( (runSystem systemctl is-active docker ) 2>&1 ) elif [[ $CFG_DOCKER_INSTALL_TYPE == "rootless" ]]; then # Used for checking the rootless user - local ISUSER=$( (id -u "$CFG_DOCKER_INSTALL_USER")) + local ISUSER=$( (id -u "$CFG_DOCKER_INSTALL_USER") 2>&1 ) if [[ "$ISUSER" == *"no such user"* ]]; then ISACT=$(command -v docker &> /dev/null) fi diff --git a/scripts/docker/install/rootless/rootless_docker.sh b/scripts/docker/install/rootless/rootless_docker.sh index 44a415b..a3b340f 100755 --- a/scripts/docker/install/rootless/rootless_docker.sh +++ b/scripts/docker/install/rootless/rootless_docker.sh @@ -53,7 +53,7 @@ installDockerRootless() echo "" echo "---- $menu_number. Updating the sysctl file for Updating Debian 10." echo "" - if sudo grep -q "kernel.unprivileged_userns_clone=1" $sysctl; then + if sudo grep -qs "kernel.unprivileged_userns_clone=1" $sysctl; then isNotice "kernel.unprivileged_userns_clone=1 already exists in $sysctl" else local result=$(echo "kernel.unprivileged_userns_clone=1" | sudo tee -a $sysctl > /dev/null) @@ -181,7 +181,7 @@ EOL" echo "" # Update sysctl file - if ! grep -qF "# DOCKER ROOTLESS SYSCTL START" "$sysctl"; then + if ! grep -qsF "# DOCKER ROOTLESS SYSCTL START" "$sysctl"; then local result=$(echo '# DOCKER ROOTLESS SYSCTL START' | sudo tee -a "$sysctl" > /dev/null) checkSuccess "Adding rootless header to sysctl" diff --git a/scripts/docker/install/rootless/rootless_start_setup.sh b/scripts/docker/install/rootless/rootless_start_setup.sh index 7b92785..3cb633c 100755 --- a/scripts/docker/install/rootless/rootless_start_setup.sh +++ b/scripts/docker/install/rootless/rootless_start_setup.sh @@ -2,7 +2,7 @@ installDockerRootlessStartSetup() { - if sudo grep -q "ROOTLESS" $sysctl; then + if sudo grep -qs "ROOTLESS" $sysctl; then isSuccessful "Docker Rootless appears to be installed." else installDockerRootless;