When stopping a specific daemon, _all_ routes are flushed

Bug #405195 reported by Tore Anderson
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
quagga (Debian)
Fix Released
Unknown
quagga (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Binary package hint: quagga

This misbehaviour just bit me:

root@fwtest1:~# /etc/init.d/quagga stop ospf6d
Stopping Quagga daemons (prio:0): ospf6d.
Removing all routes made by zebra.

So I'm stopping ospf6d only, but _all_ routes, including the ones installed by still-running processes such as bgpd, ripd, and so on, are removed from the kernel's routing table. That can't be right.

I suggest applying the following patch so that the flushing will only happen if all of the Quagga daemons are stopped:

--- /etc/init.d/quagga 2009-05-06 23:47:31.000000000 +0200
+++ /tmp/quagga.new 2009-07-27 10:30:44.000000000 +0200
@@ -235,8 +235,10 @@
  # Stop all daemons at level '0' or 'stop'
    stop_prio 0 $2

- echo "Removing all routes made by zebra."
- ip route flush proto zebra
+ if [ -z "$2" ]; then
+ echo "Removing all routes made by zebra."
+ ip route flush proto zebra
+ fi
     ;;

     restart|force-reload)

Tore

Revision history for this message
Chuck Short (zulcss) wrote :

Thanks for the patch however what happens when you stop all the domains that you are running for quagga, will you still have routed lying around?

Thanks
chuck

Changed in quagga (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Tore Anderson (toreanderson) wrote :

Hi, sorry about answering so late - I had overlooked this message.

What do you mean by «domains»?

Tore

Revision history for this message
David Clarke (a-launchpad-uber-geek-nz) wrote :

With the above patch applied stopping individual quagga daemons removes the routes they've created (stopping bgpd removes only routes learnt via BGP, etc). The apparent exception is zebra - that removes all routes.

This seems like far more reasonable behaviour.

BTW, the same bug also applies to at least Debian Lenny and Squeeze, so it may be worth pushing it (in whatever form it's accepted) upstream.

Changed in quagga (Debian):
status: Unknown → New
Changed in quagga (Debian):
status: New → Fix Released
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Fixed in Debian and thereby also in >=Zesty.
But the fix there is to move to the new systemd units. Which can't be directly SRU'ed.

OTOH even the sysV init is just like that for quite a while.
        if [ -z "$2" -o "$2" = "zebra" ]; then
          echo "Removing all routes made by zebra."
          ip route flush proto zebra
        fi

That is more or less the change that was suggested.
That is actually in since 0.99.22.1-2 which even Trusty is newer.
So I'd think it was only forgotten to close the bug here.

Changed in quagga (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.