From: Michael Tremer Date: Sun, 31 Mar 2019 12:28:44 +0000 (+0200) Subject: bird: Make sure the daemon is always running X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Fnetwork.git;a=commitdiff_plain;h=39beacd0549be57fde9eb350c2c9292094537629 bird: Make sure the daemon is always running Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.bird b/src/functions/functions.bird index 55d43b58..1bbac8cd 100644 --- a/src/functions/functions.bird +++ b/src/functions/functions.bird @@ -33,6 +33,20 @@ bird_reload() { service_reload "bird.service" } +bird_enable() { + # Generate configuration file + if ! bird_generate_config; then + log ERROR "Could not write Bird configuration" + return ${EXIT_ERROR} + fi + + # Enable the service to be automatically started next time + service_enable "bird.service" + + # Start it now + bird_start +} + # Update configuration any apply it in one go bird_update() { if ! bird_generate_config; then diff --git a/src/functions/functions.route b/src/functions/functions.route index e6ea2441..b8338222 100644 --- a/src/functions/functions.route +++ b/src/functions/functions.route @@ -393,11 +393,8 @@ route_parse_line() { } route_apply() { - # Re-generate BIRD configuration - bird_generate_config - - # Reload the daemon - bird_reload + # Update bird + bird_update } route_entry_add() { diff --git a/src/network b/src/network index 300ba945..be06d8a2 100644 --- a/src/network +++ b/src/network @@ -1381,8 +1381,8 @@ case "${action}" in # Update resolv.conf(5) when initializing the network dns_generate_resolvconf - # Update bird configuration - bird_generate_config + # Make sure bird is running + bird_enable # Also execute all triggers triggers_execute_all "init"