diff options
Diffstat (limited to 'meta-networking/recipes-protocols/quagga/files')
7 files changed, 370 insertions, 0 deletions
diff --git a/meta-networking/recipes-protocols/quagga/files/fix-for-lib-inpath.patch b/meta-networking/recipes-protocols/quagga/files/fix-for-lib-inpath.patch new file mode 100644 index 0000000000..50f0ad502f --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/fix-for-lib-inpath.patch | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | At first this worked, then I tried a clean build in a directory that | ||
| 2 | contained lib in it (oe/build/titan-glibc) and vtysh no longer | ||
| 3 | worked. It's test for the lib directory was excepting anything | ||
| 4 | containing lib. | ||
| 5 | |||
| 6 | With this patch you still cannot have lib in the path anywhere, but | ||
| 7 | at least things containing lib will now work. | ||
| 8 | |||
| 9 | --- quagga-0.99.2/vtysh/extract.pl.in 2005/11/16 04:12:04 1.1 | ||
| 10 | +++ quagga-0.99.2/vtysh/extract.pl.in 2005/11/16 04:12:16 | ||
| 11 | @@ -89,7 +89,7 @@ | ||
| 12 | $cmd =~ s/\s+$//g; | ||
| 13 | |||
| 14 | # $protocol is VTYSH_PROTO format for redirection of user input | ||
| 15 | - if ($file =~ /lib/) { | ||
| 16 | + if ($file =~ /\/lib\//) { | ||
| 17 | if ($file =~ /keychain.c/) { | ||
| 18 | $protocol = "VTYSH_RIPD"; | ||
| 19 | } | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/quagga-0.99.17-libcap.patch b/meta-networking/recipes-protocols/quagga/files/quagga-0.99.17-libcap.patch new file mode 100644 index 0000000000..9563ea2f36 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/quagga-0.99.17-libcap.patch | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | From 63e97633d01908da6d3776ac61e4033e6fa91e5c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= <flameeyes@gmail.com> | ||
| 3 | Date: Sun, 5 Sep 2010 18:19:09 +0200 | ||
| 4 | Subject: [PATCH] build: fix linking position for libcap | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | * lib/Makefile.am: link libzebra to libcap, since it uses symbols | ||
| 10 | from there. | ||
| 11 | * zebra/Makefile.am: no need to link libcap here now, since it's not | ||
| 12 | used directly (libtool with apply transitive dependencies for | ||
| 13 | static linking). | ||
| 14 | |||
| 15 | Signed-off-by: Diego Elio Pettenò <flameeyes@gmail.com> | ||
| 16 | |||
| 17 | Imported from Gentoo by Paul Eggleton <paul.eggleton@linux.intel.com> | ||
| 18 | Upstream-Status: Pending | ||
| 19 | |||
| 20 | --- | ||
| 21 | lib/Makefile.am | 2 +- | ||
| 22 | zebra/Makefile.am | 5 ++--- | ||
| 23 | 2 files changed, 3 insertions(+), 4 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/lib/Makefile.am b/lib/Makefile.am | ||
| 26 | index 315e919..6e69993 100644 | ||
| 27 | --- a/lib/Makefile.am | ||
| 28 | +++ b/lib/Makefile.am | ||
| 29 | @@ -18,7 +18,7 @@ BUILT_SOURCES = memtypes.h route_types.h | ||
| 30 | |||
| 31 | libzebra_la_DEPENDENCIES = @LIB_REGEX@ | ||
| 32 | |||
| 33 | -libzebra_la_LIBADD = @LIB_REGEX@ | ||
| 34 | +libzebra_la_LIBADD = @LIB_REGEX@ $(LIBCAP) | ||
| 35 | |||
| 36 | pkginclude_HEADERS = \ | ||
| 37 | buffer.h checksum.h command.h filter.h getopt.h hash.h \ | ||
| 38 | diff --git a/zebra/Makefile.am b/zebra/Makefile.am | ||
| 39 | index 542f36f..d09a209 100644 | ||
| 40 | --- a/zebra/Makefile.am | ||
| 41 | +++ b/zebra/Makefile.am | ||
| 42 | @@ -5,7 +5,6 @@ DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" -DMULTIPATH_NUM=@MULTIPATH_NUM@ | ||
| 43 | INSTALL_SDATA=@INSTALL@ -m 600 | ||
| 44 | |||
| 45 | LIB_IPV6 = @LIB_IPV6@ | ||
| 46 | -LIBCAP = @LIBCAP@ | ||
| 47 | |||
| 48 | ipforward = @IPFORWARD@ | ||
| 49 | if_method = @IF_METHOD@ | ||
| 50 | @@ -39,9 +38,9 @@ noinst_HEADERS = \ | ||
| 51 | connected.h ioctl.h rib.h rt.h zserv.h redistribute.h debug.h rtadv.h \ | ||
| 52 | interface.h ipforward.h irdp.h router-id.h kernel_socket.h | ||
| 53 | |||
| 54 | -zebra_LDADD = $(otherobj) $(LIBCAP) $(LIB_IPV6) ../lib/libzebra.la | ||
| 55 | +zebra_LDADD = $(otherobj) ../lib/libzebra.la $(LIB_IPV6) | ||
| 56 | |||
| 57 | -testzebra_LDADD = $(LIBCAP) $(LIB_IPV6) ../lib/libzebra.la | ||
| 58 | +testzebra_LDADD = ../lib/libzebra.la $(LIB_IPV6) | ||
| 59 | |||
| 60 | zebra_DEPENDENCIES = $(otherobj) | ||
| 61 | |||
| 62 | -- | ||
| 63 | 1.7.2.2 | ||
| 64 | |||
diff --git a/meta-networking/recipes-protocols/quagga/files/quagga.default b/meta-networking/recipes-protocols/quagga/files/quagga.default new file mode 100644 index 0000000000..438c3b6035 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/quagga.default | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | # If this option is set the /etc/init.d/quagga script automatically loads | ||
| 2 | # the config via "vtysh -b" when the servers are started. | ||
| 3 | vtysh_enable=yes | ||
| 4 | |||
| 5 | # Bind all daemons to loopback only by default | ||
| 6 | zebra_options=" --daemon -A 127.0.0.1" | ||
| 7 | babeld_options="-D 127.0.0.1" | ||
| 8 | bgpd_options=" --daemon -A 127.0.0.1" | ||
| 9 | ospfd_options=" --daemon -A 127.0.0.1" | ||
| 10 | ospf6d_options="--daemon -A ::1" | ||
| 11 | ripd_options=" --daemon -A 127.0.0.1" | ||
| 12 | ripngd_options="--daemon -A ::1" | ||
| 13 | isisd_options=" --daemon -A 127.0.0.1" | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/quagga.init b/meta-networking/recipes-protocols/quagga/files/quagga.init new file mode 100644 index 0000000000..60b5ab01a1 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/quagga.init | |||
| @@ -0,0 +1,200 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # /etc/init.d/quagga -- start/stop the Quagga routing daemons | ||
| 4 | # | ||
| 5 | # Based on debian version by Endre Hirling <endre@mail.elte.hu> and | ||
| 6 | # Christian Hammers <ch@debian.org>. | ||
| 7 | # | ||
| 8 | |||
| 9 | ### BEGIN INIT INFO | ||
| 10 | # Provides: quagga | ||
| 11 | # Required-Start: $local_fs $network $remote_fs $syslog | ||
| 12 | # Required-Stop: $local_fs $network $remote_fs $syslog | ||
| 13 | # Default-Start: 2 3 4 5 | ||
| 14 | # Default-Stop: 0 1 6 | ||
| 15 | # Short-Description: start and stop the Quagga routing suite | ||
| 16 | # Description: Quagga is a routing suite for IP routing protocols like | ||
| 17 | # BGP, OSPF, RIP and others. This script contols the main | ||
| 18 | # daemon "quagga" as well as the individual protocol daemons. | ||
| 19 | ### END INIT INFO | ||
| 20 | |||
| 21 | # NOTE: sbin must be before bin so we get the iproute2 ip and not the | ||
| 22 | # busybox ip command. The busybox one flushes all routes instead of just | ||
| 23 | # the dynamic routes | ||
| 24 | PATH=/sbin:/usr/sbin:/bin:/usr/bin:/sbin | ||
| 25 | D_PATH=/usr/sbin | ||
| 26 | C_PATH=/etc/quagga | ||
| 27 | |||
| 28 | # Keep zebra first and do not list watchquagga! | ||
| 29 | DAEMONS="zebra bgpd ripd ripngd ospfd ospf6d isisd babeld" | ||
| 30 | |||
| 31 | # Print the name of the pidfile. | ||
| 32 | pidfile() | ||
| 33 | { | ||
| 34 | echo "/var/run/quagga/$1.pid" | ||
| 35 | } | ||
| 36 | |||
| 37 | # Check if daemon is started by using the pidfile. | ||
| 38 | started() | ||
| 39 | { | ||
| 40 | [ -e `pidfile $1` ] && kill -0 `cat \`pidfile $1\`` 2> /dev/null && return 0 | ||
| 41 | return 1 | ||
| 42 | } | ||
| 43 | |||
| 44 | # Loads the config via vtysh -b if configured to do so. | ||
| 45 | vtysh_b () | ||
| 46 | { | ||
| 47 | # Rember, that all variables have been incremented by 1 in convert_daemon_prios() | ||
| 48 | if [ "$vtysh_enable" = 2 -a -f $C_PATH/Quagga.conf ]; then | ||
| 49 | /usr/bin/vtysh -b | ||
| 50 | fi | ||
| 51 | } | ||
| 52 | |||
| 53 | # Check if the daemon is activated and if its executable and config files | ||
| 54 | # are in place. | ||
| 55 | # params: daemon name | ||
| 56 | # returns: 0=ok, 1=error | ||
| 57 | check_daemon() | ||
| 58 | { | ||
| 59 | # If the integrated config file is used the others are not checked. | ||
| 60 | if [ -r "$C_PATH/Quagga.conf" ]; then | ||
| 61 | return 0 | ||
| 62 | fi | ||
| 63 | |||
| 64 | # check for config file | ||
| 65 | if [ ! -r "$C_PATH/$1.conf" ]; then | ||
| 66 | return 1 | ||
| 67 | fi | ||
| 68 | return 0 | ||
| 69 | } | ||
| 70 | |||
| 71 | # Starts the server if it's not alrady running according to the pid file. | ||
| 72 | # The Quagga daemons creates the pidfile when starting. | ||
| 73 | start() | ||
| 74 | { | ||
| 75 | if ! check_daemon $1; then echo -n " (!$1)"; return; fi | ||
| 76 | echo -n " $1" | ||
| 77 | start-stop-daemon \ | ||
| 78 | --start \ | ||
| 79 | --pidfile=`pidfile $1` \ | ||
| 80 | --exec "$D_PATH/$1" \ | ||
| 81 | -- \ | ||
| 82 | `eval echo "$""$1""_options"` | ||
| 83 | |||
| 84 | } | ||
| 85 | |||
| 86 | # Stop the daemon given in the parameter, printing its name to the terminal. | ||
| 87 | stop() | ||
| 88 | { | ||
| 89 | if ! started "$1" ; then | ||
| 90 | echo -n " (!$1)" | ||
| 91 | return 0 | ||
| 92 | else | ||
| 93 | PIDFILE=`pidfile $1` | ||
| 94 | PID=`cat $PIDFILE 2>/dev/null` | ||
| 95 | start-stop-daemon --stop --quiet --exec "$D_PATH/$1" | ||
| 96 | # | ||
| 97 | # Now we have to wait until $DAEMON has _really_ stopped. | ||
| 98 | # | ||
| 99 | if test -n "$PID" && kill -0 $PID 2>/dev/null; then | ||
| 100 | echo -n " (waiting) ." | ||
| 101 | cnt=0 | ||
| 102 | while kill -0 $PID 2>/dev/null; do | ||
| 103 | cnt=`expr $cnt + 1` | ||
| 104 | if [ $cnt -gt 60 ]; then | ||
| 105 | # Waited 120 secs now, fail. | ||
| 106 | echo -n "Failed.. " | ||
| 107 | break | ||
| 108 | fi | ||
| 109 | sleep 2 | ||
| 110 | echo -n "." | ||
| 111 | done | ||
| 112 | fi | ||
| 113 | echo -n " $1" | ||
| 114 | rm -f `pidfile $1` | ||
| 115 | fi | ||
| 116 | } | ||
| 117 | |||
| 118 | stop_all() | ||
| 119 | { | ||
| 120 | local daemon_list | ||
| 121 | daemon_list=${1:-$DAEMONS} | ||
| 122 | |||
| 123 | echo -n "Stopping Quagga daemons:" | ||
| 124 | for daemon_name in $daemon_list; do | ||
| 125 | stop "$daemon_name" | ||
| 126 | done | ||
| 127 | echo "." | ||
| 128 | } | ||
| 129 | |||
| 130 | start_all() | ||
| 131 | { | ||
| 132 | local daemon_list | ||
| 133 | daemon_list=${1:-$DAEMONS} | ||
| 134 | |||
| 135 | echo -n "Starting Quagga daemons:" | ||
| 136 | for daemon_name in $daemon_list; do | ||
| 137 | start "$daemon_name" | ||
| 138 | done | ||
| 139 | echo "." | ||
| 140 | } | ||
| 141 | |||
| 142 | status_all() | ||
| 143 | { | ||
| 144 | local daemon_list | ||
| 145 | daemon_list=${1:-$DAEMONS} | ||
| 146 | res=1 | ||
| 147 | |||
| 148 | echo -n "quagga: " | ||
| 149 | for daemon_name in $daemon_list; do | ||
| 150 | if started "$daemon_name" ; then | ||
| 151 | id=`cat \`pidfile $daemon_name\`` | ||
| 152 | echo -n "$daemon_name (pid $id) " | ||
| 153 | res=0 | ||
| 154 | fi | ||
| 155 | done | ||
| 156 | if [ $res -eq 0 ]; then | ||
| 157 | echo "is running..." | ||
| 158 | else | ||
| 159 | echo "is stopped..." | ||
| 160 | fi | ||
| 161 | exit $res | ||
| 162 | } | ||
| 163 | |||
| 164 | ######################################################### | ||
| 165 | # Main program # | ||
| 166 | ######################################################### | ||
| 167 | |||
| 168 | # Load configuration | ||
| 169 | test -f /etc/default/quagga && . /etc/default/quagga | ||
| 170 | |||
| 171 | case "$1" in | ||
| 172 | start) | ||
| 173 | cd $C_PATH/ | ||
| 174 | start_all $2 | ||
| 175 | vtysh_b | ||
| 176 | ;; | ||
| 177 | |||
| 178 | stop) | ||
| 179 | stop_all $2 | ||
| 180 | echo "Removing all routes made by zebra." | ||
| 181 | ip route flush proto zebra | ||
| 182 | ;; | ||
| 183 | |||
| 184 | status) | ||
| 185 | status_all $2 | ||
| 186 | ;; | ||
| 187 | |||
| 188 | restart|force-reload) | ||
| 189 | $0 stop $2 | ||
| 190 | sleep 1 | ||
| 191 | $0 start $2 | ||
| 192 | ;; | ||
| 193 | |||
| 194 | *) | ||
| 195 | echo "Usage: /etc/init.d/quagga {start|stop|restart|status|force-reload} [daemon]" | ||
| 196 | exit 1 | ||
| 197 | ;; | ||
| 198 | esac | ||
| 199 | |||
| 200 | exit 0 | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga b/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga new file mode 100644 index 0000000000..cfb896a17b --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | # <type> <owner> <group> <mode> <path> <linksource> | ||
| 2 | d quagga quagga 0755 /var/run/quagga none | ||
| 3 | d quagga quagga 0755 /var/log/quagga none \ No newline at end of file | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/watchquagga.default b/meta-networking/recipes-protocols/quagga/files/watchquagga.default new file mode 100644 index 0000000000..53f6a8cf10 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/watchquagga.default | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # Watchquagga configuration | ||
| 2 | #watch_daemons="zebra bgpd ospfd ospf6d ripd ripngd" | ||
| 3 | watch_daemons="zebra" | ||
| 4 | |||
| 5 | # To enable restarts, uncomment this line (but first be sure to edit | ||
| 6 | # the WATCH_DAEMONS line to reflect the daemons you are actually using): | ||
| 7 | watch_options="-z -b_ -r/etc/init.d/quagga_restart_%s -s/etc/init.d/quagga_start_%s -k/etc/init.d/quagga_stop_%s" | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/watchquagga.init b/meta-networking/recipes-protocols/quagga/files/watchquagga.init new file mode 100644 index 0000000000..5ddd94a3d6 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/watchquagga.init | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | ### BEGIN INIT INFO | ||
| 4 | # Provides: watchquagga | ||
| 5 | # Required-Start: $local_fs $network $remote_fs $syslog | ||
| 6 | # Required-Stop: $local_fs $network $remote_fs $syslog | ||
| 7 | # Default-Start: 2 3 4 5 | ||
| 8 | # Default-Stop: 0 1 6 | ||
| 9 | # Short-Description: start and stop the Quagga watchdog | ||
| 10 | ### END INIT INFO | ||
| 11 | |||
| 12 | PATH=/bin:/usr/bin:/sbin:/usr/sbin | ||
| 13 | |||
| 14 | # Load configuration | ||
| 15 | test -f /etc/default/watchquagga && . /etc/default/watchquagga | ||
| 16 | |||
| 17 | # Check that there are daemons to be monitored. | ||
| 18 | [ -z "$watch_daemons" ] && exit 0 | ||
| 19 | |||
| 20 | pidfile="/var/run/quagga/watchquagga.pid" | ||
| 21 | |||
| 22 | case "$1" in | ||
| 23 | start) | ||
| 24 | echo -n "Starting quagga watchdog daemon: watchquagga" | ||
| 25 | start-stop-daemon --start \ | ||
| 26 | --pidfile $pidfile \ | ||
| 27 | --exec /usr/sbin/watchquagga \ | ||
| 28 | -- -d $watch_options $watch_daemons | ||
| 29 | echo "." | ||
| 30 | ;; | ||
| 31 | |||
| 32 | stop) | ||
| 33 | echo -n "Stopping quagga watchdog daemon: watchquagga" | ||
| 34 | start-stop-daemon --stop --quiet \ | ||
| 35 | --pidfile $pidfile | ||
| 36 | echo "." | ||
| 37 | ;; | ||
| 38 | |||
| 39 | status) | ||
| 40 | echo -n "watchquagga " | ||
| 41 | res=1 | ||
| 42 | [ -e $pidfile ] && kill -0 `cat $pidfile` 2> /dev/null | ||
| 43 | if [ $? -eq 0 ]; then | ||
| 44 | echo "(pid `cat $pidfile`) is running..." | ||
| 45 | res=0 | ||
| 46 | else | ||
| 47 | echo "is stopped..." | ||
| 48 | fi | ||
| 49 | exit $res | ||
| 50 | ;; | ||
| 51 | |||
| 52 | restart|force-reload) | ||
| 53 | $0 stop $2 | ||
| 54 | sleep 1 | ||
| 55 | $0 start $2 | ||
| 56 | ;; | ||
| 57 | |||
| 58 | *) | ||
| 59 | echo "Usage: /etc/init.d/watchquagga {start|stop|restart|force-reload}" | ||
| 60 | exit 1 | ||
| 61 | ;; | ||
| 62 | esac | ||
| 63 | |||
| 64 | exit 0 | ||
