Skip to content

Commit c243af0

Browse files
authored
[bgp][service] Start bgp service after interfaces-config service (#11827)
- Why I did it interfaces-config service restarts networking service, during the restart loopback interface address is being removed and reassigned back, leaving loopback without an ipv4 address for a while. On SONiC startup and config reload interfaces-config and bgp services start in parallel and sometimes fpmsyncd in bgp attempts bind to loopback while it does not have an address, fails with the log Exception "Cannot assign requested address" had been thrown in daemon and exits with rc 0. root@sonic:/# supervisorctl status fpmsyncd EXITED Jul 20 05:04 AM zebra RUNNING pid 35, uptime 6:15:05 zsocket EXITED Jul 20 05:04 AM docker logs bgp INFO exited: fpmsyncd (exit status 0; expected) With fpmsyncd dead, configured routes do not appear in the database. - How I did it Added ordering dependency on interfaces-config service into bgp.config - How to verify it Itself the issue reproduces quite rarely, but one can gain the time interval between networking down and networking up in interfaces-config.sh like this: diff --git a/files/image_config/interfaces/interfaces-config.sh b/files/image_config/interfaces/interfaces-config.sh index f6aa414..87caceeff 100755 --- a/files/image_config/interfaces/interfaces-config.sh +++ b/files/image_config/interfaces/interfaces-config.sh @@ -63,7 +63,11 @@ done # Read sysctl conf files again sysctl -p /etc/sysctl.d/90-dhcp6-systcl.conf -systemctl restart networking +# systemctl restart networking + +systemctl start networking +sleep 10 +systemctl stop networking # Clean-up created files rm -f /tmp/ztp_input.json /tmp/ztp_port_data.json with this change the issue reproduces on every config reload. Signed-off-by: Volodymyr Boyko <[email protected]>
1 parent c1d2e88 commit c243af0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

files/build_templates/per_namespace/bgp.service.j2

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ After=updategraph.service
77
BindsTo=sonic.target
88
After=sonic.target
99
Before=ntp-config.service
10+
After=interfaces-config.service
1011
StartLimitIntervalSec=1200
1112
StartLimitBurst=3
1213

0 commit comments

Comments
 (0)