job / bird

BIRD dev branches
1 stars 0 forks source link

Allow shutdown communication through configuration #4

Open job opened 7 years ago

job commented 7 years ago
root@scarlett:/home/job# cat /etc/bird/bird.conf | tail -n 7
protocol bgp kali1 {
    local as 15562;
    neighbor 165.254.255.17 as 15562;
    source address 165.254.255.1;
    import none;
    export none;
       disabled "hello darkness my old friend";
}

BIRD allows you to shutdown a session (or keep it down) by setting disabled in the configuration stanza. The new feature should be that if you enter a string after the keyword disabled, that the string is considered the content of the shutdown communication.

If the string is too long, an error should be generated when bird is attempting to boot, or its configuration is reloaded through birdc configure.

If the session is already down (in case BIRD is running or booting), nothing needs to be done (like today with disabled). If the session is up, and BIRD's new config contains disabled 'herp'; then the session should be torn down and the shutdown communication send.

job commented 7 years ago

see 1aafcc01b65193f4a8994212cfc70345a99de415

job commented 7 years ago

What perhaps is somewhat more complicated is that the DISABLED configuration keyword is already defined at a higher level (defined here: https://github.com/job/bird/blob/master/nest/config.Y#L219 and instantiated in context of BGP here https://github.com/job/bird/blob/master/proto/bgp/config.Y#L69) and we need to specifically for the BGP protocol extend it, but not for the other protocols.

arjenz commented 7 years ago

Yes, and also for https://github.com/job/bird/issues/3 there's a similar problem, there's a "generic" shutdown codepath, that does currently not allow any extra parameters to be passed from the command line to the bgp process.