]> git.proxmox.com Git - pve-network.git/commitdiff
controllers: evpn : use frr restart if reload fail
authorAlexandre Derumier <aderumier@odiso.com>
Wed, 23 Feb 2022 07:11:43 +0000 (08:11 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 24 Feb 2022 12:39:53 +0000 (13:39 +0100)
frr reload is not 100% perfect, and sometime is not able to
apply correctly changes.

Use restart in this case to be sure to have the correct config.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/Network/SDN/Controllers/EvpnPlugin.pm

index 70a9da153c9ccc6050ad51387b4c2431899a9758..0c498939dc09431dd131e806f7643eedb09b045a 100644 (file)
@@ -428,7 +428,13 @@ sub reload_controller {
     };
 
     if (-e $conf_file && -e $bin_path) {
     };
 
     if (-e $conf_file && -e $bin_path) {
-       run_command([$bin_path, '--stdout', '--reload', $conf_file], outfunc => {}, errfunc => $err);
+       eval {
+           run_command([$bin_path, '--stdout', '--reload', $conf_file], outfunc => {}, errfunc => $err);
+       };
+       if ($@) {
+           warn "frr reload command fail. Restarting frr.";
+           eval { run_command(['systemctl', 'restart', 'frr']); };
+       }
     }
 }
 
     }
 }