fix: use -x file test instead of command -v for tailscale binaries

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 <noreply@anthropic.com>
This commit is contained in:
2026-07-22 14:01:39 +00:00
parent 8bd157b0de
commit 68306dcb14
+6 -2
View File
@@ -61,8 +61,12 @@ 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"
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