summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-dns/nsd/files
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-dns/nsd/files')
-rw-r--r--net-dns/nsd/files/nsd.initd53
-rw-r--r--net-dns/nsd/files/nsd.munin-conf2
-rw-r--r--net-dns/nsd/files/nsd.service14
-rw-r--r--net-dns/nsd/files/nsd3-patch.cron9
-rw-r--r--net-dns/nsd/files/nsd3.initd-r166
-rw-r--r--net-dns/nsd/files/nsd_munin_.patch17
6 files changed, 161 insertions, 0 deletions
diff --git a/net-dns/nsd/files/nsd.initd b/net-dns/nsd/files/nsd.initd
new file mode 100644
index 000000000000..b6eced79e546
--- /dev/null
+++ b/net-dns/nsd/files/nsd.initd
@@ -0,0 +1,53 @@
+#!/sbin/runscript
+# Copyright 1999-2013 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"
+
+# these can be overridden in /etc/conf.d/nsd if necessary
+NSD_CONFIG="${NSD_CONFIG:-/etc/nsd/nsd.conf}"
+NSD_BINARY="${NSD_BINARY:-/usr/sbin/nsd}"
+NSD_CHECKCONF="${NSD_CHECKCONF:-/usr/sbin/nsd-checkconf}"
+
+depend() {
+ need net
+ use logger
+}
+
+configtest() {
+ ebegin "Checking ${SVCNAME} configuration"
+ checkconfig
+ eend $?
+}
+
+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
+}
+
+start() {
+ ebegin "Starting NSD"
+ checkconfig || return $?
+ 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() {
+ ebegin "Stopping NSD"
+ checkconfig || return $?
+ local pidfile=$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}")
+ start-stop-daemon --stop --pidfile "${pidfile}"
+ eend $?
+}
diff --git a/net-dns/nsd/files/nsd.munin-conf b/net-dns/nsd/files/nsd.munin-conf
new file mode 100644
index 000000000000..2fbec370f336
--- /dev/null
+++ b/net-dns/nsd/files/nsd.munin-conf
@@ -0,0 +1,2 @@
+[nsd_munin*]
+user root
diff --git a/net-dns/nsd/files/nsd.service b/net-dns/nsd/files/nsd.service
new file mode 100644
index 000000000000..8337557faeef
--- /dev/null
+++ b/net-dns/nsd/files/nsd.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=NSD authoritative DNS server
+Wants=network.target
+After=network.target
+
+[Service]
+Type=forking
+ExecStartPre=/usr/bin/install -d -o nsd -g nsd /run/nsd
+ExecStart=/usr/sbin/nsd
+KillMode=mixed
+PIDFile=/run/nsd/nsd.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-dns/nsd/files/nsd3-patch.cron b/net-dns/nsd/files/nsd3-patch.cron
new file mode 100644
index 000000000000..ec27e4e95d4b
--- /dev/null
+++ b/net-dns/nsd/files/nsd3-patch.cron
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Cron job: merge zone transfer changes back to zone files
+# Needed for nsd3 only
+
+/etc/init.d/nsd --quiet status && /etc/init.d/nsd patch >/dev/null
diff --git a/net-dns/nsd/files/nsd3.initd-r1 b/net-dns/nsd/files/nsd3.initd-r1
new file mode 100644
index 000000000000..46a71489fd2c
--- /dev/null
+++ b/net-dns/nsd/files/nsd3.initd-r1
@@ -0,0 +1,66 @@
+#!/sbin/runscript
+# Copyright 1999-2013 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 patch"
+
+# these can be overridden in /etc/conf.d/nsd if necessary
+NSD_CONFIG="${NSD_CONFIG:-/etc/nsd/nsd.conf}"
+NSD_BINARY="${NSD_BINARY:-/usr/sbin/nsd}"
+NSD_CHECKCONF="${NSD_CHECKCONF:-/usr/sbin/nsd-checkconf}"
+NSDC_BINARY="${NSDC_BINARY:-/usr/sbin/nsdc}"
+
+depend() {
+ need net
+ use logger
+}
+
+configtest() {
+ ebegin "Checking ${SVCNAME} configuration"
+ checkconfig
+ eend $?
+}
+
+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
+}
+
+patch() {
+ local difffile=$(${NSD_CHECKCONF} -o difffile "${NSD_CONFIG}")
+ if ! test -s "${difffile}"; then
+ # no difffile found or difffile empty, so no patching required
+ return 0
+ fi
+ ebegin "Patching NSD zone files"
+ "${NSDC_BINARY}" patch >/dev/null
+ eend $?
+}
+
+start() {
+ ebegin "Starting NSD"
+ checkconfig || return $?
+ 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() {
+ ebegin "Stopping NSD"
+ checkconfig || return $?
+ local pidfile=$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}")
+ patch || return $?
+ start-stop-daemon --stop --pidfile "${pidfile}"
+ eend $?
+}
diff --git a/net-dns/nsd/files/nsd_munin_.patch b/net-dns/nsd/files/nsd_munin_.patch
new file mode 100644
index 000000000000..96902f4ed195
--- /dev/null
+++ b/net-dns/nsd/files/nsd_munin_.patch
@@ -0,0 +1,17 @@
+--- contrib/nsd_munin_.orig 2013-08-08 23:14:27.000000000 +0200
++++ contrib/nsd_munin_ 2013-08-08 23:41:24.000000000 +0200
+@@ -87,10 +87,10 @@
+
+ =cut
+
+-state=${statefile:-/usr/local/var/munin/plugin-state/nsd-state}
+-conf=${nsd_conf:-/usr/local/etc/nsd.conf}
+-ctrl=${nsd_control:-/usr/local/sbin/nsd-control}
+-chkconf=${nsd_checkconf:-/usr/local/sbin/nsd-checkconf}
++state=${statefile:-$MUNIN_PLUGSTATE/nsd-state}
++conf=${nsd_conf:-/etc/nsd/nsd.conf}
++ctrl=${nsd_control:-/usr/sbin/nsd-control}
++chkconf=${nsd_checkconf:-/usr/sbin/nsd-checkconf}
+ lock=$state.lock
+
+ # number of seconds between polling attempts.