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.