rpms/nsd/devel nsd.cron,1.2,1.3 nsd.spec,1.26,1.27

Paul Wouters (pwouters) fedora-extras-commits at redhat.com
Thu Nov 8 19:35:10 UTC 2007


Author: pwouters

Update of /cvs/extras/rpms/nsd/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8783

Modified Files:
	nsd.cron nsd.spec 
Log Message:
* Thu Nov  8 2007 Paul Wouters <paul at xelerance.com> - 3.0.6-7
- Modified cron to only rebuild/reload when zone updates
  have been received



Index: nsd.cron
===================================================================
RCS file: /cvs/extras/rpms/nsd/devel/nsd.cron,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- nsd.cron	8 Nov 2007 16:47:42 -0000	1.2
+++ nsd.cron	8 Nov 2007 19:34:36 -0000	1.3
@@ -5,15 +5,23 @@
 # in the ixfr.db and nsd.db files back into the zone files or visa
 # versa
 
-# 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
 # Ideally check if ixfr.db newer then any zones, only then do
 /usr/sbin/nsdc patch > /dev/nul 2>%1
-# Ideally check if nsd.db newer then any zones, only then do
-/usr/sbin/nsdc rebuild > /dev/nul 2>%1
-/usr/sbin/nsdc reload > /dev/nul 2>%1
+
+# We try to only rebuild/reload when neccessary
+# every hour. But for hosting a lot of small zones, it is useful.
+
+for zonefile in `/usr/sbin/nsd-checkconf -v /etc/nsd/nsd.conf  |grep zonefile: | sed "s/^.*\"\(.*\)\"/\1/"`
+do
+	if [ $zonefile -nt /etc/nsd/nsd.db ]
+	then
+		echo "Zone $zonefile update requires nsd.db rebuild"
+		/usr/sbin/nsdc rebuild > /dev/nul 2>%1
+		/usr/sbin/nsdc reload > /dev/nul 2>%1
+		break
+	fi
+done
+
 
 # nsd checks the serial in notify requests, so its better to send an
 # occasional redundant notify, then to miss it.


Index: nsd.spec
===================================================================
RCS file: /cvs/extras/rpms/nsd/devel/nsd.spec,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- nsd.spec	8 Nov 2007 16:21:14 -0000	1.26
+++ nsd.spec	8 Nov 2007 19:34:36 -0000	1.27
@@ -1,7 +1,7 @@
 Summary: NSD is a complete implementation of an authoritative DNS name server
 Name: nsd
 Version: 3.0.6
-Release: 6%{?dist}
+Release: 7%{?dist}
 License: BSD-like
 Url: http://open.nlnetlabs.nl/nsd/
 Source: http://open.nlnetlabs.nl/downloads/nsd/%{name}-%{version}.tar.gz
@@ -42,6 +42,7 @@
 # change .sample to normal config files
 head -76 %{buildroot}%{_sysconfdir}/nsd/nsd.conf.sample > %{buildroot}%{_sysconfdir}/nsd/nsd.conf
 rm %{buildroot}%{_sysconfdir}/nsd/nsd.conf.sample 
+echo "database: /var/lib/nsd/nsd.db" >> %{buildroot}%{_sysconfdir}/nsd/nsd.conf
 echo "# include: \"/some/path/file\"" >> %{buildroot}%{_sysconfdir}/nsd/nsd.conf
 
 %clean
@@ -81,6 +82,10 @@
 fi
 
 %changelog
+* Thu Nov  8 2007 Paul Wouters <paul at xelerance.com> - 3.0.6-7
+- Modified cron to only rebuild/reload when zone updates
+  have been received
+
 * Wed Nov  7 2007 Paul Wouters <paul at xelerance.com> - 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




More information about the fedora-extras-commits mailing list