From ec4d7215727d1ba7c9054a79ae714b241a780f2b Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 19 Jul 2021 14:14:24 -0700 Subject: [PATCH] cmd/tailscaled: use state key constant from ipn package Rather than redefining it again. Signed-off-by: Brad Fitzpatrick --- cmd/tailscaled/tailscaled.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cmd/tailscaled/tailscaled.go b/cmd/tailscaled/tailscaled.go index e708d9821..7f6615360 100644 --- a/cmd/tailscaled/tailscaled.go +++ b/cmd/tailscaled/tailscaled.go @@ -28,6 +28,7 @@ import ( "time" "github.com/go-multierror/multierror" + "tailscale.com/ipn" "tailscale.com/ipn/ipnserver" "tailscale.com/logpolicy" "tailscale.com/net/dns" @@ -45,15 +46,6 @@ import ( "tailscale.com/wgengine/router" ) -// globalStateKey is the ipn.StateKey that tailscaled loads on -// startup. -// -// We have to support multiple state keys for other OSes (Windows in -// particular), but right now Unix daemons run with a single -// node-global state. To keep open the option of having per-user state -// later, the global state key doesn't look like a username. -const globalStateKey = "_daemon" - // defaultTunName returns the default tun device name for the platform. func defaultTunName() string { switch runtime.GOOS { @@ -275,7 +267,7 @@ func run() error { SocketPath: args.socketpath, Port: 41112, StatePath: args.statepath, - AutostartStateKey: globalStateKey, + AutostartStateKey: ipn.GlobalDaemonStateKey, SurviveDisconnects: runtime.GOOS != "windows", DebugMux: debugMux, }