paths, version/distro: detect Synology DSM version better, use for socket path
Resolves a TODO in the code noted while discussing QNAP defaults. Tested on DSM6 and DSM7. Change-Id: Icce03ff41fafd7b3a358cfee16f2ed13d5cc3c5d Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
5b8323509f
commit
b9dd3fa534
@ -30,15 +30,11 @@ func DefaultTailscaledSocket() string {
|
||||
}
|
||||
switch distro.Get() {
|
||||
case distro.Synology:
|
||||
// TODO(maisem): be smarter about this. We can parse /etc/VERSION.
|
||||
const dsm6Sock = "/var/packages/Tailscale/etc/tailscaled.sock"
|
||||
const dsm7Sock = "/var/packages/Tailscale/var/tailscaled.sock"
|
||||
if fi, err := os.Stat(dsm6Sock); err == nil && !fi.IsDir() {
|
||||
return dsm6Sock
|
||||
}
|
||||
if fi, err := os.Stat(dsm7Sock); err == nil && !fi.IsDir() {
|
||||
return dsm7Sock
|
||||
if distro.DSMVersion() == 6 {
|
||||
return "/var/packages/Tailscale/etc/tailscaled.sock"
|
||||
}
|
||||
// DSM 7 (and higher? or failure to detect.)
|
||||
return "/var/packages/Tailscale/var/tailscaled.sock"
|
||||
case distro.Gokrazy:
|
||||
return "/perm/tailscaled/tailscaled.sock"
|
||||
}
|
||||
|
Reference in New Issue
Block a user