]> git.ipfire.org Git - people/stevee/network.git/commitdiff
bird: Make sure the daemon is always running
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 31 Mar 2019 12:28:44 +0000 (14:28 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 31 Mar 2019 12:28:44 +0000 (14:28 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.bird
src/functions/functions.route
src/network

index 55d43b58619aca58d2f96781925c81c87c3248e6..1bbac8cd3081c72c685ab0ef43ab9e72080a52db 100644 (file)
@@ -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
index e6ea2441ef0a69c10dda0a10c7808eab7912425d..b8338222556c8b2fa3e63a0c78346ca8586c5fa1 100644 (file)
@@ -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() {
index 300ba945b21e035f16ead7910af1a5b6b600b408..be06d8a28be24be64384e75b11beb2432c416d02 100644 (file)
@@ -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"