Commit 308055d7 authored by Matt Smith's avatar Matt Smith

testing/nsd: new aport

NSD is an authoritative only, high performance, simple and open source name server.
http://www.nlnetlabs.nl/projects/nsd/
parent 4fd3d2a1
This patch prevents nsd from attempting to unlink the pidfile on nsd
shutdown. The reason for this is because we get a permission denied
error in nsd.log when it attempts to do so.
I think this is needed because of how normal OpenRC init scripts are
designed and handled.
See the included /etc/init.d/nsd (nsd.initd) for my conversion of the
nsdc script that's normally distributed with nsd. The included nsdc
script is a wrapper for the converted OpenRC init script, designed to
maintain compatibility.
Matt Smith <msmith@alpinelinux.org>
--- a/server.c
+++ b/server.c
@@ -1167,7 +1167,7 @@
close(fd);
/* Unlink it if possible... */
- unlinkpid(nsd->pidfile);
+ //unlinkpid(nsd->pidfile);
if(reload_listener.fd > 0) {
sig_atomic_t cmd = NSD_QUIT;
# Contributor: Matt Smith <msmith@alpinelinux.org>
# Maintainer: Matt Smith <msmith@alpinelinux.org>
pkgname=nsd
pkgver=3.2.7
pkgrel=0
pkgdesc="NSD is an authoritative only, high performance, simple and open source name server."
url="http://www.nlnetlabs.nl/projects/nsd/"
arch="all"
license="BSD"
depends=
depends_dev=
makedepends="$depends_dev openssl-dev"
install="$pkgname.pre-install $pkgname.post-deinstall"
subpackages="$pkgname-doc"
pkgusers="nsd"
pkggroups="nsd"
source="http://www.nlnetlabs.nl/downloads/nsd/nsd-3.2.7.tar.gz
0010-stop-unlink-pid-error.patch
nsdc
nsd.initd
nsd.confd
"
_builddir="$srcdir/$pkgname-$pkgver"
prepare() {
local i
cd "$_builddir"
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
}
build() {
cd "$_builddir"
./configure \
--sbindir=/usr/sbin \
--mandir=/usr/share/man \
--with-user=nsd \
|| return 1
make || return 1
}
package() {
cd "$_builddir"
make DESTDIR="$pkgdir" install || return 1
install -m755 -D "$srcdir"/nsdc \
"$pkgdir"/usr/sbin/nsdc || return 1
install -m755 -D "$srcdir"/$pkgname.initd \
"$pkgdir"/etc/init.d/nsd || return 1
install -m644 -D "$srcdir"/$pkgname.confd \
"$pkgdir"/etc/conf.d/nsd || return 1
chown nsd:nsd "$pkgdir"/var/db/nsd
}
doc() {
arch="noarch"
mkdir -p "$subpkgdir"/usr/share/doc/$pkgname || return 1
cp -a "$_builddir"/doc/* \
"$subpkgdir"/usr/share/doc/$pkgname/ || return 1
cp -a "$_builddir"/contrib/ \
"$subpkgdir"/usr/share/doc/$pkgname/ || return 1
mv "$pkgdir"/usr/share/man \
"$subpkgdir"/usr/share/man || return 1
}
md5sums="b5aca8a207f77db566b08db25bf77d74 nsd-3.2.7.tar.gz
cc592572846b978a6f52130a8e518ab3 0010-stop-unlink-pid-error.patch
3aa94004a39319db89a329e9f24fb9da nsdc
4c0eef07caac9083aeeb9b15602d014d nsd.initd
37bd648259fdd919c79aaa0168b4423c nsd.confd"
#
# Specify nsd options here.
#
# configuration file default
configfile="/etc/nsd/nsd.conf"
# The directory where NSD binaries reside
sbindir="/usr/sbin"
# how verbose is zonec run. Specify Nothing (empty string), -v or -vv.
ZONEC_VERBOSE=-v
# how patch is done. Specify 1 (with use of textfiles, default) or 0 (without)
PATCH_STYLE=1
This diff is collapsed.
#!/bin/sh
deluser nsd 2>/dev/null
exit 0
#!/bin/sh
adduser -H -D -s /bin/false nsd 2>/dev/null
exit 0
#!/bin/sh
#
# nsdc replacement script by Matt Smith <msmith@alpinelinux.org>
#
usage() {
echo "Usage: `basename $0` {start|stop|reload|rebuild|restart|"
echo " running|update|notify|patch}"
echo "commands:"
echo " start Start nsd server."
echo " stop Stop nsd server."
echo " reload Nsd server reloads database file."
echo " rebuild Compile database file from zone files."
echo " restart Stop the nsd server and start it again."
echo " running Prints message and exit nonzero if server not running."
echo " update Try to update all slave zones hosted on this server."
echo " notify Send notify messages to all secondary servers."
echo " patch Merge zone transfer changes back to zone files."
}
if [ $# -eq 0 ]; then
usage
else
case "$1" in
"-h"|"--help")
usage;;
*)
/etc/init.d/nsd $*
esac
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment