Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion files/build_templates/init_cfg.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
("database", "enabled", false, "disabled"),
("dhcp_relay", "enabled", false, "enabled"),
("lldp", "enabled", false, "enabled"),
("pmon", "enabled", false, "enabled"),
("pmon", "enabled", true, "enabled"),
("radv", "enabled", false, "enabled"),
("snmp", "enabled", true, "enabled"),
("swss", "enabled", false, "enabled"),
Expand Down
3 changes: 1 addition & 2 deletions files/build_templates/pmon.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ After=updategraph.service
{% if sonic_asic_platform == 'mellanox' %}
After=syncd.service
{% endif %}
Conflicts=pmon.timer
Before=ntp-config.service
StartLimitIntervalSec=1200
StartLimitBurst=3
Expand All @@ -17,5 +18,3 @@ ExecStop=/usr/bin/{{docker_container_name}}.sh stop
Restart=always
RestartSec=30

[Install]
WantedBy=multi-user.target
11 changes: 11 additions & 0 deletions files/build_templates/pmon.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Delays platform monitoring container until SONiC has started
Conflicts=pmon.service

[Timer]
OnUnitActiveSec=0 sec
OnBootSec=3min 30 sec
Unit=pmon.service

[Install]
WantedBy=timers.target
3 changes: 3 additions & 0 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,9 @@ sudo cp $BUILD_TEMPLATES/mgmt-framework.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_S
echo "mgmt-framework.timer" | sudo tee -a $GENERATED_SERVICE_FILE
{% endif %}

sudo cp $BUILD_TEMPLATES/pmon.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM
echo "pmon.timer" | sudo tee -a $GENERATED_SERVICE_FILE

sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get purge -y python-dev
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get clean -y
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get autoremove -y
Expand Down
10 changes: 5 additions & 5 deletions files/scripts/syncd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ start() {

wait() {
if [[ x"$sonic_asic_platform" == x"mellanox" ]]; then
debug "Starting pmon service..."
/bin/systemctl start pmon
debug "Started pmon service"
debug "Starting pmon timer unit..."
/bin/systemctl start pmon.timer
debug "Started pmon timer unit"
fi
/usr/bin/${SERVICE}.sh wait $DEV
}
Expand Down Expand Up @@ -159,7 +159,7 @@ stop() {
debug "${TYPE} shutdown syncd process ..."
/usr/bin/docker exec -i syncd$DEV /usr/bin/syncd_request_shutdown --${TYPE}

# wait until syncd quits gracefully or force syncd to exit after
# wait until syncd quits gracefully or force syncd to exit after
# waiting for 20 seconds
start_in_secs=${SECONDS}
end_in_secs=${SECONDS}
Expand All @@ -171,7 +171,7 @@ stop() {
done

if [[ $((end_in_secs - start_in_secs)) -gt $timer_threshold ]]; then
debug "syncd process in container syncd$DEV did not exit gracefully"
debug "syncd process in container syncd$DEV did not exit gracefully"
fi

/usr/bin/docker exec -i syncd$DEV /bin/sync
Expand Down