aboutsummaryrefslogtreecommitdiff
path: root/net/quagga
diff options
context:
space:
mode:
authorMathieu Arnold <mat@FreeBSD.org>2015-02-17 14:25:23 +0000
committerMathieu Arnold <mat@FreeBSD.org>2015-02-17 14:25:23 +0000
commit5e63940accd72d2a6cf51406d2802c940f69d009 (patch)
tree36caabbf434db95f1d2cfb69d50bff3af6585b9c /net/quagga
parent6678a119c4d4b7cbc73554779936bf63380df1f2 (diff)
downloadports-5e63940accd72d2a6cf51406d2802c940f69d009.tar.gz
ports-5e63940accd72d2a6cf51406d2802c940f69d009.zip
Notes
Diffstat (limited to 'net/quagga')
-rw-r--r--net/quagga/Makefile2
-rw-r--r--net/quagga/files/quagga.in27
2 files changed, 19 insertions, 10 deletions
diff --git a/net/quagga/Makefile b/net/quagga/Makefile
index 29e28b7fdc90..7b6687736a87 100644
--- a/net/quagga/Makefile
+++ b/net/quagga/Makefile
@@ -3,7 +3,7 @@
PORTNAME= quagga
PORTVERSION= 0.99.23.1
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= net ipv6
MASTER_SITES= SAVANNAH
diff --git a/net/quagga/files/quagga.in b/net/quagga/files/quagga.in
index 2a764f61af7b..36e678ec76ee 100644
--- a/net/quagga/files/quagga.in
+++ b/net/quagga/files/quagga.in
@@ -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"