Skip to content

Commit

Permalink
[snmp] Check intfmgrd running before start (#16588)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
lolyu authored and mssonicbld committed Oct 13, 2023
1 parent 1f36540 commit bbd5440
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions files/build_templates/snmp.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ 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
Expand Down

0 comments on commit bbd5440

Please sign in to comment.