From dec5d645931341f56c1a52b44dd0da9ed2eb99e0 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 14 Feb 2020 14:52:43 -0800 Subject: [PATCH] ipn/ipnserver: remove Options.AllowQuit. It was previously used by the MacOS client, but it now does something different. ipnserver should never obey a client's request to exit. Signed-off-by: David Anderson --- cmd/tailscaled/tailscaled.go | 1 - ipn/ipnserver/server.go | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/cmd/tailscaled/tailscaled.go b/cmd/tailscaled/tailscaled.go index 502f5ce9d..4b865e4e1 100644 --- a/cmd/tailscaled/tailscaled.go +++ b/cmd/tailscaled/tailscaled.go @@ -61,7 +61,6 @@ func main() { opts := ipnserver.Options{ StatePath: *statepath, SurviveDisconnects: true, - AllowQuit: false, } err = ipnserver.Run(context.Background(), logf, pol.PublicID.String(), opts, e) if err != nil { diff --git a/ipn/ipnserver/server.go b/ipn/ipnserver/server.go index e82086c0b..9d2964d85 100644 --- a/ipn/ipnserver/server.go +++ b/ipn/ipnserver/server.go @@ -31,7 +31,6 @@ import ( type Options struct { StatePath string SurviveDisconnects bool - AllowQuit bool } func pump(logf logger.Logf, ctx context.Context, bs *ipn.BackendServer, s net.Conn) { @@ -137,11 +136,8 @@ func Run(rctx context.Context, logf logger.Logf, logid string, opts Options, e w bs.Reset() s.Close() } - if opts.AllowQuit { - os.Exit(0) - } else { - bs.GotQuit = false - } + // Quitting not allowed, just keep going. + bs.GotQuit = false }(ctx, bs, s, i) bo.BackOff(ctx, nil)