072eaed2e3
Add pre start check to ensure intfmgrd is running. The check will run for 20 seconds at most. Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
18 lines
630 B
Django/Jinja
18 lines
630 B
Django/Jinja
[Unit]
|
|
Description=SNMP container
|
|
Requires=updategraph.service
|
|
Requisite=swss.service
|
|
After=updategraph.service swss.service syncd.service interfaces-config.service
|
|
BindsTo=sonic.target
|
|
After=sonic.target
|
|
Before=ntp-config.service
|
|
StartLimitIntervalSec=1200
|
|
StartLimitBurst=3
|
|
|
|
[Service]
|
|
ExecStartPre=/bin/bash -c 'end=$((SECONDS+20));while [ $SECONDS -lt $end ];do if /usr/bin/pgrep intfmgrd >/dev/null;then break;else sleep 1;fi;done'
|
|
ExecStartPre=/usr/local/bin/{{docker_container_name}}.sh start
|
|
ExecStart=/usr/local/bin/{{docker_container_name}}.sh wait
|
|
ExecStop=/usr/local/bin/{{docker_container_name}}.sh stop
|
|
RestartSec=30
|