summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-07-09 16:06:26 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-07-09 16:06:26 -0700
commitdcebd6d713e76b3e01ba51710693d688e1570cdb (patch)
treeee2ac32d9c6a4f3f341376688e5182639e1b916d
parent8baea0622fbbc6a9e643df2a4bb8fa8a72fd02fa (diff)
downloadvyatta-cfg-quagga-dcebd6d713e76b3e01ba51710693d688e1570cdb.tar.gz
vyatta-cfg-quagga-dcebd6d713e76b3e01ba51710693d688e1570cdb.zip
Remove dynamic start of routing daemons
The CLI begin transaction restrictions make this impossible to do in a stable manner. Related to bug 4537
-rw-r--r--Makefile.am1
-rw-r--r--interface-templates/ip/ospf/node.def1
-rw-r--r--interface-templates/ip/rip/node.def1
-rw-r--r--interface-templates/ipv6/ospfv3/node.def1
-rw-r--r--interface-templates/ipv6/ripng/node.def1
-rwxr-xr-xscripts/quagga-manager132
-rw-r--r--templates/policy/node.def1
-rw-r--r--templates/protocols/bgp/node.def1
-rw-r--r--templates/protocols/bgp/node.tag/neighbor/node.def1
-rw-r--r--templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def1
-rw-r--r--templates/protocols/bgp/node.tag/parameters/node.def1
-rw-r--r--templates/protocols/ospf/node.def1
-rw-r--r--templates/protocols/ospfv3/node.def1
-rw-r--r--templates/protocols/rip/node.def1
-rw-r--r--templates/protocols/ripng/node.def1
15 files changed, 0 insertions, 146 deletions
diff --git a/Makefile.am b/Makefile.am
index 64323cb6..50f47de0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,7 +11,6 @@ sbin_SCRIPTS += scripts/policy/vyatta-check-as-prepend.pl
sbin_SCRIPTS += scripts/vyatta-policy-action-verify.pl
sbin_SCRIPTS += scripts/vyatta-gateway-static_route-check.pl
sbin_SCRIPTS += scripts/vyatta-link-detect
-sbin_SCRIPTS += scripts/quagga-manager
sbin_PROGRAMS = src/check_prefix_boundary
diff --git a/interface-templates/ip/ospf/node.def b/interface-templates/ip/ospf/node.def
index 6842b5bd..1702547a 100644
--- a/interface-templates/ip/ospf/node.def
+++ b/interface-templates/ip/ospf/node.def
@@ -1,2 +1 @@
help: Set Open Shortest Path First (OSPF) parameters for specified interface
-create: sudo /opt/vyatta/sbin/quagga-manager start ospfd
diff --git a/interface-templates/ip/rip/node.def b/interface-templates/ip/rip/node.def
index 7818921b..d1f72a5f 100644
--- a/interface-templates/ip/rip/node.def
+++ b/interface-templates/ip/rip/node.def
@@ -1,2 +1 @@
help: Set Routing Information Protocol (RIP) for specified interface
-create: sudo /opt/vyatta/sbin/quagga-manager start ripd
diff --git a/interface-templates/ipv6/ospfv3/node.def b/interface-templates/ipv6/ospfv3/node.def
index 1dbba902..05014493 100644
--- a/interface-templates/ipv6/ospfv3/node.def
+++ b/interface-templates/ipv6/ospfv3/node.def
@@ -1,2 +1 @@
help: Set IPv6 Open Shortest Path First (OSPFv3) parameters for specified interface
-create: sudo /opt/vyatta/sbin/quagga-manager start ospf6d
diff --git a/interface-templates/ipv6/ripng/node.def b/interface-templates/ipv6/ripng/node.def
index 977303db..cb2d89aa 100644
--- a/interface-templates/ipv6/ripng/node.def
+++ b/interface-templates/ipv6/ripng/node.def
@@ -1,2 +1 @@
help: Set Routing Information Protocol (RIPng) for specified interface
-create: sudo /opt/vyatta/sbin/quagga-manager start ripngd
diff --git a/scripts/quagga-manager b/scripts/quagga-manager
deleted file mode 100755
index 5beb8780..00000000
--- a/scripts/quagga-manager
+++ /dev/null
@@ -1,132 +0,0 @@
-#! /bin/bash
-#
-# This is special script for start,stop,restart of quagga daemons
-#
-
-# debug
-# echo $* | logger -p local7.debug -t quagga-manager
-
-usage() {
- echo "Usage: $0 {check|start|stop|restart} {bgpd|ospfd|ripd|ospf6d|ripngd} ..."
- exit 1
-}
-
-if [ $# -lt 1 ]; then
- usage
-fi
-
-pid_dir=/var/run/vyatta/quagga
-log_dir=/var/log/vyatta/quagga
-
-. /lib/lsb/init-functions
-
-status() {
- local daemon=$1
- local pidfile=${pid_dir}/${daemon}.pid
- local binpath=/usr/sbin/vyatta-$daemon
- status_of_proc -p $pidfile $binpath $daemon && exit 0 || exit $?
-}
-
-start() {
- local daemon=$1
- local pidfile=${pid_dir}/${daemon}.pid
- local binpath=/usr/sbin/vyatta-$daemon
-
- if [ $EUID -ne 0 ]; then
- echo "must be root!"
- exit 1
- fi
-
- if [ ! -x $binpath ]; then
- echo "Unknown daemon $daemon"
- return 1
- fi
-
- local -a args=( -d -P 0 -i $pidfile )
- case $daemon in
- zebra) args+=( -l -S -s 1048576 );;
- bgpd) args+=( -I );;
- esac
-
- start-stop-daemon --start --oknodo --quiet \
- --chdir $log_dir --exec $binpath --pidfile $pidfile -- ${args[@]}
-}
-
-stop() {
- local daemon=$1
- local pidfile=${pid_dir}/${daemon}.pid
- local binpath=/usr/sbin/vyatta-$daemon
-
- if [ $EUID -ne 0 ]; then
- echo "must be root!"
- exit 1
- fi
- start-stop-daemon --stop --quiet --oknodo --retry 5 \
- --exec $binpath --pidfile=$pidfile
- rm -f $pidfile
-}
-
-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=$(get_protocol $daemon)
-
- local vyatta_cfg=/opt/vyatta/config/active
- local path=$vyatta_cfg/protocols/$proto
-
- # If daemon does not have config nothing to do.
- [ -d $path ] || return;
-
- # Begin reloading transaction
- /opt/vyatta/sbin/vyatta-cfg-cmd-wrapper begin || exit 1
-
- # In case of error undo
- trap "/opt/vyatta/sbin/vyatta-cfg-cmd-wrapper end" EXIT HUP INT QUIT TERM
-
- # Save current configuration
- tmp=/tmp/${daemon}-restart.$$
- /opt/vyatta/sbin/vyatta-save-config.pl $tmp || exit 1
-
- # Erase portion of active configuration for that protocol
- rm -fr $path
-
- # special case for interface, remove parameters force reload
- case $proto in
- rip|ospf)
- 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
- /opt/vyatta/sbin/vyatta-load-config.pl $tmp || exit 1
-
- # remove tmp file if successful
- rm $tmp
- trap "" EXIT HUP INT QUIT TERM
-}
-
-action=$1
-shift
-
-for daemon; do
- case "$action" in
- start) start $daemon ;;
- stop) stop $daemon ;;
- status) status $daemon ;;
- reload) start $daemon; reload_config $daemon ;;
- restart) stop $daemon; start $daemon ;;
- *) usage;;
- esac
-done
-
diff --git a/templates/policy/node.def b/templates/policy/node.def
index bfa8533b..95fe2e9f 100644
--- a/templates/policy/node.def
+++ b/templates/policy/node.def
@@ -1,2 +1 @@
help: Configure routing policy
-begin: sudo /opt/vyatta/sbin/quagga-manager start bgpd ospfd ripd ripngd ospf6d
diff --git a/templates/protocols/bgp/node.def b/templates/protocols/bgp/node.def
index 27d29523..61a5ecff 100644
--- a/templates/protocols/bgp/node.def
+++ b/templates/protocols/bgp/node.def
@@ -4,7 +4,6 @@ help: Configure Border Gateway Protocol (BGP) parameters
comp_help: \1 <1-4294967294>\tAS number
syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967294 ; \
"AS number must be between 1 and 4294967294"
-begin: sudo /opt/vyatta/sbin/quagga-manager start bgpd
create: vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(@)"
delete: vyatta-vtysh -c "configure terminal" -c "no router bgp $VAR(@)"
diff --git a/templates/protocols/bgp/node.tag/neighbor/node.def b/templates/protocols/bgp/node.tag/neighbor/node.def
index 6b30f7cd..f4dd5ac2 100644
--- a/templates/protocols/bgp/node.tag/neighbor/node.def
+++ b/templates/protocols/bgp/node.tag/neighbor/node.def
@@ -8,7 +8,6 @@ comp_help:
syntax:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl \
--check-peer-name $VAR(@)"
-begin: sudo /opt/vyatta/sbin/quagga-manager start bgpd
create: if /opt/vyatta/sbin/vyatta-bgp.pl --check-if-peer-group \
--peergroup $VAR(@); then
diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def
index 453527aa..10804af4 100644
--- a/templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def
+++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def
@@ -5,7 +5,6 @@ comp_help:
syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967294; \
"remote-as must be between 1 and 4294967294"
-begin: sudo /opt/vyatta/sbin/quagga-manager start bgpd
# Create action so this leaf is done before others
create: vyatta-vtysh -c "configure terminal" \
diff --git a/templates/protocols/bgp/node.tag/parameters/node.def b/templates/protocols/bgp/node.tag/parameters/node.def
index 6711aac1..6bb752b5 100644
--- a/templates/protocols/bgp/node.tag/parameters/node.def
+++ b/templates/protocols/bgp/node.tag/parameters/node.def
@@ -1,2 +1 @@
help: Set BGP parameters
-begin: sudo /opt/vyatta/sbin/quagga-manager start bgpd
diff --git a/templates/protocols/ospf/node.def b/templates/protocols/ospf/node.def
index 639eb2bc..b28f5553 100644
--- a/templates/protocols/ospf/node.def
+++ b/templates/protocols/ospf/node.def
@@ -1,4 +1,3 @@
help: Configure Open Shortest Path First protocol (OSPF) parameters
-begin: sudo /opt/vyatta/sbin/quagga-manager start ospfd
create: vyatta-vtysh -c "configure terminal" -c "router ospf"
delete: vyatta-vtysh -c "configure terminal" -c "no router ospf"
diff --git a/templates/protocols/ospfv3/node.def b/templates/protocols/ospfv3/node.def
index ed48a66c..ea163f18 100644
--- a/templates/protocols/ospfv3/node.def
+++ b/templates/protocols/ospfv3/node.def
@@ -1,4 +1,3 @@
help: Configure IPv6 Open Shortest Path First protocol (OSPFv3) parameters
-begin: sudo /opt/vyatta/sbin/quagga-manager start ospf6d
create: vyatta-vtysh -c "configure terminal" -c "router ospf6"
delete: vyatta-vtysh -c "configure terminal" -c "no router ospf6"
diff --git a/templates/protocols/rip/node.def b/templates/protocols/rip/node.def
index 161b883f..541baa8d 100644
--- a/templates/protocols/rip/node.def
+++ b/templates/protocols/rip/node.def
@@ -1,4 +1,3 @@
help: Configure Routing Information Protocol (RIP) parameters
-begin: sudo /opt/vyatta/sbin/quagga-manager start ripd
create: vyatta-vtysh -c "configure terminal" -c "router rip"
delete: vyatta-vtysh -c "configure terminal" -c "no router rip"
diff --git a/templates/protocols/ripng/node.def b/templates/protocols/ripng/node.def
index 6903c07e..61c30b01 100644
--- a/templates/protocols/ripng/node.def
+++ b/templates/protocols/ripng/node.def
@@ -1,4 +1,3 @@
help: Configure Routing Information Protocol (RIPng) parameters
-begin: sudo /opt/vyatta/sbin/quagga-manager start ripngd
create: vyatta-vtysh -c "configure terminal" -c "router ripng"
delete: vyatta-vtysh -c "configure terminal" -c "no router ripng"