]> git.proxmox.com Git - pve-network.git/blobdiff - PVE/Network/SDN/Controllers/EvpnPlugin.pm
controllers: evpn : use frr restart if reload fail
[pve-network.git] / 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) {
-       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']); };
+       }
     }
 }