summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Derumier <aderumier@odiso.com>2022-02-23 08:11:43 +0100
committerThomas Lamprecht <t.lamprecht@proxmox.com>2022-02-24 13:39:53 +0100
commit9c24bcc5eb191d6f59541dc714d4c8df672f0925 (patch)
tree72ffc9aab9d64f920c38d6bd1b0adc26c8280a4f
parentc5582ba30e3fec9f27cc1e18cedcbb6380c67689 (diff)
controllers: evpn : use frr restart if reload fail
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>
-rw-r--r--PVE/Network/SDN/Controllers/EvpnPlugin.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
index 70a9da1..0c49893 100644
--- a/PVE/Network/SDN/Controllers/EvpnPlugin.pm
+++ b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
@@ -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']); };
+ }
}
}