summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@tailscale.com>2022-03-01 20:17:31 -0800
committerBrad Fitzpatrick <brad@danga.com>2022-03-01 20:35:18 -0800
commitf18bb6397be81ad316fbc2905ab315cc1644bb3d (patch)
tree5a164b6e5b7619cf4ad0dfa24189893643176494
parentdb85384f9c751a330933486445d9e93b82873f77 (diff)
downloadtailscale-f18bb6397be81ad316fbc2905ab315cc1644bb3d.tar.xz
tailscale-f18bb6397be81ad316fbc2905ab315cc1644bb3d.zip
cmd/tailscale: tell gokrazy to not manage the CLI as a daemon
In the future we'll probably want to run the "tailscale web" server instead, but for now stop the infinite restart loop. See https://gokrazy.org/userguide/process-interface/ for details. Updates #1866 Change-Id: I4133a5fdb859b848813972620495865727fe397a Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
-rw-r--r--cmd/tailscale/cli/cli.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/tailscale/cli/cli.go b/cmd/tailscale/cli/cli.go
index 7cc4e2778..adf1e90f2 100644
--- a/cmd/tailscale/cli/cli.go
+++ b/cmd/tailscale/cli/cli.go
@@ -129,6 +129,13 @@ func Run(args []string) error {
if len(args) == 1 && (args[0] == "-V" || args[0] == "--version") {
args = []string{"version"}
}
+ if runtime.GOOS == "linux" && distro.Get() == distro.Gokrazy && len(args) == 0 &&
+ os.Getenv("GOKRAZY_FIRST_START") == "1" {
+ // Exit with 125 otherwise the CLI binary is restarted
+ // forever in a loop by the Gokrazy process supervisor.
+ // See https://gokrazy.org/userguide/process-interface/
+ os.Exit(125)
+ }
var warnOnce sync.Once
tailscale.SetVersionMismatchHandler(func(clientVer, serverVer string) {