[Pdns-users] Docs for setting syslog facility
Brian Candler
b.candler at pobox.com
Mon Mar 13 09:55:57 UTC 2017
Hello,
I'm using pdns-recursor 4.0.4-1pdns.xenial from repo.powerdns.com
Following https://doc.powerdns.com/md/common/logging/ I tried to set
"logging-facility=0", but it had no effect. I could prove this by
stracing the rsyslogd process, seeing priority <30> = 3*8 + 6 = DAEMON +
INFO (RFC 3164 sec 4.1.1)
Checking the ps output:
pdns 24373 8.0 0.3 287348 15008 ? Ssl 09:19 0:00
/usr/sbin/pdns_recursor --daemon=no --write-pid=no --disable-syslog
Aha: so direct logging to syslog is disabled; systemd is capturing logs
from stdout and resending them to syslog; and so it requires some
systemd fu to fix this.
Perhaps some mention of this could be made at
https://doc.powerdns.com/md/common/logging/ ? It seems that the
official xenial package is overriding the documented default behaviour,
which is confusing.
Thanks,
Brian.
P.S. In the end I found the solution via:
http://askubuntu.com/questions/659267/how-do-i-override-or-configure-systemd-services
https://www.freedesktop.org/software/systemd/man/systemd.exec.html
# mkdir -p /etc/systemd/system/pdns-recursor.service.d
# cat <<EOS >/etc/systemd/system/pdns-recursor.service.d/override.conf
[Service]
SyslogFacility=local0
EOS
# systemctl daemon-reload
# systemctl restart pdns-recursor
(Note that this still isn't quite the same as logging directly to
syslog, since *all* messages are logged at 'info' level, regardless of
severity)
More information about the Pdns-users
mailing list