From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7886E1381F1 for ; Wed, 24 Aug 2016 15:59:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AC31721C098; Wed, 24 Aug 2016 15:59:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 39A5D21C098 for ; Wed, 24 Aug 2016 15:59:39 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BE247340961 for ; Wed, 24 Aug 2016 15:59:37 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CE9587A for ; Wed, 24 Aug 2016 15:59:34 +0000 (UTC) From: "Lars Wendler" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Lars Wendler" Message-ID: <1472054370.b4926dc5f401a6ff15fc6e4facfffd90bdc25cc9.polynomial-c@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/nsd/, net-dns/nsd/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-dns/nsd/files/nsd.initd-r1 net-dns/nsd/nsd-4.1.11.ebuild X-VCS-Directories: net-dns/nsd/files/ net-dns/nsd/ X-VCS-Committer: polynomial-c X-VCS-Committer-Name: Lars Wendler X-VCS-Revision: b4926dc5f401a6ff15fc6e4facfffd90bdc25cc9 X-VCS-Branch: master Date: Wed, 24 Aug 2016 15:59:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4c4a5b01-9b36-4da8-9fb3-c0d0102c500c X-Archives-Hash: 2beb88c29a798a3f4179f11da34df4d2 commit: b4926dc5f401a6ff15fc6e4facfffd90bdc25cc9 Author: Lars Wendler gentoo org> AuthorDate: Wed Aug 24 15:59:18 2016 +0000 Commit: Lars Wendler gentoo org> CommitDate: Wed Aug 24 15:59:30 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4926dc5 net-dns/nsd: Added partially rewritten init scrip with "reload" target. Package-Manager: portage-2.3.0 Signed-off-by: Lars Wendler gentoo.org> net-dns/nsd/files/nsd.initd-r1 | 58 ++++++++++++++++++++++++++++++++++++++++++ net-dns/nsd/nsd-4.1.11.ebuild | 2 +- 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/net-dns/nsd/files/nsd.initd-r1 b/net-dns/nsd/files/nsd.initd-r1 new file mode 100755 index 00000000..3f71e76 --- /dev/null +++ b/net-dns/nsd/files/nsd.initd-r1 @@ -0,0 +1,58 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +description="NSD is an authoritative-only, high performance, open source name server" +extra_commands="configtest" +extra_started_commands="reload" + +# these can be overridden in /etc/conf.d/nsd if necessary +NSD_CONFIG="${NSD_CONFIG:-/etc/nsd/nsd.conf}" +NSD_CHECKCONF="${NSD_CHECKCONF:-/usr/sbin/nsd-checkconf}" +command="${NSD_BINARY:-/usr/sbin/nsd}" +command_args="-c ${NSD_CONFIG}" + +depend() { + need net + use logger +} + +get_pidfile() { + printf '%s' "$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}")" +} + +checkconfig() { + if ! test -e "${NSD_CONFIG}"; then + eerror "You need to create an appropriate config file." + eerror "An example can be found in /etc/nsd/nsd.conf.sample" + return 1 + elif ! "${NSD_CHECKCONF}" "${NSD_CONFIG}"; then + eerror "You have errors in your configfile (${NSD_CONFIG})" + return $? + fi + return 0 +} + +configtest() { + ebegin "Checking ${SVCNAME} configuration" + checkconfig + eend $? +} + +start_pre() { + checkconfig || return $? + checkpath --directory --owner nsd:nsd $(dirname "${pidfile}") + pidfile="$(get_pidfile)" +} + +stop_pre() { + checkconfig || return $? + pidfile="$(get_pidfile)" +} + +reload() { + ebegin "Reloading config and zone files" + kill -s HUP $(cat ${pidfile}) + eend $? +} diff --git a/net-dns/nsd/nsd-4.1.11.ebuild b/net-dns/nsd/nsd-4.1.11.ebuild index 59948d2..3719d0f 100644 --- a/net-dns/nsd/nsd-4.1.11.ebuild +++ b/net-dns/nsd/nsd-4.1.11.ebuild @@ -67,7 +67,7 @@ src_install() { dodoc doc/{ChangeLog,CREDITS,NSD-4-features,NSD-FOR-BIND-USERS,README,RELNOTES,REQUIREMENTS} - newinitd "${FILESDIR}"/nsd.initd nsd + newinitd "${FILESDIR}"/nsd.initd-r1 nsd # install munin plugin and config if use munin ; then