Subject: [alpine-aports] [PATCH] main/nsd: copy new version of the OpenRC service from Gentoo

From: Sören Tempel <[email-masked]>
Date: Thu, 17 Dec 2015 21:33:09 +0100

---
 main/nsd/APKBUILD  |  9 ++++-----
 main/nsd/nsd.initd | 27 ++++++++++++++-------------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/main/nsd/APKBUILD b/main/nsd/APKBUILD
index c53aebb..657d8cf 100644
--- a/main/nsd/APKBUILD
+++ b/main/nsd/APKBUILD
@@ -3,7 +3,7 @@
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=nsd
 pkgver=4.1.6
-pkgrel=0
+pkgrel=1
 pkgdesc="NSD is an authoritative only, high performance, simple and open source name server."
 url="http://www.nlnetlabs.nl/projects/nsd/"
 arch="all"
@@ -32,7 +32,6 @@ prepare() {
 
 build() {
 	cd "$_builddir"
-
 	./configure \
 		--build=$CBUILD \
 		--host=$CHOST \
@@ -67,8 +66,8 @@ doc() {
 }
 
 md5sums="607e0a2afa9365c96d981f2fd36942dc  nsd-4.1.6.tar.gz
-62301a021d2b2e1972625e56ea8138d1  nsd.initd"
+b3af3579bdccf072183f7311b5307011  nsd.initd"
 sha256sums="88f622055c95d38b9ef3723a240d1d0da35a28d09fe23b601015181a61d7775f  nsd-4.1.6.tar.gz
-8f9ca311a60e2a3db3fcc64b66cce2d6ff84b5600f47d5ece349d90926e90f27  nsd.initd"
+15e96b6738f51587ff9512b5d4bafd312ef77ccd1124009f7e7270558351935b  nsd.initd"
 sha512sums="c9bd4901e49a718ef435862d55a9c351586ecd4349c52d39ee18acf6ca33e3488eb581115fe6a99d0a1fd975117168d2756866429fc517ebe4713a211811333d  nsd-4.1.6.tar.gz
-402142ad1bb422a9a29ee8c7606bd513defa41563d47fb547812d4682862da5646022aa8c4577ed2d2a151388a12ec2f7b472e6a6091406859c0eb1f7f00c5b6  nsd.initd"
+080d30c18d4cc3077a7e2d773b7abedff454f6b5a9dd4994418eaab615587676f26e4e518f21a59b9cc95923a0d98611ce54a605c5638cea99d33d32f9395fc8  nsd.initd"
diff --git a/main/nsd/nsd.initd b/main/nsd/nsd.initd
index 6318204..2d3769b 100644
--- a/main/nsd/nsd.initd
+++ b/main/nsd/nsd.initd
@@ -1,19 +1,15 @@
-#!/sbin/openrc-run
+#!/sbin/runscript
 # Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dns/nsd/files/nsd.initd,v 1.2 2013/04/03 19:10:39 wschlich Exp $
 
-name="NSD"
 description="NSD is an authoritative-only, high performance, open source name server"
 extra_commands="configtest"
 
 # these can be overridden in /etc/conf.d/nsd if necessary
 NSD_CONFIG="${NSD_CONFIG:-/etc/nsd/nsd.conf}"
-command="${NSD_BINARY:-/usr/sbin/nsd}"
+NSD_BINARY="${NSD_BINARY:-/usr/sbin/nsd}"
 NSD_CHECKCONF="${NSD_CHECKCONF:-/usr/sbin/nsd-checkconf}"
 
-command_args="-c ${NSD_CONFIG}"
-
 depend() {
 	need net
 	use logger
@@ -37,15 +33,20 @@ checkconfig() {
 	return 0
 }
 
-start_pre() {
+start() {
+	ebegin "Starting NSD"
 	checkconfig || return $?
-	pidfile=$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}")
-	checkpath --directory --owner nsd:nsd "${pidfile%/*}"
+	local pidfile=$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}")
+	checkpath --directory --owner nsd:nsd $(dirname "${pidfile}")
+	start-stop-daemon --start --pidfile "${pidfile}" \
+		--exec "${NSD_BINARY}" -- -c "${NSD_CONFIG}"
+	eend $?
 }
 
-
-stop_pre() {
+stop() {
+	ebegin "Stopping NSD"
 	checkconfig || return $?
-	pidfile=$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}")
+	local pidfile=$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}")
+	start-stop-daemon --stop --pidfile "${pidfile}"
+	eend $?
 }
-
-- 
2.6.4

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---