|
|
@ -111,10 +111,22 @@ func logsDir() string {
|
|
|
|
return filepath.Join(cacheDir, "Tailscale")
|
|
|
|
return filepath.Join(cacheDir, "Tailscale")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// No idea where to put stuff. This only happens when $HOME is
|
|
|
|
// Use the current working directory, unless we're being run by a
|
|
|
|
// unset, which os.UserCacheDir doesn't like. Use the current
|
|
|
|
// service manager that sets it to /.
|
|
|
|
// working directory and hope for the best.
|
|
|
|
wd, err := os.Getwd()
|
|
|
|
return ""
|
|
|
|
if err == nil && wd != "/" {
|
|
|
|
|
|
|
|
return wd
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// No idea where to put stuff. Try to create a temp dir. It'll
|
|
|
|
|
|
|
|
// mean we might lose some logs and rotate through log IDs, but
|
|
|
|
|
|
|
|
// it's something.
|
|
|
|
|
|
|
|
tmp, err := ioutil.TempDir("", "tailscaled-log-*")
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
panic("no safe place found to store log state")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return tmp
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// runningUnderSystemd reports whether we're running under systemd.
|
|
|
|
// runningUnderSystemd reports whether we're running under systemd.
|
|
|
|