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>
};
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']); };
+ }
}
}