aboutsummaryrefslogtreecommitdiff
path: root/net/quagga
diff options
context:
space:
mode:
authorSergey Matveychuk <sem@FreeBSD.org>2009-12-14 16:40:52 +0000
committerSergey Matveychuk <sem@FreeBSD.org>2009-12-14 16:40:52 +0000
commit38c8a749a158a822fdd33f87490fbb1d4603530b (patch)
treef4f2cbfb8d0415abed4ee3b2b20493225a21cab4 /net/quagga
parent1f85c4f7dfd564f412d3fee5dc427bd6c9088ac0 (diff)
downloadports-38c8a749a158a822fdd33f87490fbb1d4603530b.tar.gz
ports-38c8a749a158a822fdd33f87490fbb1d4603530b.zip
- Changes is RC script:
* proper run order * Deprecate option quagga_delay and introduce option quagga_wait_for. Instead of sleeping for some constant time wait for appearing of a certain route in routing table. Submitted by: glebius Approved by: maintainer
Notes
Notes: svn path=/head/; revision=245789
Diffstat (limited to 'net/quagga')
-rw-r--r--net/quagga/Makefile2
-rw-r--r--net/quagga/files/quagga.sh.in32
2 files changed, 22 insertions, 12 deletions
diff --git a/net/quagga/Makefile b/net/quagga/Makefile
index c36f68a9e072..fa3a7cfe8551 100644
--- a/net/quagga/Makefile
+++ b/net/quagga/Makefile
@@ -7,7 +7,7 @@
PORTNAME= quagga
PORTVERSION= 0.99.15
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= net ipv6
MASTER_SITES= http://quagga.net/download/ \
http://www.ru.quagga.net/download/ \
diff --git a/net/quagga/files/quagga.sh.in b/net/quagga/files/quagga.sh.in
index 063e74af57d3..747cabcdbb42 100644
--- a/net/quagga/files/quagga.sh.in
+++ b/net/quagga/files/quagga.sh.in
@@ -2,7 +2,8 @@
#
# PROVIDE: quagga
-# REQUIRE: NETWORKING %%RCLDCONFIG%%
+# REQUIRE: netif routing
+# KEYWORD: nojail
#
# Add the following line to /etc/rc.conf to enable quagga:
@@ -15,9 +16,8 @@
# zebra_flags="-dP 0"
# bgpd_flags="-dnrP 0" and so on
# If you want to give the routing deamons a chance to catchup before
-# continueing, set quagga_delay to a certain amount of seconds.
-# quagga_delay="30"
-#
+# continueing, set quagga_wait_for to a "default" or certain prefix.
+# quagga_wait_for="default"
#
# If the quagga daemons require additional shared libraries to start,
# use the following variable to run ldconfig(8) in advance:
@@ -29,9 +29,24 @@
name="quagga"
rcvar=`set_rcvar`
-
+start_postcmd=start_postcmd
stop_postcmd=stop_postcmd
+start_postcmd()
+{
+ # Wait only when last daemon has started.
+ if [ "${quagga_daemons}" = "${quagga_daemons% ${name}}" ]; then
+ return;
+ fi
+ if [ ${quagga_wait_for} ]; then
+ echo Waiting for ${quagga_wait_for} route...
+ while true; do
+ /sbin/route -n get ${quagga_wait_for} >/dev/null 2>&1 && break;
+ sleep 1;
+ done
+ fi
+}
+
stop_postcmd()
{
rm -f $pidfile
@@ -64,7 +79,7 @@ load_rc_config $name
: ${quagga_flags="-d"}
: ${quagga_daemons="zebra ripd ripngd ospfd ospf6d bgpd isisd"}
: ${quagga_extralibs_path=""}
-: ${quagga_delay="0"}
+: ${quagga_wait_for=""}
quagga_cmd=$1
@@ -98,8 +113,3 @@ case "${quagga_cmd}" in
do_cmd "${quagga_cmd}"
;;
esac
-
-if [ "${quagga_delay}" != "0" ]; then
- echo "Sleeping ${quagga_delay} seconds to obtain dynamic routing information..."
- sleep ${quagga_delay}
-fi