[nsd] * Fri Jun 3 2011 Tuomo Soini <tis at foobar.fi> - 3.2.8-3 - fix init status to work as expected - fix

Paul Wouters pwouters at fedoraproject.org
Tue Jun 7 01:22:27 UTC 2011


commit e1c27bcf5a54855cc1581ff538a9cec43ff1725c
Author: Paul Wouters <paul at xelerance.com>
Date:   Mon Jun 6 21:24:20 2011 -0400

    * Fri Jun  3 2011 Tuomo Soini <tis at foobar.fi> - 3.2.8-3
    - fix init status to work as expected
    - fix nsd.conf and nsd.conf.5 to have correct logfile
    - fix nsd.init syntax error by piddir change
    - fix initscript to create /var/run/nsd if missing
    
    Signed-off-by: Paul Wouters <paul at xelerance.com>

 nsd.init |   11 +++++++++--
 nsd.spec |   12 ++++++++++--
 2 files changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/nsd.init b/nsd.init
index 51eb143..2c96ec6 100755
--- a/nsd.init
+++ b/nsd.init
@@ -24,6 +24,8 @@ NSD_PROG="/usr/sbin/nsd"
 NSD_PIDFILE="/var/run/nsd/nsd.pid"
 NSD_XFRDFILE="/var/lib/nsd/xfrd.state"
 NSDC_PROG="/usr/sbin/nsdc"
+NSD_PIDDIR=`dirname $NSD_PIDFILE`
+NSD_USER="nsd"
 
 # Source function library.
 . /etc/rc.d/init.d/functions
@@ -43,6 +45,11 @@ start() {
   # Sanity checks.
   [ -f $NSD_CONF ] || exit 5
   [ -x $NSD_PROG ] || exit 5
+  # /var/run could (and should) be tmpfs
+  [ -d $NSD_PIDDIR ] || {
+      mkdir -p $NSD_PIDDIR
+      chown $NSD_USER:$NSD_USER $NSD_PIDDIR
+  }
 
   echo -n $"Starting nsd:"
   $NSDC_PROG -c $NSD_CONF rebuild >/dev/null 2>&1
@@ -103,10 +110,10 @@ case "$1" in
         [ -f /var/lock/subsys/nsd ] && restart || :
 	;;
   status)
-	$NSDC_PROG -c $NSD_CONF running
+	status -p $NSD_PIDFILE $NSD_PROG
 	;;
   reload)
-	echo -n $"Rebuilding zonfiles:"
+	echo -n $"Rebuilding zonefiles:"
 	$NSDC_PROG -c $NSD_CONF rebuild >/dev/null 2>&1
         RETVAL=$?
         if [ $RETVAL -eq 0 ] ; then
diff --git a/nsd.spec b/nsd.spec
index dd5e1c5..e0f6585 100644
--- a/nsd.spec
+++ b/nsd.spec
@@ -1,7 +1,7 @@
 Summary: Fast and lean authoritative DNS Name Server
 Name: nsd
 Version: 3.2.8
-Release: 1%{?dist}
+Release: 3%{?dist}
 License: BSD
 Url: http://www.nlnetlabs.nl/%{name}/
 Source: http://www.nlnetlabs.nl/downloads/%{name}/%{name}-%{version}.tar.gz
@@ -9,6 +9,7 @@ Source1: nsd.init
 Source2: nsd.cron
 Source3: nsd.sysconfig
 Patch0: nsd-install.patch
+Patch1: nsd-fixlogfile.patch
 Group: System Environment/Daemons
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: flex, openssl-devel
@@ -23,6 +24,7 @@ consult the REQUIREMENTS document which is a part of this distribution
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %configure --enable-bind8-stats --enable-checking --enable-nsec3  \
@@ -46,7 +48,7 @@ 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 0755 %{buildroot}%{_localstatedir}/run/%{name}
 install -d -m 0700 %{buildroot}%{_localstatedir}/lib/%{name}
 install -d -m 0755 %{buildroot}%{_sysconfdir}/sysconfig
 install -m 0755 %{SOURCE3} %{buildroot}/%{_sysconfdir}/sysconfig/%{name}
@@ -96,6 +98,12 @@ if [ "$1" -ge "1" ]; then
 fi
 
 %changelog
+* Fri Jun  3 2011 Tuomo Soini <tis at foobar.fi> - 3.2.8-3
+- fix init status to work as expected
+- fix nsd.conf and nsd.conf.5 to have correct logfile
+- fix nsd.init syntax error by piddir change
+- fix initscript to create /var/run/nsd if missing
+
 * Sun Mar 27 2011 Paul Wouters <paul at xelerance.com> - 3.2.8-1
 - updated to 3.2.8
 


More information about the scm-commits mailing list