net-dns/nsd-4.1.6
This commit is contained in:
53
net-dns/nsd/files/nsd.initd
Normal file
53
net-dns/nsd/files/nsd.initd
Normal file
@@ -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 $?
|
||||
}
|
||||
2
net-dns/nsd/files/nsd.munin-conf
Normal file
2
net-dns/nsd/files/nsd.munin-conf
Normal file
@@ -0,0 +1,2 @@
|
||||
[nsd_munin*]
|
||||
user root
|
||||
14
net-dns/nsd/files/nsd.service
Normal file
14
net-dns/nsd/files/nsd.service
Normal file
@@ -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
|
||||
17
net-dns/nsd/files/nsd_munin_.patch
Normal file
17
net-dns/nsd/files/nsd_munin_.patch
Normal file
@@ -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.
|
||||
Reference in New Issue
Block a user