From 16d65ac258ef19fb80c2f7b01030a87d185fd3e1 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 3 Jun 2009 09:39:46 -0700 Subject: Allow status operations as non-root user (cherry picked from commit 466426dba5880bf469b22172769c552cf6aaaab0) --- scripts/quagga-manager | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/quagga-manager b/scripts/quagga-manager index ff0c7f88..220a5fba 100755 --- a/scripts/quagga-manager +++ b/scripts/quagga-manager @@ -15,11 +15,6 @@ if [ $# -lt 1 ]; then usage fi -if [ $EUID -ne 0 ]; then - echo "must be root!" - exit 1 -fi - pid_dir=/var/run/vyatta/quagga log_dir=/var/log/vyatta/quagga @@ -37,6 +32,11 @@ start() { 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 @@ -57,6 +57,10 @@ stop() { 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 -- cgit v1.2.3 From 3b3fc34c6d6cb71b1cb00edee2cd12a96ee772ec Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 3 Jun 2009 11:30:57 -0700 Subject: Use bgpd default import-check flag Move the default import-check enabled from template to command line option in bgpd. This resolves some of the startup issues. (cherry picked from commit a1d23a42ef83968222b0744505986db3e02b0ae8) --- scripts/quagga-manager | 7 ++++--- templates/protocols/bgp/node.def | 6 ++---- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/quagga-manager b/scripts/quagga-manager index 220a5fba..be0435b9 100755 --- a/scripts/quagga-manager +++ b/scripts/quagga-manager @@ -43,9 +43,10 @@ start() { fi local -a args=( -d -P 0 -i $pidfile ) - if [ "$daemon" = "zebra" ]; then - args+=( -l -S -s 1048576 ) - fi + case $daemon in + zebra) args+=( -l -S -s 1048576 );; + bgpd) args+=( -I );; + esac exec start-stop-daemon --start --oknodo --quiet \ --chdir $log_dir --exec $binpath --pidfile $pidfile \ diff --git a/templates/protocols/bgp/node.def b/templates/protocols/bgp/node.def index 9a430834..27d29523 100644 --- a/templates/protocols/bgp/node.def +++ b/templates/protocols/bgp/node.def @@ -5,9 +5,7 @@ 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 -# we need to set default parameters in BGP here since we can't do it in -# startup scripts as we don't know the AS number at that point -create: vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(@)" \ - -c "bgp network import-check" +create: vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(@)" delete: vyatta-vtysh -c "configure terminal" -c "no router bgp $VAR(@)" + -- cgit v1.2.3