mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-07 08:07:42 +00:00
logpolicy: put QNAP logs buffer in /tmp
Ongoing log writing keeps the spinning disks from hibernating. Extends earlier implementation for Synology to also handle QNAP. Signed-off-by: Denton Gentry <dgentry@tailscale.com>
This commit is contained in:
parent
f85bb60eba
commit
7fd03ad4b4
@ -551,12 +551,12 @@ func New(collection string) *Policy {
|
|||||||
}
|
}
|
||||||
filchPrefix := filepath.Join(dir, cmdName)
|
filchPrefix := filepath.Join(dir, cmdName)
|
||||||
|
|
||||||
// Synology disks cannot hibernate if we're writing logs to them all the time.
|
// NAS disks cannot hibernate if we're writing logs to them all the time.
|
||||||
// https://github.com/tailscale/tailscale/issues/3551
|
// https://github.com/tailscale/tailscale/issues/3551
|
||||||
if runtime.GOOS == "linux" && distro.Get() == distro.Synology {
|
if runtime.GOOS == "linux" && (distro.Get() == distro.Synology || distro.Get() == distro.QNAP) {
|
||||||
synologyTmpfsLogs := "/tmp/tailscale-logs"
|
tmpfsLogs := "/tmp/tailscale-logs"
|
||||||
if err := os.MkdirAll(synologyTmpfsLogs, 0755); err == nil {
|
if err := os.MkdirAll(tmpfsLogs, 0755); err == nil {
|
||||||
filchPrefix = filepath.Join(synologyTmpfsLogs, cmdName)
|
filchPrefix = filepath.Join(tmpfsLogs, cmdName)
|
||||||
filchOptions.MaxFileSize = 1 << 20
|
filchOptions.MaxFileSize = 1 << 20
|
||||||
} else {
|
} else {
|
||||||
// not a fatal error, we can leave the log files on the spinning disk
|
// not a fatal error, we can leave the log files on the spinning disk
|
||||||
|
Loading…
x
Reference in New Issue
Block a user