sonic-buildimage/files/build_templates/swss.service.j2
Marian Pritsak 884bd2d467 [mellanox]: Add support for Mellanox MSN2410 (#491)
* [device]: Add support for Mellanox MSN2410
MSN2410 runs on Spectrum silicon and has 56 ports:
48 25GbE and 8 100GbE
* Avoid full path within bash -c

Signed-off-by: marian-pritsak <marianp@mellanox.com>
2017-04-10 14:36:36 -07:00

47 lines
1.6 KiB
Django/Jinja

[Unit]
Description=switch state service
Requires=database.service
{% if sonic_asic_platform == 'broadcom' %}
Requires=opennsl-modules-3.16.0-4-amd64.service
{% endif %}
After=database.service
{% if sonic_asic_platform == 'broadcom' %}
After=opennsl-modules-3.16.0-4-amd64.service
{% endif %}
[Service]
User=root
# Wait for redis server start before database clean
ExecStartPre=/bin/bash -c "while true; do if [ \"$(/usr/bin/docker exec database redis-cli ping)\" == \"PONG\" ]; then break; fi; sleep 1; done"
ExecStartPre=/usr/bin/docker exec database redis-cli -n 0 FLUSHDB
ExecStartPre=/usr/bin/docker exec database redis-cli -n 1 FLUSHDB
ExecStartPre=/usr/bin/docker exec database redis-cli -n 2 FLUSHDB
{% if sonic_asic_platform == 'mellanox' %}
ExecStartPre=/etc/init.d/sxdkernel start
ExecStartPre=/usr/bin/mst start
ExecStartPre=/sbin/modprobe i2c-dev
ExecStartPre=/bin/bash -c "/usr/share/sonic/device/$(sonic-cfggen -v platform)/hw-management start"
{% elif sonic_asic_platform == 'cavium' %}
ExecStartPre=/etc/init.d/xpnet.sh start
{% endif %}
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
ExecStartPre=/usr/bin/syncd.sh start
ExecStart=/usr/bin/{{docker_container_name}}.sh attach
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
ExecStopPost=/usr/bin/syncd.sh stop
{% if sonic_asic_platform == 'mellanox' %}
ExecStopPost=/bin/bash -c "/usr/share/sonic/device/$(sonic-cfggen -v platform)/hw-management stop"
ExecStopPost=/etc/init.d/sxdkernel stop
ExecStopPost=/usr/bin/mst stop
{% elif sonic_asic_platform == 'cavium' %}
ExecStopPost=/etc/init.d/xpnet.sh stop
ExecStopPost=/etc/init.d/xpnet.sh start
{% endif %}
[Install]
WantedBy=multi-user.target