sonic-buildimage/files/build_templates/sflow.service.j2
Garrick He fc0e6af337
[sflow] Fix race-condition seen with mVRF configured (#6102)
Under certain conditions, the sFlow service can start before
interface configurations are sucessfully applied. This will
cause hsflowd to get a socket error.

This fix ensures all interface configurations are successfully
applied before the sFlow service (hsflowd) starts.

During testing we saw this error from hsflowd if interface configs were not successfully applied before hsflowd started.

    ERR sflow#hsflowd: socket sendto error: Network is unreachable

no FLOW samples can be seen. This can be consistently reproducible if you force sFlow service to start before interface-config.service.

Signed-off-by: Garrick He <garrick_he@dell.com>
2020-12-03 01:33:10 -08:00

19 lines
446 B
Django/Jinja

[Unit]
Description=sFlow container
Requisite=swss.service
After=swss.service syncd.service hostcfgd.service
Before=ntp-config.service
StartLimitIntervalSec=1200
StartLimitBurst=3
[Service]
User={{ sonicadmin_user }}
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
ExecStart=/usr/bin/{{docker_container_name}}.sh wait
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target