cmd/tailscaled: use state key constant from ipn package

Rather than redefining it again.

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/2460/head
Brad Fitzpatrick 3 years ago
parent e2eaae8224
commit ec4d721572

@ -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,
}

Loading…
Cancel
Save