Wait for VLAN interface to come up before starting DHCP relay (#399)
This commit is contained in:
parent
096690e626
commit
d6bfa505b3
@ -15,8 +15,9 @@ RUN rm -rf /debs
|
||||
|
||||
COPY ["isc-dhcp-relay.j2", "/usr/share/sonic/templates/"]
|
||||
COPY ["config.sh", "/usr/bin/"]
|
||||
COPY ["start.sh", "/usr/bin/"]
|
||||
|
||||
ENTRYPOINT /usr/bin/config.sh \
|
||||
&& service rsyslog start \
|
||||
&& service isc-dhcp-relay start \
|
||||
ENTRYPOINT /usr/bin/config.sh \
|
||||
&& service rsyslog start \
|
||||
&& /usr/bin/start.sh \
|
||||
&& /bin/bash
|
||||
|
12
dockers/docker-dhcp-relay/start.sh
Executable file
12
dockers/docker-dhcp-relay/start.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
VLAN_IFACE_NAME=`sonic-cfggen -m /etc/sonic/minigraph.xml -v "minigraph_vlan_interfaces[0]['name']"`
|
||||
|
||||
# Wait for the VLAN to come up (i.e., 'ip link show' returns 0)
|
||||
until ip link show $VLAN_IFACE_NAME > /dev/null 2>&1; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# Start the DHCP relay
|
||||
service isc-dhcp-relay start
|
||||
|
@ -1,7 +1,7 @@
|
||||
[Unit]
|
||||
Description=DHCP relay container
|
||||
Requires=docker.service
|
||||
After=docker.service
|
||||
After=interfaces-config.service
|
||||
|
||||
[Service]
|
||||
User={{ sonicadmin_user }}
|
||||
|
Loading…
Reference in New Issue
Block a user