summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2009-04-04 14:27:52 -0700
committerStig Thormodsrud <stig@vyatta.com>2009-04-04 14:27:52 -0700
commit475866a37a9f6d634552deb57cba97d4517ee81b (patch)
treefd1b93cb8eddbd0a30cfd625ad811837330f8007
parent34d31abfb94afe4c9e71292bf207302d5fae71ea (diff)
parentb8ede7d7fc7c541ac8222356375dd0cc4f996409 (diff)
downloadvyatta-cfg-quagga-475866a37a9f6d634552deb57cba97d4517ee81b.tar.gz
vyatta-cfg-quagga-475866a37a9f6d634552deb57cba97d4517ee81b.zip
Merge branch 'jenner' of http://git.vyatta.com/vyatta-cfg-quagga into jenner
-rw-r--r--debian/changelog8
-rwxr-xr-xscripts/quagga-manager49
2 files changed, 51 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog
index eb17ae65..ab22e57f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+vyatta-cfg-quagga (0.18.13) unstable; urgency=low
+
+ * Handle ipv6 daemons
+ * Don't stop daemon if OSPF/RIP still has parameters
+ * Don't stop daemon if OSPF/RIP still has parameters
+
+ -- Stephen Hemminger <stephen.hemminger@vyatta.com> Thu, 02 Apr 2009 15:06:15 -0700
+
vyatta-cfg-quagga (0.18.12) unstable; urgency=low
* Revert "Remove redundant check-as call since it doesn't work with
diff --git a/scripts/quagga-manager b/scripts/quagga-manager
index e7b5d5ae..58c91b66 100755
--- a/scripts/quagga-manager
+++ b/scripts/quagga-manager
@@ -4,10 +4,10 @@
#
# debug
-#echo $* | logger -p local7.debug -t quagga-manager
+# echo $* | logger -p local7.debug -t quagga-manager
usage() {
- echo "Usage: $0 {check|start|stop|restart} {bgpd|ospfd|ripd|ripngd}"
+ echo "Usage: $0 {check|start|stop|restart} {bgpd|ospfd|ripd|ospf6d|ripngd}"
exit 1
}
@@ -42,6 +42,8 @@ start() {
zebra) args+=( -l -S -s 1048576 ) ;;
watchquagga)
args=( -dz -p ${pid_dir}/${daemon}.pid );
+ # Note: at present ospf/rip only monitored if actually active
+ # probably should get smarter in future here
local -a protocols=(`/opt/vyatta/bin/vyatta-show-protocols exists`)
if [ ${#protocols[*]} -eq 0 ]
@@ -72,9 +74,19 @@ stop() {
rm -f $pid_dir/${daemon}.pid
}
+get_protocol() {
+ local daemon=$1
+ case $daemon in
+ bgpd|ospfd|ripd|ripngd|isisd) echo ${daemon/%d/};;
+ ospf6d) echo "ospfv3";;
+ *) echo "Unknown daemon $daemon" 1>&2; exit 1;;
+ esac
+}
+
reload_config() {
local daemon=$1
- local proto=${daemon/%d/}
+ local proto=$(get_protocol $daemon)
+
local vyatta_cfg=/opt/vyatta/config/active
local path=$vyatta_cfg/protocols/$proto
@@ -94,10 +106,14 @@ reload_config() {
# Erase portion of active configuration for that protocol
rm -fr $path
- # special case for interface configuration
+ # special case for interface, remove parameters force reload
case $proto in
rip|ospf)
- find $vyatta_cfg/interfaces -type d -name $daemon -exec rm -fr '{}' \; ;;
+ find $vyatta_cfg/interfaces -type d -path "*/ip/$proto" \
+ -exec rm -fr '{}' \; ;;
+ ripng|ospfv3)
+ find $vyatta_cfg/interfaces -type d -path "*/ipv6/$proto" \
+ -exec rm -fr '{}' \; ;;
esac
# Reload causing configuration to activate - implies commit
@@ -108,7 +124,24 @@ reload_config() {
trap "" EXIT HUP INT QUIT TERM
}
+# Check if interface configuration exists for this protocol
+okay_to_stop() {
+ local daemon=$1
+ local proto=$(get_protocol $daemon)
+ local cfg=/opt/vyatta/config/active/interfaces
+
+ case $proto in
+ rip|ospf)
+ return $(find $cfg -type d -path "*/ip/$proto" | wc -l);;
+ ripng|ospfv3)
+ return $(find $cfg -type d -path "*/ipv6/$proto" | wc -l);;
+ *)
+ return 0;;
+ esac
+}
+
update() {
+ # get list of daemons deleted and added in current transaction
local -a deleted=( `/opt/vyatta/bin/vyatta-show-protocols deleted` )
local -a added=( `/opt/vyatta/bin/vyatta-show-protocols added` )
@@ -120,7 +153,11 @@ update() {
# Cleanup any daemons no longer needed
for p in ${deleted[*]}
- do stop $p
+ do
+ # Need daemon to hold state of interface
+ if okay_to_stop $p
+ then stop $p
+ fi
done
start watchquagga