mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 13:18:53 +00:00
cmd/tailscale/cli: only exit silently if len(args) == 0
This amends commit b7e48058c8
.
That commit broke all documented ways of starting Tailscale on gokrazy:
https://gokrazy.org/packages/tailscale/ — both Option A (tailscale up)
and Option B (tailscale up --auth-key) rely on the tailscale CLI working.
I verified that the tailscale CLI just prints it help when started
without arguments, i.e. it does not stay running and is not restarted.
I verified that the tailscale CLI successfully exits when started with
tailscale up --auth-key, regardless of whether the node has joined
the tailnet yet or not.
I verified that the tailscale CLI successfully waits and exits when
started with tailscale up, as expected.
fixes https://github.com/gokrazy/gokrazy/issues/286
Signed-off-by: Michael Stapelberg <michael@stapelberg.de>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
6ccde369ff
commit
64ab0ddff1
@@ -84,9 +84,9 @@ var localClient = tailscale.LocalClient{
|
|||||||
|
|
||||||
// Run runs the CLI. The args do not include the binary name.
|
// Run runs the CLI. The args do not include the binary name.
|
||||||
func Run(args []string) (err error) {
|
func Run(args []string) (err error) {
|
||||||
if runtime.GOOS == "linux" && os.Getenv("GOKRAZY_FIRST_START") == "1" && distro.Get() == distro.Gokrazy && os.Getppid() == 1 {
|
if runtime.GOOS == "linux" && os.Getenv("GOKRAZY_FIRST_START") == "1" && distro.Get() == distro.Gokrazy && os.Getppid() == 1 && len(args) == 0 {
|
||||||
// We're running on gokrazy and it's the first start.
|
// We're running on gokrazy and the user did not specify 'up'.
|
||||||
// Don't run the tailscale CLI as a service; just exit.
|
// Don't run the tailscale CLI and spam logs with usage; just exit.
|
||||||
// See https://gokrazy.org/development/process-interface/
|
// See https://gokrazy.org/development/process-interface/
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user