diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-02-05 11:44:55 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-02-05 11:44:55 -0800 |
commit | adf9198f83f8a7cf385c75b18b328490479bffa0 (patch) | |
tree | 5a74d8250e667162eb0e3820feef3ad4b5c64f27 | |
parent | 6c40b894293c3472d5c428287465bfe363ae0255 (diff) | |
parent | 1a7d69a1db8249754ff3a0b43270fb6bfb5d6764 (diff) | |
download | vyatta-cfg-quagga-adf9198f83f8a7cf385c75b18b328490479bffa0.tar.gz vyatta-cfg-quagga-adf9198f83f8a7cf385c75b18b328490479bffa0.zip |
Merge branch 'jenner' of 192.168.100.1:git/vyatta-cfg-quagga into jenner
-rwxr-xr-x | scripts/vyatta-protocol | 25 | ||||
-rw-r--r-- | templates/protocols/bgp/node.def | 6 | ||||
-rw-r--r-- | templates/protocols/ospf/node.def | 4 | ||||
-rw-r--r-- | templates/protocols/rip/node.def | 4 | ||||
-rw-r--r-- | templates/protocols/ripng/node.def | 4 |
5 files changed, 25 insertions, 18 deletions
diff --git a/scripts/vyatta-protocol b/scripts/vyatta-protocol index e8fff484..d82e821d 100755 --- a/scripts/vyatta-protocol +++ b/scripts/vyatta-protocol @@ -4,7 +4,7 @@ # progname=$0 usage() { - echo "Usage: $progname {start|stop|reload} {bgp|ospf|rip|ripng}" + echo "Usage: $progname {start|stop|reload} {bgpd|ospfd|ripd|ripngd}" exit 1; } @@ -12,8 +12,7 @@ if [ $# -lt 2 ]; then usage fi -protocol=$2 -daemon=${protocol}d +daemon=$2 exe_file=/usr/sbin/vyatta-$daemon pid_dir=/var/run/vyatta/quagga @@ -21,7 +20,7 @@ pid_file=$pid_dir/${daemon}.pid log_dir=/var/log/vyatta/quagga if [ ! -x $exe_file ]; then - echo "Unknown protocol: $protocol"; + echo "Unknown daemon $daemon" exit 1; fi @@ -33,9 +32,9 @@ case "$1" in -- -d -P 0 -i $pid_dir/${daemon}.pid sudo start-stop-daemon --start --quiet \ --chdir $log_dir \ - --pidfile $pid_dir/watch-${daemon}.pid \ --exec /usr/sbin/vyatta-watchquagga \ - -- -dz -R "/opt/vyatta/sbin/vyatta-quagga reload $protocol" $daemon + -- -p $pid_dir/watch-${daemon}.pid \ + -dz -r "/opt/vyatta/sbin/vyatta-quagga reload %s" $daemon ;; stop) @@ -49,20 +48,24 @@ case "$1" in reload) # Start new transaction - /opt/vyatta/sbin/vyatta-cfg-cmd-wrapper begin + /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/${protocol}-restart.$$ - /opt/vyatta/sbin/vyatta-save-config.pl $tmp + tmp=/tmp/${daemon}-restart.$$ + /opt/vyatta/sbin/vyatta-save-config.pl $tmp || exit 1 # Erase active configuration for that protocol - rm -fr /opt/vyatta/config/active/protocols/$protocol + rm -fr /opt/vyatta/config/active/protocols/${daemon/%d/} # Reload causing configuration to activate - implies commit - /opt/vyatta/sbin/vyatta-load-config.pl $TMP + # remove tmp file if successful + /opt/vyatta/sbin/vyatta-load-config.pl $tmp || exit 1 + + rm $tmp + ;; *) usage;; diff --git a/templates/protocols/bgp/node.def b/templates/protocols/bgp/node.def index ef80d812..ca1ae005 100644 --- a/templates/protocols/bgp/node.def +++ b/templates/protocols/bgp/node.def @@ -6,10 +6,14 @@ syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967294 ; \ "AS number must be between 1 and 4294967294" create: if [ $(pgrep -c -x vyatta-bgpd) -eq 0 ] - then /opt/vyatta/sbin/vyatta-protocol start bgp + then ${vyatta_sbindir}/vyatta-protocol start bgpd fi vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(@)" update: vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(@)" \ -c "bgp network import-check" delete: vyatta-vtysh -c "configure terminal" -c "no router bgp $VAR(@)" + if ! ${vyatta_sbindir}/vyatta-check-typeless-node.pl "protocols bgp" + then ${vyatta_sbindir}/vyatta-protocol stop bgpd + fi + diff --git a/templates/protocols/ospf/node.def b/templates/protocols/ospf/node.def index 25ef78e3..5405abac 100644 --- a/templates/protocols/ospf/node.def +++ b/templates/protocols/ospf/node.def @@ -1,5 +1,5 @@ help: Configure Open Shortest Path First protocol (OSPF) parameters -create: /opt/vyatta/sbin/vyatta-protocol start ospf +create: /opt/vyatta/sbin/vyatta-protocol start ospfd vyatta-vtysh -c "configure terminal" -c "router ospf" delete: vyatta-vtysh -c "configure terminal" -c "no router ospf" - /opt/vyatta/sbin/vyatta-protocol stop ospf + /opt/vyatta/sbin/vyatta-protocol stop ospfd diff --git a/templates/protocols/rip/node.def b/templates/protocols/rip/node.def index f1a08cc5..a77bdb30 100644 --- a/templates/protocols/rip/node.def +++ b/templates/protocols/rip/node.def @@ -1,7 +1,7 @@ help: Configure Routing Information Protocol (RIP) parameters -create: /opt/vyatta/sbin/vyatta-protocol start rip +create: /opt/vyatta/sbin/vyatta-protocol start ripd vyatta-vtysh -c "configure terminal" -c "router rip" delete: vyatta-vtysh -c "configure terminal" -c "no router rip" - /opt/vyatta/sbin/vyatta-protocol stop rip + /opt/vyatta/sbin/vyatta-protocol stop ripd diff --git a/templates/protocols/ripng/node.def b/templates/protocols/ripng/node.def index efe56ba3..18735607 100644 --- a/templates/protocols/ripng/node.def +++ b/templates/protocols/ripng/node.def @@ -1,5 +1,5 @@ help: Configure Routing Information Protocol (RIPng) parameters -create: /opt/vyatta/sbin/vyatta-protocol start ripng +create: /opt/vyatta/sbin/vyatta-protocol start ripngd vyatta-vtysh -c "configure terminal" -c "router ripng" delete: vyatta-vtysh -c "configure terminal" -c "no router ripng" - /opt/vyatta/sbin/vyatta-protocol stop ripng + /opt/vyatta/sbin/vyatta-protocol stop ripngd |