head 1.19; access; symbols OPENPKG_E1_MP_HEAD:1.19 OPENPKG_E1_MP:1.19 OPENPKG_E1_MP_2_STABLE:1.18.10.1 OPENPKG_E1_FP:1.18.10.1 OPENPKG_2_STABLE_MP:1.19 OPENPKG_2_STABLE_20061018:1.18.10.1 OPENPKG_2_STABLE_20060622:1.18 OPENPKG_2_STABLE:1.18.0.10 OPENPKG_2_STABLE_BP:1.18 OPENPKG_2_5_RELEASE:1.18 OPENPKG_2_5_SOLID:1.18.0.8 OPENPKG_2_5_SOLID_BP:1.18 OPENPKG_2_4_RELEASE:1.18 OPENPKG_2_4_SOLID:1.18.0.6 OPENPKG_2_4_SOLID_BP:1.18 OPENPKG_CW_FP:1.18 OPENPKG_2_3_RELEASE:1.18 OPENPKG_2_3_SOLID:1.18.0.4 OPENPKG_2_3_SOLID_BP:1.18 OPENPKG_2_2_RELEASE:1.18 OPENPKG_2_2_SOLID:1.18.0.2 OPENPKG_2_2_SOLID_BP:1.18 OPENPKG_2_1_RELEASE:1.16 OPENPKG_2_1_SOLID:1.16.0.2 OPENPKG_2_1_SOLID_BP:1.16 OPENPKG_2_0_RELEASE:1.15 OPENPKG_2_0_SOLID:1.15.0.2 OPENPKG_2_0_SOLID_BP:1.15 OPENPKG_1_3_RELEASE:1.3.4.3 OPENPKG_1_3_SOLID:1.3.4.3.0.2 OPENPKG_1_3_SOLID_BP:1.3.4.3 OPENPKG_1_STABLE_MP:1.15 OPENPKG_1_2_RELEASE:1.3 OPENPKG_1_2_SOLID:1.3.0.6 OPENPKG_1_2_SOLID_BP:1.3 OPENPKG_1_STABLE:1.3.0.4 OPENPKG_1_STABLE_BP:1.3 OPENPKG_1_1_RELEASE:1.3 OPENPKG_1_1_SOLID:1.3.0.2 OPENPKG_1_1_SOLID_BP:1.3 OPENPKG_1_0_RELEASE:1.2 OPENPKG_1_0_SOLID:1.2.0.2 OPENPKG_1_0_SOLID_BP:1.2 OPENPKG_0_0:1.1.1.1 OPENPKG:1.1.1; locks; strict; comment @# @; 1.19 date 2006.08.25.19.20.24; author rse; state Exp; branches; next 1.18; commitid Tvsj1UyQ8rQ89gKr; 1.18 date 2004.09.20.14.33.42; author rse; state Exp; branches 1.18.10.1; next 1.17; 1.17 date 2004.07.06.11.18.38; author ms; state Exp; branches; next 1.16; 1.16 date 2004.03.29.11.28.07; author rse; state Exp; branches; next 1.15; 1.15 date 2003.07.25.09.23.36; author thl; state Exp; branches 1.15.2.1; next 1.14; 1.14 date 2003.07.24.21.04.15; author thl; state Exp; branches; next 1.13; 1.13 date 2003.07.24.21.03.07; author thl; state Exp; branches; next 1.12; 1.12 date 2003.07.24.07.03.19; author thl; state Exp; branches; next 1.11; 1.11 date 2003.07.22.08.11.19; author rse; state Exp; branches; next 1.10; 1.10 date 2003.07.19.10.21.26; author rse; state Exp; branches; next 1.9; 1.9 date 2003.07.17.21.35.20; author thl; state Exp; branches; next 1.8; 1.8 date 2003.07.10.07.51.20; author rse; state Exp; branches; next 1.7; 1.7 date 2003.06.24.12.08.17; author thl; state Exp; branches; next 1.6; 1.6 date 2003.04.08.15.45.49; author rse; state Exp; branches; next 1.5; 1.5 date 2003.03.28.14.50.37; author cs; state Exp; branches; next 1.4; 1.4 date 2003.03.12.10.16.48; author rse; state Exp; branches; next 1.3; 1.3 date 2002.04.19.09.19.11; author ms; state Exp; branches 1.3.4.1; next 1.2; 1.2 date 2001.11.26.16.23.38; author rse; state Exp; branches; next 1.1; 1.1 date 2001.09.18.09.48.32; author rse; state Exp; branches 1.1.1.1; next ; 1.18.10.1 date 2006.10.16.14.58.44; author rse; state Exp; branches; next ; commitid iZxwRSmmWscPXUQr; 1.15.2.1 date 2004.04.01.09.48.51; author rse; state Exp; branches; next ; 1.3.4.1 date 2003.07.24.20.45.40; author rse; state Exp; branches; next 1.3.4.2; 1.3.4.2 date 2003.07.25.09.18.41; author rse; state Exp; branches; next 1.3.4.3; 1.3.4.3 date 2003.07.25.09.35.55; author rse; state Exp; branches; next ; 1.1.1.1 date 2001.09.18.09.48.32; author rse; state Exp; branches; next ; desc @@ 1.19 log @replace '@@l_prefix@@/lib/openpkg/bash @@l_prefix@@/etc/rc' in shebang with '@@l_prefix@@/bin/openpkg rc' to allow people who run the rc.xxx scripts directly (as executables) to leverage from the Set-UID functionality @ text @#!@@l_prefix@@/bin/openpkg rc ## ## rc.zebra -- Run-Commands ## %config zebra_enable="$openpkg_rc_def" zebra_protocols="rip ospf bgp" zebra_flags="" zebra_bind="127.0.0.1" zebra_port="2601" zebra_rip_flags="" zebra_rip_bind="${zebra_bind}" zebra_rip_port="2602" zebra_ospf_flags="" zebra_ospf_bind="${zebra_bind}" zebra_ospf_port="2604" zebra_bgp_flags="" zebra_bgp_bind="${zebra_bind}" zebra_bgp_port="2605" zebra_log_prolog="true" zebra_log_epilog="true" zebra_log_numfiles="10" zebra_log_minsize="1M" zebra_log_complevel="9" %status -u @@l_susr@@ -o zebra_usable="unknown" zebra_active="no" if [ -f @@l_prefix@@/var/zebra/zebra.pid ]; then kill -0 `cat @@l_prefix@@/var/zebra/zebra.pid` >/dev/null 2>&1 if [ $? -eq 0 ]; then zebra_active="yes" fi fi echo "zebra_enable=\"$zebra_enable\"" echo "zebra_usable=\"$zebra_usable\"" echo "zebra_active=\"$zebra_active\"" %start -u @@l_susr@@ rcService zebra enable yes || exit 0 rcService zebra active yes && exit 0 cd @@l_prefix@@/etc/zebra for i in zebra $zebra_protocols; do if [ ".$i" = .zebra ]; then midfix="" daemon="${i}"; else midfix="${i}_"; daemon="${i}d"; fi if [ -x @@l_prefix@@/sbin/${daemon} ]; then flags=`eval echo \\\$zebra_${midfix}flags`; extra=`eval echo \\\$zebra_${midfix}bind`; echo $flags | grep -- -A >/dev/null if [ $? -ne 0 -a ".$extra" != . ]; then flags="$flags -A $extra" fi extra=`eval echo \\\$zebra_${midfix}port`; echo $flags | grep -- -P >/dev/null if [ $? -ne 0 -a ".$extra" != . ]; then flags="$flags -P $extra" fi @@l_prefix@@/sbin/${daemon} -d ${flags} fi done @@l_prefix@@/bin/vtysh -b %stop -u @@l_susr@@ rcService zebra enable yes || exit 0 rcService zebra active no && exit 0 if [ -f @@l_prefix@@/var/zebra/zebra.pid ]; then kill -TERM `cat @@l_prefix@@/var/zebra/zebra.pid` >/dev/null 2>&1 || true fi for protocol in $zebra_protocols; do if [ -f @@l_prefix@@/var/zebra/${protocol}d.pid ]; then kill -TERM `cat @@l_prefix@@/var/zebra/${protocol}d.pid` >/dev/null 2>&1 || true fi done sleep 1 rm -f @@l_prefix@@/var/zebra/*.pid >/dev/null 2>&1 || true %restart -u @@l_susr@@ rcService zebra enable yes || exit 0 rcService zebra active no && exit 0 rc zebra stop start %daily -u @@l_susr@@ rcService zebra enable yes || exit 0 shtool rotate -f \ -n ${zebra_log_numfiles} -s ${zebra_log_minsize} -d \ -z ${zebra_log_complevel} -m 640 -o @@l_susr@@ -g @@l_mgrp@@ \ -P "${zebra_log_prolog}" \ -E "${zebra_log_epilog}; rc zebra restart" \ @@l_prefix@@/var/zebra/zebra.log @ 1.18 log @remove lonely logfile rotation comment in rc files @ text @d1 1 a1 1 #!@@l_prefix@@/lib/openpkg/bash @@l_prefix@@/etc/rc @ 1.18.10.1 log @Mass merge from CURRENT to 2-STABLE (all packages except those of JUNK class) @ text @d1 1 a1 1 #!@@l_prefix@@/bin/openpkg rc @ 1.17 log @in rc.*:%daily, restart daemons per default in shtool epilog should a logfile rotation be performed @ text @a89 2 # rotate logfile @ 1.16 log @fix status determination @ text @d96 1 a96 1 -E "${zebra_log_epilog} && rc zebra restart" \ @ 1.15 log @extend bind/listen logic to companion daemons @ text @d31 1 a31 1 kill -0 `cat @@l_prefix@@/var/zebra/zebra.pid` >/dev/null 2>&1 || true @ 1.15.2.1 log @MFC: fix zebra_active status variable @ text @d31 1 a31 1 kill -0 `cat @@l_prefix@@/var/zebra/zebra.pid` >/dev/null 2>&1 @ 1.14 log @PR#202 run-time check and related issues @ text @d12 9 a42 9 flags="$zebra_flags" echo $flags | grep -- -A >/dev/null if [ $? -ne 0 -a ".$zebra_bind" != . ]; then flags="$flags -A $zebra_bind" fi echo $flags | grep -- -P >/dev/null if [ $? -ne 0 -a ".$zebra_port" != . ]; then flags="$flags -P $zebra_port" fi d44 21 a64 4 @@l_prefix@@/sbin/zebra -d $flags for protocol in $zebra_protocols; do if [ -f @@l_prefix@@/sbin/${protocol}d ]; then @@l_prefix@@/sbin/${protocol}d -d @ 1.13 log @fix PR#176 set default daemon bind/listen address to 127.0.0.1 @ text @d77 1 a77 1 -z ${zebra_log_complevel} -m 644 -o @@l_susr@@ -g @@l_mgrp@@ \ @ 1.12 log @prepare related issues for PR#202 but no run-time check done @ text @d9 3 d34 9 d44 1 a44 1 @@l_prefix@@/sbin/zebra -d @ 1.11 log @cleanup the priority: move 200 to 500 and because 500 is default just ommit it; fix DNS/NTP/etc. dependencies @ text @d30 1 d42 1 d51 2 d56 2 a57 2 rc zebra stop; sleep 1 rc zebra start d61 2 d65 1 a65 1 -z ${zebra_log_complevel} -o @@l_rusr@@ -g @@l_rgrp@@ -m 644 \ d67 1 a67 1 -E "${zebra_log_epilog}" \ @ 1.10 log @cleanup run-commands, add %status, add logfile rotation, etc @ text @d28 1 a28 1 %start -p 200 -u @@l_susr@@ d39 1 a39 1 %stop -p 200 -u @@l_susr@@ d50 1 a50 1 %restart -p 200 -u @@l_susr@@ @ 1.9 log @migrate opServiceEnabled to opService ... enable yes; use new bootstrap feature and apply opService short circuit to %env @ text @d9 5 d15 7 a21 15 %common zebra_start () { ( cd @@l_prefix@@/etc/zebra @@l_prefix@@/sbin/zebra -d for protocol in $zebra_protocols; do if [ -f @@l_prefix@@/sbin/${protocol}d ]; then @@l_prefix@@/sbin/${protocol}d -d fi done @@l_prefix@@/bin/vtysh -b ) } zebra_stop () { if [ -f @@l_prefix@@/var/zebra/zebra.pid ]; then kill -TERM `cat @@l_prefix@@/var/zebra/zebra.pid` >/dev/null 2>&1 || true d23 4 a26 6 for protocol in $zebra_protocols; do if [ -f @@l_prefix@@/var/zebra/${protocol}d.pid ]; then kill -TERM `cat @@l_prefix@@/var/zebra/${protocol}d.pid` >/dev/null 2>&1 || true fi done } d29 9 a37 2 opService zebra enable yes || exit 0 zebra_start d40 9 a48 2 opService zebra enable yes || exit 0 zebra_stop d51 12 a62 4 opService zebra enable yes || exit 0 zebra_stop sleep 2 zebra_start @ 1.8 log @use new openpkg_rc_def variable in run-command scripts for allowing the admin to change the global default for xxx_enable @ text @d34 1 a34 1 opServiceEnabled zebra || exit 0 d38 1 a38 1 opServiceEnabled zebra || exit 0 d42 1 a42 1 opServiceEnabled zebra || exit 0 @ 1.7 log @cosmetics: align/fix/unify rc header comment @ text @d7 1 a7 1 zebra_enable="yes" @ 1.6 log @provide restart command @ text @d3 1 a3 1 ## rc.zebra -- Run-Commands for ZEBRA Daemon @ 1.5 log @rc script clean up @ text @d10 23 d35 1 a35 9 ( cd @@l_prefix@@/etc/zebra @@l_prefix@@/sbin/zebra -d for protocol in $zebra_protocols; do if [ -f @@l_prefix@@/sbin/${protocol}d ]; then @@l_prefix@@/sbin/${protocol}d -d fi done @@l_prefix@@/bin/vtysh -b ) d39 7 a45 8 if [ -f @@l_prefix@@/var/zebra/zebra.pid ]; then kill -TERM `cat @@l_prefix@@/var/zebra/zebra.pid` >/dev/null 2>&1 || true fi for protocol in $zebra_protocols; do if [ -f @@l_prefix@@/var/zebra/${protocol}d.pid ]; then kill -TERM `cat @@l_prefix@@/var/zebra/${protocol}d.pid` >/dev/null 2>&1 || true fi done @ 1.4 log @fully work-off this package @ text @d10 1 a10 1 %start -p 200 -u root d22 1 a22 1 %stop -p 200 -u root @ 1.3 log @Introduced enable variable. @ text @d8 1 d12 9 a20 4 @@l_prefix@@/sbin/zebra -d @@l_prefix@@/sbin/ripd -d @@l_prefix@@/sbin/ospfd -d @@l_prefix@@/sbin/bgpd -d d24 8 a31 4 kill -TERM `cat @@l_prefix@@/var/zebra/bgpd.pid` kill -TERM `cat @@l_prefix@@/var/zebra/ospfd.pid` kill -TERM `cat @@l_prefix@@/var/zebra/ripd.pid` kill -TERM `cat @@l_prefix@@/var/zebra/zebra.pid` @ 1.3.4.1 log @mass Merge-From-CURRENT (MFC) in preparation for OpenPKG 1.3 [class BASE only] @ text @d3 1 a3 1 ## rc.zebra -- Run-Commands d7 1 a7 7 zebra_enable="$openpkg_rc_def" zebra_protocols="rip ospf bgp" zebra_log_prolog="true" zebra_log_epilog="true" zebra_log_numfiles="10" zebra_log_minsize="1M" zebra_log_complevel="9" d9 2 a10 17 %status -u @@l_susr@@ -o zebra_usable="unknown" zebra_active="no" if [ -f @@l_prefix@@/var/zebra/zebra.pid ]; then kill -0 `cat @@l_prefix@@/var/zebra/zebra.pid` >/dev/null 2>&1 || true if [ $? -eq 0 ]; then zebra_active="yes" fi fi echo "zebra_enable=\"$zebra_enable\"" echo "zebra_usable=\"$zebra_usable\"" echo "zebra_active=\"$zebra_active\"" %start -u @@l_susr@@ rcService zebra enable yes || exit 0 rcService zebra active yes && exit 0 cd @@l_prefix@@/etc/zebra d12 10 a21 36 for protocol in $zebra_protocols; do if [ -f @@l_prefix@@/sbin/${protocol}d ]; then @@l_prefix@@/sbin/${protocol}d -d fi done @@l_prefix@@/bin/vtysh -b %stop -u @@l_susr@@ rcService zebra enable yes || exit 0 rcService zebra active no && exit 0 if [ -f @@l_prefix@@/var/zebra/zebra.pid ]; then kill -TERM `cat @@l_prefix@@/var/zebra/zebra.pid` >/dev/null 2>&1 || true fi for protocol in $zebra_protocols; do if [ -f @@l_prefix@@/var/zebra/${protocol}d.pid ]; then kill -TERM `cat @@l_prefix@@/var/zebra/${protocol}d.pid` >/dev/null 2>&1 || true fi done sleep 1 rm -f @@l_prefix@@/var/zebra/*.pid >/dev/null 2>&1 || true %restart -u @@l_susr@@ rcService zebra enable yes || exit 0 rcService zebra active no && exit 0 rc zebra stop start %daily -u @@l_susr@@ rcService zebra enable yes || exit 0 # rotate logfile shtool rotate -f \ -n ${zebra_log_numfiles} -s ${zebra_log_minsize} -d \ -z ${zebra_log_complevel} -m 644 -o @@l_susr@@ -g @@l_mgrp@@ \ -P "${zebra_log_prolog}" \ -E "${zebra_log_epilog} && rc zebra restart" \ @@l_prefix@@/var/zebra/zebra.log @ 1.3.4.2 log @MFC: all changes since last merge point @ text @a8 3 zebra_flags="" zebra_bind="127.0.0.1" zebra_port="2601" a30 9 flags="$zebra_flags" echo $flags | grep -- -A >/dev/null if [ $? -ne 0 -a ".$zebra_bind" != . ]; then flags="$flags -A $zebra_bind" fi echo $flags | grep -- -P >/dev/null if [ $? -ne 0 -a ".$zebra_port" != . ]; then flags="$flags -P $zebra_port" fi d32 1 a32 1 @@l_prefix@@/sbin/zebra -d $flags d65 1 a65 1 -z ${zebra_log_complevel} -m 640 -o @@l_susr@@ -g @@l_mgrp@@ \ @ 1.3.4.3 log @MFC: extend bind/listen logic to companion daemons @ text @a11 9 zebra_rip_flags="" zebra_rip_bind="${zebra_bind}" zebra_rip_port="2602" zebra_ospf_flags="" zebra_ospf_bind="${zebra_bind}" zebra_ospf_port="2604" zebra_bgp_flags="" zebra_bgp_bind="${zebra_bind}" zebra_bgp_port="2605" d34 9 d44 4 a47 21 for i in zebra $zebra_protocols; do if [ ".$i" = .zebra ]; then midfix="" daemon="${i}"; else midfix="${i}_"; daemon="${i}d"; fi if [ -x @@l_prefix@@/sbin/${daemon} ]; then flags=`eval echo \\\$zebra_${midfix}flags`; extra=`eval echo \\\$zebra_${midfix}bind`; echo $flags | grep -- -A >/dev/null if [ $? -ne 0 -a ".$extra" != . ]; then flags="$flags -A $extra" fi extra=`eval echo \\\$zebra_${midfix}port`; echo $flags | grep -- -P >/dev/null if [ $? -ne 0 -a ".$extra" != . ]; then flags="$flags -P $extra" fi @@l_prefix@@/sbin/${daemon} -d ${flags} @ 1.2 log @Mega-change: - prefix/etc/rpm -> prefix/etc/openpkg - prefix/lib/rpm -> prefix/lib/openpkg @ text @d6 3 d10 1 d17 1 @ 1.1 log @Initial revision @ text @d1 1 a1 1 #!@@l_prefix@@/lib/rpm/bash @@l_prefix@@/etc/rc @ 1.1.1.1 log @Import OpenPKG sources into CVS repository @ text @@