diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go index 029d2e45c..fa74cae3b 100644 --- a/control/controlclient/direct.go +++ b/control/controlclient/direct.go @@ -765,6 +765,10 @@ func (c *Direct) sendMapRequest(ctx context.Context, maxPolls int, cb func(*netm // being conservative here, if Debug not present set to False controlknobs.SetDisableUPnP(hasDebug && resp.Debug.DisableUPnP.EqualBool(true)) if hasDebug { + if code := resp.Debug.Exit; code != nil { + c.logf("exiting process with status %v per controlplane", *code) + os.Exit(*code) + } if resp.Debug.LogHeapPprof { go logheap.LogHeap(resp.Debug.LogHeapURL) } diff --git a/tailcfg/tailcfg.go b/tailcfg/tailcfg.go index 2bffe27e7..d895cdbb8 100644 --- a/tailcfg/tailcfg.go +++ b/tailcfg/tailcfg.go @@ -48,7 +48,8 @@ import ( // 22: 2021-06-16: added MapResponse.DNSConfig.ExtraRecords // 23: 2021-08-25: DNSConfig.Routes values may be empty (for ExtraRecords support in 1.14.1+) // 24: 2021-09-18: MapResponse.Health from control to node; node shows in "tailscale status" -const CurrentMapRequestVersion = 24 +// 25: 2021-11-01: MapResponse.Debug.Exit +const CurrentMapRequestVersion = 25 type StableID string @@ -1119,12 +1120,16 @@ type Debug struct { // fixed port. RandomizeClientPort bool `json:",omitempty"` - /// DisableUPnP is whether the client will attempt to perform a UPnP portmapping. + // DisableUPnP is whether the client will attempt to perform a UPnP portmapping. // By default, we want to enable it to see if it works on more clients. // // If UPnP catastrophically fails for people, this should be set to True to kill // new attempts at UPnP connections. DisableUPnP opt.Bool `json:",omitempty"` + + // Exit optionally specifies that the client should os.Exit + // with this code. + Exit *int `json:",omitempty"` } func appendKey(base []byte, prefix string, k [32]byte) []byte { diff --git a/version/version.go b/version/version.go index 0401f411f..72187611d 100644 --- a/version/version.go +++ b/version/version.go @@ -14,7 +14,7 @@ import ( // Long is a full version number for this build, of the form // "x.y.z-commithash", or "date.yyyymmdd" if no actual version was // provided. -var Long = "date.20211022" +var Long = "date.20211101" // Short is a short version number for this build, of the form // "x.y.z", or "date.yyyymmdd" if no actual version was provided.