Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docker-radv] Fix startup issues #5230

Merged
merged 1 commit into from
Aug 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dockers/docker-router-advertiser/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN apt-get clean -y && \
rm -rf /debs

COPY ["docker-init.sh", "/usr/bin/"]
COPY ["radvd.conf.j2", "wait_for_intf.sh.j2", "docker-router-advertiser.supervisord.conf.j2", "/usr/share/sonic/templates/"]
COPY ["radvd.conf.j2", "wait_for_link.sh.j2", "docker-router-advertiser.supervisord.conf.j2", "/usr/share/sonic/templates/"]
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["critical_processes", "/etc/supervisor"]

Expand Down
4 changes: 2 additions & 2 deletions dockers/docker-router-advertiser/docker-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ CFGGEN_PARAMS=" \
-d \
-t /usr/share/sonic/templates/docker-router-advertiser.supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf \
-t /usr/share/sonic/templates/radvd.conf.j2,/etc/radvd.conf \
-t /usr/share/sonic/templates/wait_for_intf.sh.j2,/usr/bin/wait_for_intf.sh \
-t /usr/share/sonic/templates/wait_for_link.sh.j2,/usr/bin/wait_for_link.sh \
"
sonic-cfggen $CFGGEN_PARAMS

chmod +x /usr/bin/wait_for_intf.sh
chmod +x /usr/bin/wait_for_link.sh

exec /usr/bin/supervisord
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,21 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true

{# Router advertiser should only run on ToR (T0) devices #}
{% if DEVICE_METADATA.localhost.type == "ToRRouter" %}

{% if VLAN_INTERFACE %}
{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %}
{# Router advertiser should only run on ToR (T0) devices which have #}
{# at least one VLAN interface which has an IPv6 address asigned #}
{%- set vlan_v6 = namespace(count=0) -%}
{%- if DEVICE_METADATA.localhost.type == "ToRRouter" -%}
{%- if VLAN_INTERFACE -%}
{%- for (name, prefix) in VLAN_INTERFACE|pfx_filter -%}
{# If this VLAN has an IPv6 address... #}
{% if prefix | ipv6 %}
{% set ipv6_found = true %}
{% endif %}
{% endfor %}
{% endif %}
{%- if prefix | ipv6 -%}
{%- set vlan_v6.count = vlan_v6.count + 1 -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endif -%}

{# Enusre at least one ipv6 vlan interface #}
{% if ipv6_found == true %}
{%- if vlan_v6.count > 0 %}
[program:wait_for_link]
command=/usr/bin/wait_for_link.sh
priority=3
Expand All @@ -60,6 +61,4 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=wait_for_link:exited
{% endif %}

{% endif %}
{% endif -%}