public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in net-dns/nsd/files: nsd3.initd-r1 nsd3.initd
@ 2013-04-03 21:06 Wolfram Schlich (wschlich)
  0 siblings, 0 replies; only message in thread
From: Wolfram Schlich (wschlich) @ 2013-04-03 21:06 UTC (permalink / raw
  To: gentoo-commits

wschlich    13/04/03 21:06:18

  Added:                nsd3.initd-r1
  Removed:              nsd3.initd
  Log:
  fix typo in nsd3.initd
  
  (Portage version: 2.2.0_alpha170/cvs/Linux x86_64, unsigned Manifest commit)

Revision  Changes    Path
1.1                  net-dns/nsd/files/nsd3.initd-r1

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/nsd/files/nsd3.initd-r1?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/nsd/files/nsd3.initd-r1?rev=1.1&content-type=text/plain

Index: nsd3.initd-r1
===================================================================
#!/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/nsd3.initd-r1,v 1.1 2013/04/03 21:06:18 wschlich Exp $

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 $?
}





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-04-03 21:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-03 21:06 [gentoo-commits] gentoo-x86 commit in net-dns/nsd/files: nsd3.initd-r1 nsd3.initd Wolfram Schlich (wschlich)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox