[router advertiser] Only start radvd process if device role is 'ToRRouter' (#1569)
This commit is contained in:
parent
ac2861e6d7
commit
30466b27c1
@ -8,6 +8,7 @@ command=/usr/bin/start.sh
|
|||||||
priority=1
|
priority=1
|
||||||
autostart=true
|
autostart=true
|
||||||
autorestart=false
|
autorestart=false
|
||||||
|
startsecs=0
|
||||||
stdout_logfile=syslog
|
stdout_logfile=syslog
|
||||||
stderr_logfile=syslog
|
stderr_logfile=syslog
|
||||||
|
|
||||||
|
@ -1,11 +1,18 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Generate /etc/radvd.conf config file
|
|
||||||
sonic-cfggen -d -t /usr/share/sonic/templates/radvd.conf.j2 > /etc/radvd.conf
|
|
||||||
|
|
||||||
rm -f /var/run/rsyslogd.pid
|
rm -f /var/run/rsyslogd.pid
|
||||||
|
|
||||||
supervisorctl start rsyslogd
|
supervisorctl start rsyslogd
|
||||||
|
|
||||||
|
# Router advertiser should only run on ToR (T0) devices
|
||||||
|
DEVICE_ROLE=$(sonic-cfggen -d -v "DEVICE_METADATA.localhost.type")
|
||||||
|
if [ "$DEVICE_ROLE" != "ToRRouter" ]; then
|
||||||
|
echo "Device role is not ToRRouter. Not starting router advertiser process."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Generate /etc/radvd.conf config file
|
||||||
|
sonic-cfggen -d -t /usr/share/sonic/templates/radvd.conf.j2 > /etc/radvd.conf
|
||||||
|
|
||||||
# Start the router advertiser
|
# Start the router advertiser
|
||||||
supervisorctl start radvd
|
supervisorctl start radvd
|
||||||
|
Loading…
Reference in New Issue
Block a user