From 709b0f58cf593f77684968438cb5359c087a31dd Mon Sep 17 00:00:00 2001 From: Paul Wouters Date: Nov 08 2007 16:21:14 +0000 Subject: - Added hourly cron job to do various maintenance tasks - Added nsd rebuild to create the proper nsd.db file on startup - Added nsd patch on shutdown to ensure zonefiles are up to date --- diff --git a/nsd.cron b/nsd.cron new file mode 100644 index 0000000..b4177f8 --- /dev/null +++ b/nsd.cron @@ -0,0 +1,16 @@ +#!/bin/sh + +# this folds back zone updates, dynamic updates, etc back into the +# zone files. + +# note that for very large zones (eg TLD's) you do not want to do this +# every hour. But for hosting a lot of small zones, it is useful. + +/usr/sbin/nsdc update > /dev/nul 2>%1 +/usr/sbin/nsdc patch > /dev/nul 2>%1 +/usr/sbin/nsdc rebuild > /dev/nul 2>%1 +/usr/sbin/nsdc reload > /dev/nul 2>%1 + +# nsd checks the serial in notify requests, so its better to send an +# occasional redundant notify, then to miss it +/usr/sbin/nsdc notify > /dev/nul 2>%1 diff --git a/nsd.init b/nsd.init index 34c39ed..304cf37 100755 --- a/nsd.init +++ b/nsd.init @@ -34,8 +34,8 @@ OTHER_NSD_OPTS="" [ ${NETWORKING} = "no" ] && exit 0 start() { - /usr/sbin/nsdc rebuild >/dev/null echo -n $"Starting nsd... " + /usr/sbin/nsdc rebuild >/dev/null 2>%1 nsd $OTHER_NSD_OPTS RETVAL=$? echo @@ -45,6 +45,8 @@ start() { stop() { echo -n $"Shutting down nsd services: " + # save state to zonefiles + /usr/sbin/nsdc patch > /dev/null 2>%1 killproc nsd RETVAL=$? if [ $RETVAL -eq 0 ] ; then diff --git a/nsd.spec b/nsd.spec index cb21f57..d544abd 100644 --- a/nsd.spec +++ b/nsd.spec @@ -1,11 +1,12 @@ Summary: NSD is a complete implementation of an authoritative DNS name server Name: nsd Version: 3.0.6 -Release: 5%{?dist} +Release: 6%{?dist} License: BSD-like Url: http://open.nlnetlabs.nl/nsd/ Source: http://open.nlnetlabs.nl/downloads/nsd/%{name}-%{version}.tar.gz Source1: nsd.init +Source2: nsd.cron Group: System Environment/Daemons BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: flex, openssl-devel @@ -32,6 +33,8 @@ consult the REQUIREMENTS document which is a part of this distribution rm -rf %{buildroot} %{__make} DESTDIR=%{buildroot} install install -d -m 0755 %{buildroot}%{_initrddir} +install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly +install -c -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/nsd install -m 0755 %{SOURCE1} %{buildroot}/%{_initrddir}/nsd install -d -m 0700 %{buildroot}%{_localstatedir}/run/%{name} install -d -m 0700 %{buildroot}%{_localstatedir}/lib/%{name} @@ -52,6 +55,7 @@ rm -rf ${RPM_BUILD_ROOT} %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/nsd/nsd.conf #%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/nsd/nsd.zones %attr(0755,root,root) %{_initrddir}/%{name} +%{_sysconfdir}/cron.hourly/nsd %attr(0755,%{name},%{name}) %dir %{_localstatedir}/run/%{name} %attr(0755,%{name},%{name}) %dir %{_localstatedir}/lib/%{name} %{_sbindir}/* @@ -77,6 +81,11 @@ if [ "$1" -ge "1" ]; then fi %changelog +* Wed Nov 7 2007 Paul Wouters - 3.0.6-6 +- Added hourly cron job to do various maintenance tasks +- Added nsd rebuild to create the proper nsd.db file on startup +- Added nsd patch on shutdown to ensure zonefiles are up to date + * Tue Oct 2 2007 Paul Wouters - 3.0.6-5 - nsdc update and nsdc notify are no longer needed in initscript.