diff options
Diffstat (limited to 'import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files')
19 files changed, 660 insertions, 0 deletions
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/0001-ospf6d-check-ospf6-before-using-it-in-ospf6_clean.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/0001-ospf6d-check-ospf6-before-using-it-in-ospf6_clean.patch new file mode 100644 index 000000000..f08bb572d --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/0001-ospf6d-check-ospf6-before-using-it-in-ospf6_clean.patch @@ -0,0 +1,28 @@ +Upstream-Status: Pending + +Subject: ospf6d: check ospf6 before using it in ospf6_clean + +The ospf6 variable might be 'NULL' causing segment fault error. +Check it before referencing it. + +Signed-off-by: Chen Qi <Qi.Chen@windriver.com> +--- + ospf6d/ospf6d.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c +index 3cdd5c1..e3bf1af 100644 +--- a/ospf6d/ospf6d.c ++++ b/ospf6d/ospf6d.c +@@ -1892,6 +1892,8 @@ ospf6_init (void) + void + ospf6_clean (void) + { ++ if (ospf6 == NULL) ++ return; + if (ospf6->route_table) + ospf6_route_remove_all (ospf6->route_table); + if (ospf6->brouter_table) +-- +1.9.1 + diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/Zebra-sync-zebra-routing-table-with-the-kernel-one.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/Zebra-sync-zebra-routing-table-with-the-kernel-one.patch new file mode 100644 index 000000000..35f4637d8 --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/Zebra-sync-zebra-routing-table-with-the-kernel-one.patch @@ -0,0 +1,48 @@ +sync zebra routing table with the kernel one when interface is down + +Add router to kernel main router table with "ip", then you can see +a router item in kernel main router table. Also can see this router +item in zebra router table. If down the interface, this router item +will be deleted from kernel main router table, but it will not be +deleted from zebra router table, just set as inactive. + +This patch is adopted from [1]. +[1] http://www.gossamer-threads.com/lists/quagga/dev/22609 + +Upstream-Status: Pending + +Signed-of-by: Aws Ismail <aws.ismail@windriver.com> +Signed-of-by: Roy.Li <rongqing.li@windriver.com> + +--- + zebra/zebra_rib.c | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c +index 154e8d5..63434d0 100644 +--- a/zebra/zebra_rib.c ++++ b/zebra/zebra_rib.c +@@ -765,6 +765,9 @@ rib_match_ipv6 (struct in6_addr *addr) + #define RIB_SYSTEM_ROUTE(R) \ + ((R)->type == ZEBRA_ROUTE_KERNEL || (R)->type == ZEBRA_ROUTE_CONNECT) + ++#define RIB_KERNEL_ROUTE(R) \ ++ ((R)->type == ZEBRA_ROUTE_KERNEL) ++ + /* This function verifies reachability of one given nexthop, which can be + * numbered or unnumbered, IPv4 or IPv6. The result is unconditionally stored + * in nexthop->flags field. If the 4th parameter, 'set', is non-zero, +@@ -1135,6 +1138,10 @@ rib_process (struct route_node *rn) + redistribute_delete (&rn->p, fib); + if (! RIB_SYSTEM_ROUTE (fib)) + rib_uninstall_kernel (rn, fib); ++#ifdef GNU_LINUX ++ else if(RIB_KERNEL_ROUTE (fib) && !if_is_up(if_lookup_by_index(fib->nexthop->ifindex))) ++ del=fib; ++#endif + UNSET_FLAG (fib->flags, ZEBRA_FLAG_SELECTED); + + /* Set real nexthop. */ +-- +1.7.4.1 + diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/babel-close-the-stdout-stderr-as-in-other-daemons.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/babel-close-the-stdout-stderr-as-in-other-daemons.patch new file mode 100644 index 000000000..c2757a2fb --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/babel-close-the-stdout-stderr-as-in-other-daemons.patch @@ -0,0 +1,50 @@ +From ba71f768e6dbb1f2ac72ed3bd880bff75a48d345 Mon Sep 17 00:00:00 2001 +From: Roy Li <rongqing.li@windriver.com> +Date: Wed, 19 Feb 2014 14:13:40 +0800 +Subject: [PATCH] babeld: close stdout once the background daemon is created + +Upstream-Status: pending + +Once babald becomes a background daemon, it should not output information to +stdout, so need to close stdout. + +In fact, other daemons close their stdout when they run into background, like +ospfd, isisd and bgpd, by calling daemon() which is in lib/daemon.c + +Closing the stdout can fix a tee hang issue { #/usr/sbin/babeld -d |tee tmp } + +Signed-off-by: Roy Li <rongqing.li@windriver.com> +--- + babeld/util.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/babeld/util.c b/babeld/util.c +index 011f382..76203bc 100644 +--- a/babeld/util.c ++++ b/babeld/util.c +@@ -425,7 +425,7 @@ uchar_to_in6addr(struct in6_addr *dest, const unsigned char *src) + int + daemonise() + { +- int rc; ++ int rc, fd; + + fflush(stdout); + fflush(stderr); +@@ -441,5 +441,13 @@ daemonise() + if(rc < 0) + return -1; + ++ fd = open("/dev/null", O_RDWR, 0); ++ if (fd != -1) ++ { ++ dup2(fd, STDOUT_FILENO); ++ if (fd > 2) ++ close(fd); ++ } ++ + return 1; + } +-- +1.7.10.4 + diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/babeld.service b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/babeld.service new file mode 100644 index 000000000..dd344b0b3 --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/babeld.service @@ -0,0 +1,14 @@ +[Unit] +Description=Babel routing daemon +BindTo=zebra.service +After=zebra.service +ConditionPathExists=@SYSCONFDIR@/quagga/babeld.conf + +[Service] +Type=forking +EnvironmentFile=-@SYSCONFDIR@/default/quagga +ExecStart=@SBINDIR@/babeld -d $babeld_options -f /etc/quagga/babeld.conf +Restart=on-abort + +[Install] +WantedBy=multi-user.target diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/bgpd.service b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/bgpd.service new file mode 100644 index 000000000..76f9f61e7 --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/bgpd.service @@ -0,0 +1,16 @@ +[Unit] +Description=BGP routing daemon +BindTo=zebra.service +After=zebra.service +ConditionPathExists=@SYSCONFDIR@/quagga/bgpd.conf + +[Service] +Type=forking +EnvironmentFile=-@SYSCONFDIR@/default/quagga +PIDFile=@localstatedir@/run/quagga/bgpd.pid +ExecStart=@SBINDIR@/bgpd -d $bgpd_options -f @SYSCONFDIR@/quagga/bgpd.conf +ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/bgpd.pid +Restart=on-abort + +[Install] +WantedBy=multi-user.target diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/isisd.service b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/isisd.service new file mode 100644 index 000000000..9bfe7b65e --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/isisd.service @@ -0,0 +1,14 @@ +[Unit] +Description=IS-IS routing daemon +BindTo=zebra.service +After=zebra.service +ConditionPathExists=@SYSCONFDIR@/quagga/isisd.conf + +[Service] +Type=forking +EnvironmentFile=-@SYSCONFDIR@/default/quagga +ExecStart=@SBINDIR@/isisd -d $isisd_options -f /etc/quagga/isisd.conf +Restart=on-abort + +[Install] +WantedBy=multi-user.target diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ospf6d.service b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ospf6d.service new file mode 100644 index 000000000..a2e493b42 --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ospf6d.service @@ -0,0 +1,16 @@ +[Unit] +Description=OSPF routing daemon for IPv6 +BindTo=zebra.service +After=zebra.service +ConditionPathExists=@SYSCONFDIR@/quagga/ospf6d.conf + +[Service] +Type=forking +EnvironmentFile=-@SYSCONFDIR@/default/quagga +PIDFile=@localstatedir@/run/quagga/ospf6d.pid +ExecStart=@SBINDIR@/ospf6d -d $ospf6d_options -f @SYSCONFDIR@/quagga/ospf6d.conf +ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/ospf6d.pid +Restart=on-abort + +[Install] +WantedBy=multi-user.target diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ospfd.service b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ospfd.service new file mode 100644 index 000000000..0c62cbce5 --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ospfd.service @@ -0,0 +1,16 @@ +[Unit] +Description=OSPF routing daemon +BindTo=zebra.service +After=zebra.service +ConditionPathExists=@SYSCONFDIR@/quagga/ospfd.conf + +[Service] +Type=forking +EnvironmentFile=-@SYSCONFDIR@/default/quagga +PIDFile=@localstatedir@/run/quagga/ospfd.pid +ExecStart=@SBINDIR@/ospfd -d $ospfd_options -f @SYSCONFDIR@/quagga/ospfd.conf +ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/ospfd.pid +Restart=on-abort + +[Install] +WantedBy=multi-user.target diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch new file mode 100644 index 000000000..a07e33f9f --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch @@ -0,0 +1,54 @@ +quagga: Avoid duplicate connected address adding to the list + +commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal") +introduces an regression: ifp->connected list is cleaned up when ripd is +restarting, however, for interface addresses which are not specified in +ripd configuration file, they are never to be added into ifp->connected +again, this will lead to some abnormal behavior for route advertising. + +Instead of cleaning up the ifp->connected list to avoid duplicated +connected address being added into this list, we can check this +condition during interface address adding process and return early +when an identical address has already been added. + +Upstream-Status: Pending + +Signed-off-by: Hu Yadi <Yadi.hu@windriver.com> +Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com> +Signed-off-by: Joe MacDonald <joe@deserted.net> +--- +--- a/lib/if.c ++++ b/lib/if.c +@@ -738,6 +738,16 @@ connected_add_by_prefix (struct interfac + struct prefix *destination) + { + struct connected *ifc; ++ struct listnode *cnode; ++ struct connected *c; ++ int ret = 0; ++ ++ for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, c)) ++ { ++ ret = connected_same_prefix (p, (c->address)); ++ if(ret == 1) ++ return NULL; ++ } + + /* Allocate new connected address. */ + ifc = connected_new (); +--- a/ripd/rip_interface.c ++++ b/ripd/rip_interface.c +@@ -516,13 +516,6 @@ rip_interface_clean (void) + thread_cancel (ri->t_wakeup); + ri->t_wakeup = NULL; + } +- +- for (conn_node = listhead (ifp->connected); conn_node; conn_node = next) +- { +- ifc = listgetdata (conn_node); +- next = conn_node->next; +- listnode_delete (ifp->connected, ifc); +- } + } + } + diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.default b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.default new file mode 100644 index 000000000..0c1ce6c04 --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.default @@ -0,0 +1,13 @@ +# If this option is set the /etc/init.d/quagga script automatically loads +# the config via "vtysh -b" when the servers are started. +vtysh_enable=yes + +# Bind all daemons to loopback only by default +zebra_options=" --daemon -A 127.0.0.1" +babeld_options="--daemon -A 127.0.0.1" +bgpd_options=" --daemon -A 127.0.0.1" +ospfd_options=" --daemon -A 127.0.0.1" +ospf6d_options="--daemon -A ::1" +ripd_options=" --daemon -A 127.0.0.1" +ripngd_options="--daemon -A ::1" +isisd_options=" --daemon -A 127.0.0.1" diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.init b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.init new file mode 100644 index 000000000..60b5ab01a --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.init @@ -0,0 +1,200 @@ +#!/bin/sh +# +# /etc/init.d/quagga -- start/stop the Quagga routing daemons +# +# Based on debian version by Endre Hirling <endre@mail.elte.hu> and +# Christian Hammers <ch@debian.org>. +# + +### BEGIN INIT INFO +# Provides: quagga +# Required-Start: $local_fs $network $remote_fs $syslog +# Required-Stop: $local_fs $network $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start and stop the Quagga routing suite +# Description: Quagga is a routing suite for IP routing protocols like +# BGP, OSPF, RIP and others. This script contols the main +# daemon "quagga" as well as the individual protocol daemons. +### END INIT INFO + +# NOTE: sbin must be before bin so we get the iproute2 ip and not the +# busybox ip command. The busybox one flushes all routes instead of just +# the dynamic routes +PATH=/sbin:/usr/sbin:/bin:/usr/bin:/sbin +D_PATH=/usr/sbin +C_PATH=/etc/quagga + +# Keep zebra first and do not list watchquagga! +DAEMONS="zebra bgpd ripd ripngd ospfd ospf6d isisd babeld" + +# Print the name of the pidfile. +pidfile() +{ + echo "/var/run/quagga/$1.pid" +} + +# Check if daemon is started by using the pidfile. +started() +{ + [ -e `pidfile $1` ] && kill -0 `cat \`pidfile $1\`` 2> /dev/null && return 0 + return 1 +} + +# Loads the config via vtysh -b if configured to do so. +vtysh_b () +{ + # Rember, that all variables have been incremented by 1 in convert_daemon_prios() + if [ "$vtysh_enable" = 2 -a -f $C_PATH/Quagga.conf ]; then + /usr/bin/vtysh -b + fi +} + +# Check if the daemon is activated and if its executable and config files +# are in place. +# params: daemon name +# returns: 0=ok, 1=error +check_daemon() +{ + # If the integrated config file is used the others are not checked. + if [ -r "$C_PATH/Quagga.conf" ]; then + return 0 + fi + + # check for config file + if [ ! -r "$C_PATH/$1.conf" ]; then + return 1 + fi + return 0 +} + +# Starts the server if it's not alrady running according to the pid file. +# The Quagga daemons creates the pidfile when starting. +start() +{ + if ! check_daemon $1; then echo -n " (!$1)"; return; fi + echo -n " $1" + start-stop-daemon \ + --start \ + --pidfile=`pidfile $1` \ + --exec "$D_PATH/$1" \ + -- \ + `eval echo "$""$1""_options"` + +} + +# Stop the daemon given in the parameter, printing its name to the terminal. +stop() +{ + if ! started "$1" ; then + echo -n " (!$1)" + return 0 + else + PIDFILE=`pidfile $1` + PID=`cat $PIDFILE 2>/dev/null` + start-stop-daemon --stop --quiet --exec "$D_PATH/$1" + # + # Now we have to wait until $DAEMON has _really_ stopped. + # + if test -n "$PID" && kill -0 $PID 2>/dev/null; then + echo -n " (waiting) ." + cnt=0 + while kill -0 $PID 2>/dev/null; do + cnt=`expr $cnt + 1` + if [ $cnt -gt 60 ]; then + # Waited 120 secs now, fail. + echo -n "Failed.. " + break + fi + sleep 2 + echo -n "." + done + fi + echo -n " $1" + rm -f `pidfile $1` + fi +} + +stop_all() +{ + local daemon_list + daemon_list=${1:-$DAEMONS} + + echo -n "Stopping Quagga daemons:" + for daemon_name in $daemon_list; do + stop "$daemon_name" + done + echo "." +} + +start_all() +{ + local daemon_list + daemon_list=${1:-$DAEMONS} + + echo -n "Starting Quagga daemons:" + for daemon_name in $daemon_list; do + start "$daemon_name" + done + echo "." +} + +status_all() +{ + local daemon_list + daemon_list=${1:-$DAEMONS} + res=1 + + echo -n "quagga: " + for daemon_name in $daemon_list; do + if started "$daemon_name" ; then + id=`cat \`pidfile $daemon_name\`` + echo -n "$daemon_name (pid $id) " + res=0 + fi + done + if [ $res -eq 0 ]; then + echo "is running..." + else + echo "is stopped..." + fi + exit $res +} + +######################################################### +# Main program # +######################################################### + +# Load configuration +test -f /etc/default/quagga && . /etc/default/quagga + +case "$1" in + start) + cd $C_PATH/ + start_all $2 + vtysh_b + ;; + + stop) + stop_all $2 + echo "Removing all routes made by zebra." + ip route flush proto zebra + ;; + + status) + status_all $2 + ;; + + restart|force-reload) + $0 stop $2 + sleep 1 + $0 start $2 + ;; + + *) + echo "Usage: /etc/init.d/quagga {start|stop|restart|status|force-reload} [daemon]" + exit 1 + ;; +esac + +exit 0 diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.pam b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.pam new file mode 100644 index 000000000..3541a975a --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.pam @@ -0,0 +1,13 @@ +# +# The PAM configuration file for the quagga `vtysh' service +# + +# This allows root to change user infomation without being +# prompted for a password +auth sufficient pam_rootok.so + +# The standard Unix authentication modules, used with +# NIS (man nsswitch) as well as normal /etc/passwd and +# /etc/shadow entries. +auth include common-auth + diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch new file mode 100644 index 000000000..4b8c9a929 --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch @@ -0,0 +1,50 @@ +ripd: Fix two bugs after received SIGHUP signal + +There are two problems for ripd implementation after received +SIGHUP signal: +1). ripd didn't clean up ifp->connected list before reload + configuration file. +2). ripd reset ri->split_horizon flag to RIP_NO_SPLIT_HORIZON + which lead to the unnecessary route to be advertised. + +Upstream-Status: Submitted [http://patchwork.diac24.net/patch/604/] + +Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com> +Signed-off-by: Joe MacDonald <joe@deserted.net> +--- +--- a/ripd/rip_interface.c ++++ b/ripd/rip_interface.c +@@ -500,6 +500,8 @@ + struct listnode *node; + struct interface *ifp; + struct rip_interface *ri; ++ struct connected *ifc; ++ struct listnode *conn_node, *next; + + for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) + { +@@ -514,6 +516,13 @@ + thread_cancel (ri->t_wakeup); + ri->t_wakeup = NULL; + } ++ ++ for (conn_node = listhead (ifp->connected); conn_node; conn_node = next) ++ { ++ ifc = listgetdata (conn_node); ++ next = conn_node->next; ++ listnode_delete (ifp->connected, ifc); ++ } + } + } + +@@ -548,8 +557,8 @@ + ri->key_chain = NULL; + } + +- ri->split_horizon = RIP_NO_SPLIT_HORIZON; +- ri->split_horizon_default = RIP_NO_SPLIT_HORIZON; ++ ri->split_horizon = RIP_SPLIT_HORIZON; ++ ri->split_horizon_default = RIP_SPLIT_HORIZON; + + ri->list[RIP_FILTER_IN] = NULL; + ri->list[RIP_FILTER_OUT] = NULL; diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripd.service b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripd.service new file mode 100644 index 000000000..1d20389e8 --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripd.service @@ -0,0 +1,16 @@ +[Unit] +Description=RIP routing daemon +BindTo=zebra.service +After=zebra.service +ConditionPathExists=@SYSCONFDIR@/quagga/ripd.conf + +[Service] +Type=forking +EnvironmentFile=-@SYSCONFDIR@/default/quagga +PIDFile=@localstatedir@/run/quagga/ripd.pid +ExecStart=@SBINDIR@/ripd -d $ripd_options -f @SYSCONFDIR@/quagga/ripd.conf +ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/ripd.pid +Restart=on-abort + +[Install] +WantedBy=multi-user.target diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripngd.service b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripngd.service new file mode 100644 index 000000000..0355ad12a --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripngd.service @@ -0,0 +1,16 @@ +[Unit] +Description=RIP routing daemon for IPv6 +BindTo=zebra.service +After=zebra.service +ConditionPathExists=@SYSCONFDIR@/quagga/ripngd.conf + +[Service] +Type=forking +EnvironmentFile=-@SYSCONFDIR@/default/quagga +PIDFile=@localstatedir@/run/quagga/ripngd.pid +ExecStart=@SBINDIR@/ripngd -d $ripngd_options -f @SYSCONFDIR@/quagga/ripngd.conf +ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/ripngd.pid +Restart=on-abort + +[Install] +WantedBy=multi-user.target diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga new file mode 100644 index 000000000..1f28c0b24 --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga @@ -0,0 +1,3 @@ +# <type> <owner> <group> <mode> <path> <linksource> +d quagga quagga 0755 /var/run/quagga none +d quagga quagga 0755 /var/log/quagga none diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/watchquagga.default b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/watchquagga.default new file mode 100644 index 000000000..2d601ec97 --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/watchquagga.default @@ -0,0 +1,12 @@ +# Watchquagga configuration +#watch_daemons="zebra bgpd ospfd ospf6d ripd ripngd" +watch_daemons="zebra" + +# To enable restarts when multiple daemons are being used, uncomment this line (but first be sure to edit +# the WATCH_DAEMONS line to reflect the daemons you are actually using): +#watch_options="-Az -b_ -r/etc/init.d/quagga_restart_%s -s/etc/init.d/quagga_start_%s -k/etc/init.d/quagga_stop_%s" + +# Since we are using one quagga daemon for now, use the following line. If using +# multiple daemons, comment the line below and uncoment the line mentioned +# above. +watch_options="-z -b_ -r/etc/init.d/quagga_restart_%s" diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/watchquagga.init b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/watchquagga.init new file mode 100644 index 000000000..5ddd94a3d --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/watchquagga.init @@ -0,0 +1,64 @@ +#!/bin/sh +# +### BEGIN INIT INFO +# Provides: watchquagga +# Required-Start: $local_fs $network $remote_fs $syslog +# Required-Stop: $local_fs $network $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start and stop the Quagga watchdog +### END INIT INFO + +PATH=/bin:/usr/bin:/sbin:/usr/sbin + +# Load configuration +test -f /etc/default/watchquagga && . /etc/default/watchquagga + +# Check that there are daemons to be monitored. +[ -z "$watch_daemons" ] && exit 0 + +pidfile="/var/run/quagga/watchquagga.pid" + +case "$1" in + start) + echo -n "Starting quagga watchdog daemon: watchquagga" + start-stop-daemon --start \ + --pidfile $pidfile \ + --exec /usr/sbin/watchquagga \ + -- -d $watch_options $watch_daemons + echo "." + ;; + + stop) + echo -n "Stopping quagga watchdog daemon: watchquagga" + start-stop-daemon --stop --quiet \ + --pidfile $pidfile + echo "." + ;; + + status) + echo -n "watchquagga " + res=1 + [ -e $pidfile ] && kill -0 `cat $pidfile` 2> /dev/null + if [ $? -eq 0 ]; then + echo "(pid `cat $pidfile`) is running..." + res=0 + else + echo "is stopped..." + fi + exit $res + ;; + + restart|force-reload) + $0 stop $2 + sleep 1 + $0 start $2 + ;; + + *) + echo "Usage: /etc/init.d/watchquagga {start|stop|restart|force-reload}" + exit 1 + ;; +esac + +exit 0 diff --git a/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/zebra.service b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/zebra.service new file mode 100644 index 000000000..e4fb6c808 --- /dev/null +++ b/import-layers/meta-openembedded/meta-networking/recipes-protocols/quagga/files/zebra.service @@ -0,0 +1,17 @@ +[Unit] +Description=GNU Zebra routing manager +Wants=network.target +Before=network.target +ConditionPathExists=@SYSCONFDIR@/quagga/zebra.conf + +[Service] +Type=forking +EnvironmentFile=-@SYSCONFDIR@/default/quagga +PIDFile=@localstatedir@/run/quagga/zebra.pid +ExecStartPre=@BASE_SBINDIR@/ip route flush proto zebra +ExecStart=@SBINDIR@/zebra -d $zebra_options -f @SYSCONFDIR@/quagga/zebra.conf +ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/zebra.pid +Restart=on-abort + +[Install] +WantedBy=multi-user.target |