From 3945b82f8a9550b54c33e61d4ed2227862d53e8a Mon Sep 17 00:00:00 2001 From: breken Date: Tue, 8 Sep 2026 18:08:54 -0700 Subject: [PATCH] paths: return an absolute default socket path on Android Android has no /var, so DefaultTailscaledSocket fell through to the cwd-relative "tailscaled.sock": the daemon created its socket wherever it was started and the CLI looked for one wherever it was started, and the two only agreed by coincidence (reproduced on Termux in #21161). Return os.TempDir()/tailscaled.sock on Android - the shared per-app temp directory, following the same pattern as the existing QNAP /tmp default - so daemon and CLI agree on an absolute path. Fixes #21161 Signed-off-by: breken --- paths/paths.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/paths/paths.go b/paths/paths.go index 398d8b23d..43e497ff8 100644 --- a/paths/paths.go +++ b/paths/paths.go @@ -31,6 +31,14 @@ func DefaultTailscaledSocket() string { if runtime.GOOS == "plan9" { return "/srv/tailscaled.sock" } + if runtime.GOOS == "android" { + // Android (e.g. a userspace tailscaled under Termux) has no /var, + // and the cwd-relative fallback below only works when the daemon + // and the CLI happen to be started from the same directory + // (see #21161). Use the shared per-app temp directory so both + // agree on an absolute path. + return filepath.Join(os.TempDir(), "tailscaled.sock") + } switch distro.Get() { case distro.Synology: if distro.DSMVersion() == 6 {