aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorsem <sem@FreeBSD.org>2009-12-15 00:40:52 +0800
committersem <sem@FreeBSD.org>2009-12-15 00:40:52 +0800
commit82bdba062170e0ad8e06020b49791d13bfe0fc16 (patch)
tree50cde6b5de283938ab9e1f44f1c929879b5ba5c9 /net
parent8e2fdfba5bde66178c981997b8a720a67d6ba391 (diff)
downloadfreebsd-ports-gnome-82bdba062170e0ad8e06020b49791d13bfe0fc16.tar.gz
freebsd-ports-gnome-82bdba062170e0ad8e06020b49791d13bfe0fc16.tar.zst
freebsd-ports-gnome-82bdba062170e0ad8e06020b49791d13bfe0fc16.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
Diffstat (limited to 'net')
-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