From b7e48058c8d243adf1ff687e3e92d3fb02b035ea Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 13 Aug 2024 10:00:44 -0700 Subject: [PATCH] cmd/tailscale/cli: don't run CLI as a service on gokrazy Updates #13038 Updates #1866 Change-Id: Ie3223573044a92f5715a827fb66cc6705b38004f Signed-off-by: Brad Fitzpatrick --- cmd/tailscale/cli/cli.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/tailscale/cli/cli.go b/cmd/tailscale/cli/cli.go index 929b63958..6b0bb7957 100644 --- a/cmd/tailscale/cli/cli.go +++ b/cmd/tailscale/cli/cli.go @@ -84,6 +84,13 @@ var localClient = tailscale.LocalClient{ // Run runs the CLI. The args do not include the binary name. func Run(args []string) (err error) { + if runtime.GOOS == "linux" && os.Getenv("GOKRAZY_FIRST_START") == "1" && distro.Get() == distro.Gokrazy { + // We're running on gokrazy and it's the first start. + // Don't run the tailscale CLI as a service; just exit. + // See https://gokrazy.org/development/process-interface/ + os.Exit(0) + } + args = CleanUpArgs(args) if len(args) == 1 && (args[0] == "-V" || args[0] == "--version") {