MCPcopy
hub / github.com/tailscale/tailscale / DefaultTailscaledSocket

Function DefaultTailscaledSocket

paths/paths.go:24–50  ·  view source on GitHub ↗

DefaultTailscaledSocket returns the path to the tailscaled Unix socket or the empty string if there's no reasonable default.

()

Source from the content-addressed store, hash-verified

22// DefaultTailscaledSocket returns the path to the tailscaled Unix socket
23// or the empty string if there's no reasonable default.
24func DefaultTailscaledSocket() string {
25 if runtime.GOOS == "windows" {
26 return `\\.\pipe\ProtectedPrefix\Administrators\Tailscale\tailscaled`
27 }
28 if runtime.GOOS == "darwin" {
29 return "/var/run/tailscaled.socket"
30 }
31 if runtime.GOOS == "plan9" {
32 return "/srv/tailscaled.sock"
33 }
34 switch distro.Get() {
35 case distro.Synology:
36 if distro.DSMVersion() == 6 {
37 return "/var/packages/Tailscale/etc/tailscaled.sock"
38 }
39 // DSM 7 (and higher? or failure to detect.)
40 return "/var/packages/Tailscale/var/tailscaled.sock"
41 case distro.Gokrazy:
42 return "/perm/tailscaled/tailscaled.sock"
43 case distro.QNAP:
44 return "/tmp/tailscale/tailscaled.sock"
45 }
46 if fi, err := os.Stat("/var/run"); err == nil && fi.IsDir() {
47 return "/var/run/tailscale/tailscaled.sock"
48 }
49 return "tailscaled.sock"
50}
51
52// Overridden in init by OS-specific files.
53var (

Callers 7

socketMethod · 0.92
systray.goFile · 0.92
initFunction · 0.92
mainFunction · 0.92
runLocalCredsFunction · 0.92
runSSHFunction · 0.92
cli.goFile · 0.92

Calls 4

GetFunction · 0.92
DSMVersionFunction · 0.92
StatMethod · 0.65
IsDirMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…