[radvd/f15/master] fixes #679830 - radvd dies when reloading, initscript reports "OK"

Jiri Skala jskala at fedoraproject.org
Mon Feb 28 13:22:26 UTC 2011


commit 12a1465dee6850dede2ed73726c4aab914dbc57a
Author: Jiri Skala <jskala at skalniknb.(none)>
Date:   Mon Feb 28 14:22:34 2011 +0100

    fixes #679830 - radvd dies when reloading, initscript reports "OK"

 radvd.init      |   15 ++++++++++++---
 radvd.spec      |    5 ++++-
 radvd.sysconfig |    4 ++++
 3 files changed, 20 insertions(+), 4 deletions(-)
---
diff --git a/radvd.init b/radvd.init
index d0ba2e3..fa2bd26 100644
--- a/radvd.init
+++ b/radvd.init
@@ -12,7 +12,7 @@
 #		based on these advertisements.
 #
 # processname: radvd
-# pidfile: /var/run/radvd.pid
+# pidfile: /var/run/radvd/radvd.pid
 # config: /etc/radvd.conf
 # config: /etc/sysconfig/radvd
 
@@ -32,6 +32,7 @@
 RETVAL=0
 PROG="radvd"
 LOCKFILE=/var/lock/subsys/radvd
+PIDFILE=${PIDFILE:-"/var/run/radvd/radvd.pid"}
 
 # See how we were called.
 case "$1" in
@@ -73,9 +74,17 @@ case "$1" in
 	RETVAL=$?
 	;;
   reload|force-reload)
+	$PROG -c
+        RETVAL=$?
 	echo -n $"Reloading $PROG: "
-	killproc radvd -HUP
-	RETVAL=$?	
+	if [ $RETVAL -eq 0 ]; then
+		killproc -p $PIDFILE radvd -HUP
+		RETVAL=$?
+	else
+		echo_failure
+		echo
+                echo -n $"not reloading due to configuration syntax error"
+	fi
 	echo
 	;;
   condrestart|try-restart)
diff --git a/radvd.spec b/radvd.spec
index 1d5a262..501ca1a 100644
--- a/radvd.spec
+++ b/radvd.spec
@@ -4,7 +4,7 @@
 Summary:    A Router Advertisement daemon
 Name:       radvd
 Version:    1.7
-Release:    2%{?dist}
+Release:    3%{?dist}
 # The code includes the advertising clause, so it's GPL-incompatible
 License:    BSD with advertising
 Group:      System Environment/Daemons
@@ -109,6 +109,9 @@ exit 0
 %{_sbindir}/radvdump
 
 %changelog
+* Mon Feb 28 2011 Jiri Skala <jskala at redhat.com> - 1.7-3
+- fixes #679830 - radvd dies when reloading, initscript reports "OK"
+
 * Mon Feb 28 2011 Jiri Skala <jskala at redhat.com> - 1.7-2
 - fixes #679821 - provides native systemd service file
 
diff --git a/radvd.sysconfig b/radvd.sysconfig
index 04cc5f6..ec9e270 100644
--- a/radvd.sysconfig
+++ b/radvd.sysconfig
@@ -1,5 +1,9 @@
 # $Id: radvd.sysconfig,v 1.1 2004/09/09 11:04:01 cvsdist Exp $
 
+# use PIDFILE variable if you want override pid file (-p $PIDFILE)
+# $PIDFILE is used by reload command. 
+PIDFILE="/var/run/radvd/radvd.pid"
+
 # No chroot; /var/run/radvd must be owned by -u.
 OPTIONS="-u radvd"
 


More information about the scm-commits mailing list