After stopping nsd daemon, its pidfile can't be removed since nsd is not running as root and pidfile is inside root-owned /var/run directory. One solution would be to use the same technique as used in bind, by storing pidfile in separate directory inside /var/run that would be owned by the same user that nsd uses when running.
Also after stopping nsd daemon, it can't store its xfrdfile and diffile inside default /var/db/nsd directory since it's root-owned and nsd is not running as root. The solution is to chown nsd's database directory to the same user that nsd uses when running. The nsd port used to perform chown until port version 3.2.2 when that part was removed from makefile.
It would be nice if nsd startup script would read pidfile location from nsd's configuration file, because if pidfile location is changed (i.e. due to chroot config), startup script would need to be edited by hand, because pidfile location is hard coded.
I've provided patch that fixes above mentioned permission related issues and also modifies nsd startup script to read pidfile location from nsd's configuration.
Fix: Apply the suggested patch file.
Patch attached with submission follows:
How-To-Repeat: [root@vmbsd]:/root> /usr/local/etc/rc.d/nsd start
[root@vmbsd]:/root> /usr/local/etc/rc.d/nsd stop
Merging nsd zone transfer changes to zone files.
nsdc: no patch necessary.
[root@vmbsd]:/root> tail -n 3 /var/log/messages
Feb 4 11:25:11 vmbsd nsd: signal received, shutting down...
Feb 4 11:25:11 vmbsd nsd: failed to unlink pidfile /var/run/nsd.pid: Permission denied
Feb 4 11:25:11 vmbsd nsd: xfrd: Could not open file /var/db/nsd/xfrd.state for writing: Permission denied
Maintainer of dns/nsd,
Please note that PR ports/143550 has just been submitted.
If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.
The full text of the PR can be found at:
Edwin Groothuis via the GNATS Auto Assign Tool
Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
I'll take it.
Maintainer has approved.
pgollucci 2010-02-11 19:37:10 UTC
FreeBSD ports repository
dns/nsd Makefile pkg-message pkg-plist
dns/nsd/files pkg-deinstall.in pkg-install.in
- Fix permission issues
Submitted by: Marko Njezic <firstname.lastname@example.org>
Approved by: Olafur Osvaldsson <email@example.com> (maintainer)
Revision Changes Path
1.46 +15 -2 ports/dns/nsd/Makefile
1.5 +2 -2 ports/dns/nsd/files/nsd.in
1.1 +16 -0 ports/dns/nsd/files/pkg-deinstall.in (new)
1.1 +19 -0 ports/dns/nsd/files/pkg-install.in (new)
1.2 +4 -0 ports/dns/nsd/pkg-message
1.8 +1 -1 ports/dns/nsd/pkg-plist
firstname.lastname@example.org mailing list
To unsubscribe, send any mail to "email@example.com"