Hello
the options logfile & log-only-syslog do not let me say "use STDERR only"
is this intended? How can I make sure, nsd never send data to /dev/log?
I can live with "is not implemented" but I wanted this to be asked...
Andreas
Hello
the options logfile & log-only-syslog do not let me say "use STDERR only"
is this intended? How can I make sure, nsd never send data to /dev/log?
I can live with "is not implemented" but I wanted this to be asked...
Andreas
Hi Andreas,
I think you can do that by setting log-only-log to false and setting
log-file to stderr. By default the log functions use the "log_file"
function and that's only updated if log-only-syslog is true or no value
is provided for log-file (nsd.c:1481).
Of course, stderr is lost once the daemon goes to the background, so
you might want to specify a filename depending on your situation.
- Jeroen
Hi Jeroen,
"log-only-log" isn't a documented option at https://nsd.docs.nlnetlabs.nl/en/latest/manpages/nsd.conf.html
and also not visible in the code: https://github.com/NLnetLabs/nsd/search?q=log-only-log
Andreas
Hi Andreas,
Sorry, that should've read log-only-syslog. Rest of my former answer
should still hold though. If log-only-syslog is false and a log-file is
set, then the log callback should remain unchanged, in which case
log_file(...) is called, which only logs to the specified file.
Based on the fact that "current_log_function" is "log_file" by default
and the if-else branch mention in the previous answer.
Let me know if the proposed config settings do the job.
- Jeroen
ok, got it:
1. logfile & log-only-syslog not set
-> log goes to stderr
-> log goes to /dev/log if available
2. logfile = /dev/stderr
log-only-syslog not set (or set to "no")
-> log goes to stderr
-> log *do not go* to /dev/log even if available
Version 2 (together with "nsd -d") is my intended mode of operation
Thanks!
Andreas