summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhasufell <hasufell@gentoo.org>2013-03-08 21:09:51 +0100
committerhasufell <hasufell@gentoo.org>2013-03-08 21:09:51 +0100
commitc185dec2ad081a05837b73100973527f7a618d09 (patch)
tree0b9b69f23c69d2cebb607159e92da300a9a18f77 /net-dns/nsd/files/nsd.initd
parentmedia-video/ucview: fix metadata.xml (diff)
downloadsunrise-c185dec2ad081a05837b73100973527f7a618d09.tar.gz
sunrise-c185dec2ad081a05837b73100973527f7a618d09.tar.bz2
sunrise-c185dec2ad081a05837b73100973527f7a618d09.zip
net-dns/nsd in portage
Diffstat (limited to 'net-dns/nsd/files/nsd.initd')
-rw-r--r--net-dns/nsd/files/nsd.initd89
1 files changed, 0 insertions, 89 deletions
diff --git a/net-dns/nsd/files/nsd.initd b/net-dns/nsd/files/nsd.initd
deleted file mode 100644
index 1325420aa..000000000
--- a/net-dns/nsd/files/nsd.initd
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-#
-extra_commands="rebuild"
-extra_started_commands="reload"
-description="NSD is an authoritative only, high performance, open source name server"
-description_rebuild="Rebuild zone database"
-description_reload="Rebuild zone database and reload it"
-
-config_file=${config_file:-/etc/nsd/nsd.conf}
-my_nsdc="/usr/sbin/nsdc"
-my_nsd_checkconf="/usr/sbin/nsd-checkconf"
-
-depend() {
- need net
- use logger
- provide auth-dns
-}
-
-_checkconf() {
- if ! test -e "${config_file}"; then
- eerror "You need to create an appropriate config file."
- eerror "An example can be found in /etc/nsd/nsd.conf.sample"
- return 1
- fi
-
- if ! ${my_nsd_checkconf} "${config_file}"; then
- eerror "You have errors in your configfile (${config_file})"
- return 1
- fi
- return 0
-}
-
-_checkdb() {
- local database=$(${my_nsd_checkconf} -o database ${config_file})
- if ! test -f $database; then
- eerror "You have no database file in ${database}, will try to rebuild"
- rebuild
- fi
- return 0
-}
-
-_patch() {
- local difffile=$(${my_nsd_checkconf} -o difffile ${config_file})
- if test -s ${difffile}; then
- ebegin "Patching NSD zone files"
- ${my_nsdc} patch > /dev/null
- eend $?
- fi
-}
-
-rebuild() {
- ebegin "Rebuilding NSD zone database"
- if ! ${my_nsdc} rebuild > /dev/null; then
- eerror "There was an error rebuilding the database. Please review your zone files."
- return 1
- fi
- eend $?
-}
-
-start() {
- ebegin "Starting NSD"
-
- local pidfile=$(${my_nsd_checkconf} -o pidfile ${config_file})
- checkpath -d -o nsd:nsd $(dirname ${pidfile})
-
- _checkconf || return 1
- _checkdb || return 1
- ${my_nsdc} start
- ${my_nsdc} running
- eend $?
-}
-
-stop() {
- ebegin "Stopping NSD"
- _patch
- ${my_nsdc} stop
- eend $?
-}
-
-reload() {
- _checkconf || return 1
- rebuild || return 1
- ebegin "Reloading NSD zone database"
- ${my_nsdc} reload
- eend $?
-}