mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
cmd/tailscale/cli: fix gokrazy CLI-as-a-service detection
The change in b7e48058c8
was too loose; it also captured the CLI
being run as a child process under cmd/tta.
Updates #13038
Updates #1866
Change-Id: Id410b87132938dd38ed4dd3959473c5d0d242ff5
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
adbab25bac
commit
f79e688e0d
@ -84,7 +84,7 @@ func CleanUpArgs(args []string) []string {
|
|||||||
|
|
||||||
// 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 {
|
if runtime.GOOS == "linux" && os.Getenv("GOKRAZY_FIRST_START") == "1" && distro.Get() == distro.Gokrazy && os.Getppid() == 1 {
|
||||||
// We're running on gokrazy and it's the first start.
|
// We're running on gokrazy and it's the first start.
|
||||||
// Don't run the tailscale CLI as a service; just exit.
|
// Don't run the tailscale CLI as a service; just exit.
|
||||||
// See https://gokrazy.org/development/process-interface/
|
// See https://gokrazy.org/development/process-interface/
|
||||||
|
Loading…
Reference in New Issue
Block a user