svn commit: r379163 - in head/net/quagga: . files
Mathieu Arnold
mat at FreeBSD.org
Tue Feb 17 14:25:24 UTC 2015
Author: mat
Date: Tue Feb 17 14:25:23 2015
New Revision: 379163
URL: https://svnweb.freebsd.org/changeset/ports/379163
QAT: https://qat.redports.org/buildarchive/r379163/
Log:
Make quagga's rc script conform to the porter's handbook guidelines.
PR: 197036
Submitted by: Kozlov Sergey
Sponsored by: Absolight
Modified:
head/net/quagga/Makefile
head/net/quagga/files/quagga.in
Modified: head/net/quagga/Makefile
==============================================================================
--- head/net/quagga/Makefile Tue Feb 17 14:20:43 2015 (r379162)
+++ head/net/quagga/Makefile Tue Feb 17 14:25:23 2015 (r379163)
@@ -3,7 +3,7 @@
PORTNAME= quagga
PORTVERSION= 0.99.23.1
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= net ipv6
MASTER_SITES= SAVANNAH
Modified: head/net/quagga/files/quagga.in
==============================================================================
--- head/net/quagga/files/quagga.in Tue Feb 17 14:20:43 2015 (r379162)
+++ head/net/quagga/files/quagga.in Tue Feb 17 14:25:23 2015 (r379163)
@@ -8,22 +8,24 @@
# KEYWORD: nojail shutdown
# Add the following line to /etc/rc.conf to enable quagga:
-# quagga_enable="YES"
+# quagga_enable="YES"
#
# You may also wish to use the following variables to fine-tune startup:
-# quagga_flags="-d"
+# quagga_flags=""
# quagga_daemons="zebra ripd ripngd ospfd ospf6d bgpd isisd"
# quagga_vysh_boot="YES"
# Per daemon tuning may be done with daemon_name_flags
-# zebra_flags="-dP 0"
-# bgpd_flags="-dnrP 0" and so on
+# zebra_flags="-P 0"
+# bgpd_flags="-nrP 0" and so on
# If you want to give the routing deamons a chance to catchup before
# continueing, set quagga_wait_for to a "default" or certain prefix.
# quagga_wait_for="default"
+# Set the time limit for the wait.
+# quagga_wait_seconds="90"
#
# If the quagga daemons require additional shared libraries to start,
# use the following variable to run ldconfig(8) in advance:
-#quagga_extralibs_path="/usr/local/lib ..."
+# quagga_extralibs_path="/usr/local/lib ..."
#
. /etc/rc.subr
@@ -35,13 +37,16 @@ start_postcmd=start_postcmd
stop_postcmd="rm -f $pidfile"
configtest_cmd=check_config
extra_commands=configtest
+command_args="-d"
load_rc_config $name
quagga_enable=${quagga_enable:-"NO"}
-quagga_flags=${quagga_flags:-"-d"}
+quagga_flags=${quagga_flags:-""}
quagga_daemons=${quagga_daemons:-"zebra ripd ripngd ospfd ospf6d bgpd isisd"}
quagga_vtysh_boot=${quagga_vtysh_boot:-"NO"}
+quagga_wait_for=${quagga_wait_for:-""}
+quagga_wait_seconds=${quagga_wait_seconds:-"90"}
check_config()
{
@@ -58,16 +63,20 @@ check_config()
start_postcmd()
{
+ local waited_for
+ waited_for=0
# Wait only when last daemon has started.
if [ "${quagga_daemons}" = "${quagga_daemons% ${name}}" ]; then
return;
fi
- if [ ${quagga_wait_for} ]; then
+ if [ -n ${quagga_wait_for} ]; then
echo Waiting for ${quagga_wait_for} route...
- while true; do
+ while [ ${waited_for} -lt ${quagga_wait_seconds} ]; do
/sbin/route -n get ${quagga_wait_for} >/dev/null 2>&1 && break;
+ waited_for=$((${waited_for}+1))
sleep 1;
done
+ [ ${waited_for} -lt ${quagga_wait_seconds} ] || echo Giving up...
fi
}
@@ -118,7 +127,7 @@ fi
case "${quagga_cmd}" in
start)
- if [ ! -z ${quagga_extralibs_path} ]; then
+ if [ -n ${quagga_extralibs_path} ]; then
/sbin/ldconfig -m ${quagga_extralibs_path}
fi
do_cmd "start"
More information about the svn-ports-all
mailing list