sonic-buildimage/dockers/docker-fpm-frr/start.sh
shikenghua bf08a2caf3 [docker-fpm-frr]: Generate separated staticd.conf for staticd (#3306)
* [docker-fpm-frr]: Generate separated staticd.conf for staticd

Generate staticd.conf by templates/staticd.conf.j2 with config DB data

* [docker-fpm-frr]: Remove default_route block from zebra.conf.j2

default_route block already moved to staticd.conf.j2

* [docker-fpm-frr]: Add test for staticd.conf.j2 template

* Add test for staticd.conf.j2 template

* Correct the sample output of zebra.conf.j2 template

* Fix a typo in test_zebra_frr

* [docker-fpm-frr]: Fix test_j2files test errors

* Fix test errors in test_j2files.py and test_j2files_t2_chassis_fe.py

* Fix typo in test_j2files_t2_chassis_fe.py
2019-08-16 14:29:42 -07:00

46 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
mkdir -p /etc/frr
CONFIG_TYPE=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["docker_routing_config_mode"]'`
if [ -z "$CONFIG_TYPE" ] || [ "$CONFIG_TYPE" == "separated" ]; then
sonic-cfggen -d -y /etc/sonic/deployment_id_asn_map.yml -t /usr/share/sonic/templates/bgpd.conf.j2 > /etc/frr/bgpd.conf
sonic-cfggen -d -t /usr/share/sonic/templates/zebra.conf.j2 > /etc/frr/zebra.conf
sonic-cfggen -d -t /usr/share/sonic/templates/staticd.conf.j2 > /etc/frr/staticd.conf
echo "no service integrated-vtysh-config" > /etc/frr/vtysh.conf
rm -f /etc/frr/frr.conf
elif [ "$CONFIG_TYPE" == "unified" ]; then
sonic-cfggen -d -y /etc/sonic/deployment_id_asn_map.yml -t /usr/share/sonic/templates/frr.conf.j2 >/etc/frr/frr.conf
echo "service integrated-vtysh-config" > /etc/frr/vtysh.conf
rm -f /etc/frr/bgpd.conf /etc/frr/zebra.conf /etc/frr/staticd.conf
fi
sonic-cfggen -d -t /usr/share/sonic/templates/isolate.j2 > /usr/sbin/bgp-isolate
chown root:root /usr/sbin/bgp-isolate
chmod 0755 /usr/sbin/bgp-isolate
sonic-cfggen -d -t /usr/share/sonic/templates/unisolate.j2 > /usr/sbin/bgp-unisolate
chown root:root /usr/sbin/bgp-unisolate
chmod 0755 /usr/sbin/bgp-unisolate
mkdir -p /var/sonic
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status
rm -f /var/run/rsyslogd.pid
supervisorctl start rsyslogd
supervisorctl start bgpcfgd
# Start Quagga processes
supervisorctl start zebra
supervisorctl start staticd
supervisorctl start bgpd
if [ "$CONFIG_TYPE" == "unified" ]; then
supervisorctl start vtysh_b
fi
supervisorctl start fpmsyncd