From 4151fe8f1774ab0b64570ce44dfc6f0f116edf2e Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Mon, 16 Dec 2024 12:49:57 +0100 Subject: [PATCH] Fix dnsmasq logging to syslog as well as stderr --- go/daemon/children/dnsmasq.go | 11 +++++++++-- tasks/{v0.0.3 => soon}/code/nebula-cert-groups.md | 0 tasks/v0.0.3/code/dnsmasq-logging-fix.md | 8 -------- 3 files changed, 9 insertions(+), 10 deletions(-) rename tasks/{v0.0.3 => soon}/code/nebula-cert-groups.md (100%) delete mode 100644 tasks/v0.0.3/code/dnsmasq-logging-fix.md diff --git a/go/daemon/children/dnsmasq.go b/go/daemon/children/dnsmasq.go index c32188c..5fbf0cc 100644 --- a/go/daemon/children/dnsmasq.go +++ b/go/daemon/children/dnsmasq.go @@ -68,8 +68,15 @@ func dnsmasqPmuxProc( } cfg := pmuxlib.ProcessConfig{ - Cmd: filepath.Join(binDirPath, "dnsmasq"), - Args: []string{"-d", "-C", confPath}, + Cmd: filepath.Join(binDirPath, "dnsmasq"), + Args: []string{ + // Don't daemonize. The docs say to use --keep-in-foreground in + // production, and that this flag is for debugging only, but only + // with this flag will sigint work as expected. + "--no-daemon", + "--log-facility=-", // Log only to stderr + "-C", confPath, + }, } cfg = withPmuxLoggers(ctx, logger, "dnsmasq", cfg) diff --git a/tasks/v0.0.3/code/nebula-cert-groups.md b/tasks/soon/code/nebula-cert-groups.md similarity index 100% rename from tasks/v0.0.3/code/nebula-cert-groups.md rename to tasks/soon/code/nebula-cert-groups.md diff --git a/tasks/v0.0.3/code/dnsmasq-logging-fix.md b/tasks/v0.0.3/code/dnsmasq-logging-fix.md deleted file mode 100644 index 9e1ce1d..0000000 --- a/tasks/v0.0.3/code/dnsmasq-logging-fix.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -type: task ---- - -# Fix dnsmasq Logging Capture - -The dnsmasq process's logging is not being captured into mlog, but instead is -being written directly to stdout/stderr.