[swss]: Wait for vlan intf to start ndppd (#10036)
- Use the `wait_for_link.sh` script to delay ndppd start until after the VLAN interface is ready - Avoids issue where ndppd tries to change interface attributes before the interface is ready Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
This commit is contained in:
parent
c9cf4d9ff0
commit
91204879df
@ -68,7 +68,6 @@ RUN apt-get purge -y \
|
||||
|
||||
COPY ["files/arp_update", "/usr/bin"]
|
||||
COPY ["arp_update.conf", "files/arp_update_vars.j2", "/usr/share/sonic/templates/"]
|
||||
COPY ["ndppd.conf", "/usr/share/sonic/templates/"]
|
||||
COPY ["enable_counters.py", "tunnel_packet_handler.py", "/usr/bin/"]
|
||||
COPY ["orchagent.sh", "swssconfig.sh", "buffermgrd.sh", "/usr/bin/"]
|
||||
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
|
||||
|
@ -18,6 +18,7 @@ CFGGEN_PARAMS=" \
|
||||
-t /usr/share/sonic/templates/ndppd.conf.j2,/etc/ndppd.conf \
|
||||
-t /usr/share/sonic/templates/critical_processes.j2,/etc/supervisor/critical_processes \
|
||||
-t /usr/share/sonic/templates/supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf
|
||||
-t /usr/share/sonic/templates/wait_for_link.sh.j2,/usr/bin/wait_for_link.sh \
|
||||
"
|
||||
VLAN=$(sonic-cfggen $CFGGEN_PARAMS)
|
||||
|
||||
|
@ -1,9 +0,0 @@
|
||||
[program:ndppd]
|
||||
command=/usr/sbin/ndppd
|
||||
priority=7
|
||||
autostart=false
|
||||
autorestart=unexpected
|
||||
stdout_logfile=syslog
|
||||
stderr_logfile=syslog
|
||||
dependent_startup=true
|
||||
dependent_startup_wait_for=vlanmgrd:running
|
@ -299,3 +299,28 @@ stderr_logfile=syslog
|
||||
dependent_startup=true
|
||||
dependent_startup_wait_for=swssconfig:exited
|
||||
{%- endif %}
|
||||
|
||||
{% if is_fabric_asic == 0 %}
|
||||
[program:ndppd]
|
||||
command=/usr/sbin/ndppd
|
||||
priority=7
|
||||
autostart=false
|
||||
autorestart=unexpected
|
||||
stdout_logfile=syslog
|
||||
stderr_logfile=syslog
|
||||
dependent_startup=true
|
||||
dependent_startup_wait_for=wait_for_link:exited
|
||||
{%- endif %}
|
||||
|
||||
{% if is_fabric_asic == 0 %}
|
||||
[program:wait_for_link]
|
||||
command=/usr/bin/wait_for_link.sh
|
||||
priority=7
|
||||
autostart=false
|
||||
autorestart=false
|
||||
startsecs=0
|
||||
stdout_logfile=syslog
|
||||
stderr_logfile=syslog
|
||||
dependent_startup=true
|
||||
dependent_startup_wait_for=swssconfig:exited
|
||||
{%- endif %}
|
||||
|
30
dockers/docker-orchagent/wait_for_link.sh.j2
Normal file
30
dockers/docker-orchagent/wait_for_link.sh.j2
Normal file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
VLAN_TABLE_PREFIX="VLAN_TABLE"
|
||||
|
||||
function wait_until_iface_ready
|
||||
{
|
||||
TABLE_PREFIX=$1
|
||||
IFACE=$2
|
||||
|
||||
echo "Waiting until interface $IFACE is ready..."
|
||||
|
||||
# Wait for the interface to come up
|
||||
# (i.e., interface is present in STATE_DB and state is "ok")
|
||||
while true; do
|
||||
RESULT=$(sonic-db-cli STATE_DB HGET "${TABLE_PREFIX}|${IFACE}" "state" 2> /dev/null)
|
||||
if [ x"$RESULT" == x"ok" ]; then
|
||||
break
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "Interface ${IFACE} is ready!"
|
||||
}
|
||||
|
||||
|
||||
# Wait for all interfaces to be up and ready
|
||||
{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %}
|
||||
wait_until_iface_ready ${VLAN_TABLE_PREFIX} {{ name }}
|
||||
{% endfor %}
|
Loading…
Reference in New Issue
Block a user