Skip to content

Commit

Permalink
Fix waiting for interfaces to get set up
Browse files Browse the repository at this point in the history
  • Loading branch information
saiarcot895 authored and kellyyeh committed Oct 25, 2021
1 parent f59f7ad commit a3e6a9c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dockers/docker-dhcp-relay/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rm -f /var/run/rsyslogd.pid
# Start rsyslog
supervisorctl start rsyslogd

# If our supervisor config has entries in the "isc-dhcp-relay" group...
# If our supervisor config has entries in the "dhcp-relay" group...
if [ $(supervisorctl status | grep -c "^dhcp-relay:") -gt 0 ]; then
# Wait for all interfaces to come up and be assigned IPv4 addresses before
# starting the DHCP relay agent(s). If an interface the relay should listen
Expand Down
5 changes: 5 additions & 0 deletions dockers/docker-dhcp-relay/wait_for_intf.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ wait_until_iface_ready {{ name }} {{ prefix }}
wait_until_iface_ready {{ name }} {{ prefix }}
{% endif %}
{% endfor %}

# Wait 10 seconds for the rest of interfaces to get added/populated.
# dhcrelay listens on each of the interfaces (in addition to the port
# channels and vlan interfaces)
sleep 10
4 changes: 4 additions & 0 deletions src/sonic-config-engine/tests/sample_output/wait_for_intf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ wait_until_iface_ready PortChannel02 10.0.0.58/31
wait_until_iface_ready PortChannel03 10.0.0.60/31
wait_until_iface_ready PortChannel04 10.0.0.62/31

# Wait 10 seconds for the rest of interfaces to get added/populated.
# dhcrelay listens on each of the interfaces (in addition to the port
# channels and vlan interfaces)
sleep 10

0 comments on commit a3e6a9c

Please sign in to comment.