From f98706bdb30d35d05c3bc917890c0b025edaf83e Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 13 Jul 2020 08:59:01 -0700 Subject: [PATCH] paths, cmd/tailscaled: on Windows, don't try to migrate from legacy relay.conf Avoids confusing logspam on Windows. --- cmd/tailscaled/tailscaled.go | 2 +- paths/paths.go | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cmd/tailscaled/tailscaled.go b/cmd/tailscaled/tailscaled.go index d8fcccb64..a8db1b39e 100644 --- a/cmd/tailscaled/tailscaled.go +++ b/cmd/tailscaled/tailscaled.go @@ -126,7 +126,7 @@ func main() { Port: 41112, StatePath: *statepath, AutostartStateKey: globalStateKey, - LegacyConfigPath: paths.LegacyConfigPath, + LegacyConfigPath: paths.LegacyConfigPath(), SurviveDisconnects: true, DebugMux: debugMux, } diff --git a/paths/paths.go b/paths/paths.go index f9f354b28..9e583713a 100644 --- a/paths/paths.go +++ b/paths/paths.go @@ -11,9 +11,15 @@ import ( "runtime" ) -// LegacyConfigPath is the path used by the pre-tailscaled "relaynode" -// daemon's config file. -const LegacyConfigPath = "/var/lib/tailscale/relay.conf" +// LegacyConfigPath returns the path used by the pre-tailscaled +// "relaynode" daemon's config file. It returns the empty string for +// platforms where relaynode never ran. +func LegacyConfigPath() string { + if runtime.GOOS == "windows" { + return "" + } + return "/var/lib/tailscale/relay.conf" +} // DefaultTailscaledSocket returns the path to the tailscaled Unix socket // or the empty string if there's no reasonable default.