Logfile empty after logrotate

[found in a spam trap].

Hi,

I setup nsd to log i a separate logfile. I also setup logrotate.
After logrotate moved away the old logfile it sends a SIGHUP
killall -HUP nsd

But the logfile is not reopend by nsd.

How do I setup a daily rotated log ?

I also tried to run nsd nonforking with -d and get the log from stderr
This works as long nsd is a master

If nsd is setup as slave and receive an update from the master
then i found new nsd processes which are no longer childs of
the nsd -d process...

This makes it difficult to run nsd nder control of a supervisor
like djb's daemontools or runit

Thanks
Andreas

  [found in a spam trap].

Thanks for forwaring my mail to the list
I sent from an unsubscribed Account :frowning:

But the problem is current with 3.2.6
- running as daemon
- logging to a file
- logrotate moves the logfile away and send SIGHUP
- old logfile is still open ( verified with lsof )
- new logfile ( created with right permissions ) is still empty

What may I did wrong ??

Hi Andreas,

There are two possible causes I can come up with:
1. Is the logfile inside the chroot? If not, file rotation is disabled.
   Should not be an issue if you don't use chroot.

2. Did you reload nsd? The new log file is only reopened when reloading
   nsd.

Best regards,

Matthijs

There are two possible causes I can come up with:
1. Is the logfile inside the chroot? If not, file rotation is disabled.
   Should not be an issue if you don't use chroot.

no chrooting ...

2. Did you reload nsd? The new log file is only reopened when reloading
   nsd.

what do you exactly mean with "reloading" ?
nsdc reload also only gives nsd a sighup

andreas

I did mean nsdc reload yes.

Another possibility: nsd dropped privileges to user nsd and has no
permission to append to file anymore.

You might want to run nsd with a higher verbosity level (for example:
nsd -v 3) or configure nsd with --enable-checking and run nsd with a
higher debug level (for example: nsd -F 0xffff -L 3), to see what is
going on.

Best regards,

Matthijs

Another possibility: nsd dropped privileges to user nsd and has no
permission to append to file anymore.

I setup logging to a separate directory where the nsd user was writeaccess

# ls -ld /var/log/dnsblpub/
drwxr-x--- 2 nsd root 60 Oct 12 00:00 /var/log/dnsblpub/o

# grep ^logfile /etc/dnsblpub/nsd.conf
logfile: "/var/log/dnsblpub/log"

You might want to run nsd with a higher verbosity level (for example:
nsd -v 3) or configure nsd with --enable-checking and run nsd with a
higher debug level (for example: nsd -F 0xffff -L 3), to see what is
going on.

I will recompile any try...

how do other nsd-users run nsd?
Logging to syslog ?
No logging ?

Uhhhh,
my setup *was* chroot an ofcource the logfile *was*
outside the chroot.
I fixed the logfilelocation and all runs like documented.

Sorry for wasting your time...

Maybe the manpage can explain more detailed the chroot setup.

I learned that paths in nsd.conf must not relative to chroot
but contain the full patch to chroot + subdir + filename
The chrootpart of paths nsd strips internaly.

Sorry and Thanks !
Andreas