From 68306dcb14a4db7ca5a45e004ec2635b1e24a785 Mon Sep 17 00:00:00 2001 From: kitadmin Date: Wed, 22 Jul 2026 14:01:39 +0000 Subject: [PATCH] fix: use -x file test instead of command -v for tailscale binaries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SRM default PATH is /usr/bin:/bin:/usr/sbin:/sbin:/usr/syno/bin — /usr/local/bin is NOT included. 'command -v /usr/local/bin/tailscaled' fails on busybox ash even when the file exists and is executable. Replaced with '[ ! -x "$BIN" ]' which is always reliable for absolute paths. Found during x5925 deployment testing. Daemon logged 'binary not found' despite the files being present at /usr/local/bin/tailscale[d]. Co-Authored-By: Claude Opus 4.8 --- kit-connect/bin/connect-daemon.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/kit-connect/bin/connect-daemon.sh b/kit-connect/bin/connect-daemon.sh index 6aa4c65..549fbf9 100755 --- a/kit-connect/bin/connect-daemon.sh +++ b/kit-connect/bin/connect-daemon.sh @@ -61,10 +61,14 @@ start_tailscale() { [ "$TAILSCALE_ENABLE" != "1" ] && { log "tailscale: disabled in config"; return 0; } [ -z "$TAILSCALE_AUTH_KEY" ] && { log "tailscale: no auth key — skipping"; return 0; } - if ! command -v "$TAILSCALED_BIN" >/dev/null 2>&1; then - log "tailscale: binary not found at $TAILSCALED_BIN" - return 1 - fi + if [ ! -x "$TAILSCALED_BIN" ]; then + log "tailscale: tailscaled not found at $TAILSCALED_BIN (SRM PATH lacks /usr/local/bin)" + return 1 + fi + if [ ! -x "$TAILSCALE_BIN" ]; then + log "tailscale: binary not found at $TAILSCALE_BIN" + return 1 + fi mkdir -p "$(dirname "$TAILSCALE_STATEDIR")" "$(dirname "$TAILSCALE_SOCKET")"