Dear All, I have recently shifted my Authoritative DNS server from very old TinyDNS to NSD. Presently it is in a very primitive stage, but working absolutely fine. I have installed NSD on Debian Testing because I could find a relatively newer version of NSD on Debian Testing. I am running the NSD version 4.5.0. I am enabling the NSD logging to /var/log/nsd.log. When I check the status of the NSD demon by "systemctl status nsd", I get the following error message. Jun 18 20:39:02 ns1 systemd[1]: Starting Name Server Daemon... Jun 18 20:39:02 ns1 nsd[1884]: [2022-06-18 20:39:02.460] nsd[1884]: error: Cannot open /var/log/nsd.log for appending (Permission denied), logging to stderr Jun 18 20:39:02 ns1 nsd[1884]: [2022-06-18 20:39:02.460] nsd[1884]: warning: chown /var/log/nsd.log failed: Read-only file system Jun 18 20:39:02 ns1 nsd[1884]: [2022-06-18 20:39:02.460] nsd[1884]: notice: nsd starting (NSD 4.5.0) Jun 18 20:39:02 ns1 nsd[1885]: [2022-06-18 20:39:02.607] nsd[1885]: notice: nsd started (NSD 4.5.0), pid 1884 Jun 18 20:39:02 ns1 systemd[1]: Started Name Server Daemon. Although the NSD service starts properly, logging is not working. I want to enable logging for the NSD replication, which is not installed as yet. I want to know what can be the solution to this problem? Whether this is related to the Debian Testing and will work fine on Debian stable. Should I use another distribution (Rocky) for NSD, which won't have this problem. If somebody has faced the similar problem, or has any suggestions related to the above problem, it will be of great help to me. Thank you all. Mukul -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.nlnetlabs.nl/pipermail/nsd-users/attachments/20220618/11cb7e07/attachment.htm>
Am 18.06.22 um 17:21 schrieb Mukul Shukla via nsd-users:> Dear All, > > I have recently shifted my Authoritative DNS server from very old TinyDNS to NSD. Presently it is in a very primitive stage, but? working? absolutely fine. > > I have installed NSD on Debian Testing because I could find a relatively newer version of NSD on Debian Testing. I am running the NSD version 4.5.0. I am enabling the NSD logging? to /var/log/nsd.log. When I check the status of the NSD demon by "systemctl status nsd", I get the following error message. > > Jun 18 20:39:02 ns1 systemd[1]: Starting Name Server Daemon... > Jun 18 20:39:02 ns1 nsd[1884]: [2022-06-18 20:39:02.460] nsd[1884]: error: Cannot open /var/log/nsd.log for appending (Permission denied), logging to stderr > Jun 18 20:39:02 ns1 nsd[1884]: [2022-06-18 20:39:02.460] nsd[1884]: warning: chown /var/log/nsd.log failed: Read-only file system > Jun 18 20:39:02 ns1 nsd[1884]: [2022-06-18 20:39:02.460] nsd[1884]: notice: nsd starting (NSD 4.5.0) > Jun 18 20:39:02 ns1 nsd[1885]: [2022-06-18 20:39:02.607] nsd[1885]: notice: nsd started (NSD 4.5.0), pid 1884 > Jun 18 20:39:02 ns1 systemd[1]: Started Name Server Daemon.Hello, I assume a fault in the systemd unit file. see https://sources.debian.org/src/nsd/4.5.0-1/debian/nsd.service/#L22 Maybe /var/log is missing there. You may try to let NSD log to /run ( which may not be /run on your system ) Or you try to start NSD without systemd: /usr/sbin/nsd -d -c /path/to/nsd.conf and make sure, no logfile is set so NSD log to STDOUT Andreas
Hi Mukul, On 2022-06-18 11:21, Mukul Shukla via nsd-users wrote:> Dear All, > > I have recently shifted my Authoritative DNS server from very old TinyDNS > to NSD. Presently it is in a very primitive stage, but working absolutely > fine. > > I have installed NSD on Debian Testing because I could find a relatively > newer version of NSD on Debian Testing. I am running the NSD version 4.5.0. > I am enabling the NSD logging to /var/log/nsd.log. When I check the status > of the NSD demon by "systemctl status nsd", I get the following error > message. > > Jun 18 20:39:02 ns1 systemd[1]: Starting Name Server Daemon... > Jun 18 20:39:02 ns1 nsd[1884]: [2022-06-18 20:39:02.460] nsd[1884]: error: > Cannot open /var/log/nsd.log for appending (Permission denied), logging to > stderr > Jun 18 20:39:02 ns1 nsd[1884]: [2022-06-18 20:39:02.460] nsd[1884]: > warning: chown /var/log/nsd.log failed: Read-only file systemThe systemd unit shipped by Debian assumes default logging to syslog. As such, the systemd unit needs to be edit if you want file logging: sudo systemctl edit nsd # will open $EDITOR Then put the following and save: # Allow file logging to dedicated dir ReadWritePaths=/var/log/nsd And create the directory and restart NSD: sudo mkdir /var/log/nsd sudo chown nsd: /var/log/nsd sudo systemctl restart nsd The above has NSD log to a subdirectory as it is safer than granting write access to all /var/log. HTH, Simon