ports/143086: [PATCH] net/quagga rc script always returns status 0

Emil Smolenski am at raisa.eu.org
Fri Jan 22 16:00:10 UTC 2010


>Number:         143086
>Category:       ports
>Synopsis:       [PATCH] net/quagga rc script always returns status 0
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 22 16:00:09 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Emil Smolenski
>Release:        FreeBSD 8.0-STABLE
>Organization:
>Environment:
FreeBSD 8.0-STABLE i386
>Description:
/usr/local/etc/rc.d/quagga script always returns 0, regardless of actual status of quagga daemons. It should return non-zero when one or more of quagga daemons don't work. This bug breaks applications such as heartbeat which depend on the onestatus command.
>How-To-Repeat:
# /usr/local/etc/rc.d/quagga onestatus
zebra is not running.
bgpd is not running.
# echo $?
0
>Fix:
Apply the attached patch.

Patch attached with submission follows:

diff -ruN quagga.bak/files/quagga.sh.in quagga/files/quagga.sh.in
--- quagga.bak/files/quagga.sh.in	2009-12-14 17:40:52.000000000 +0100
+++ quagga/files/quagga.sh.in	2010-01-20 11:34:22.000000000 +0100
@@ -54,6 +54,8 @@
 
 do_cmd()
 {
+	local ret
+	ret=0
 	for daemon in ${quagga_daemons}; do
 	    command=%%PREFIX%%/sbin/${daemon}
 	    required_files=%%SYSCONF_DIR%%/${daemon}.conf
@@ -66,9 +68,10 @@
 	    fi
 	    eval flags=\$\{${daemon}_flags:-\"${quagga_flags}\"\}
 	    name=${daemon}
-	    run_rc_command "$1"
 	    _rc_restart_done=false
+	    run_rc_command "$1" || ret=1
 	done
+	return ${ret}
 }
 
 # set defaults


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list