Skip to content

Commit

Permalink
Delay pmon non-critical daemon (#18907)
Browse files Browse the repository at this point in the history
- Why I did it
After this pull request #19190 , the pmon has been added to the start list in fast/warm reboot scenarios. However, certain non-critical daemons of pmon could be delayed, resulting in a saving of approximately 1 second in the reboot process. For performance considerations, especially as the current time usage of fast reboot is closer to 30 seconds limitation, this change could ease the pressure.

- How I did it
add a script as fast/warm reboot monitor and relative supervisord rlues.
once the script exited means the reboot process has ended, other delayed daemon would then initialize.

- How to verify it
check the fast/warm reboot time usage

Signed-off-by: Yuanzhe, Liu <[email protected]>
  • Loading branch information
yuazhe authored Nov 20, 2024
1 parent 71fd069 commit 99eaa84
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"skip_ledd": true,
"skip_fancontrol": true,
"delay_xcvrd": true,
"skip_xcvrd_cmis_mgr": true
"skip_xcvrd_cmis_mgr": true,
"delay_non_critical_daemon": true
}

7 changes: 7 additions & 0 deletions dockers/docker-platform-monitor/delay.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3

# This file serves as a monitor for advanced reboot.
# Once it exits, the delayed daemon will initiate.

from swsscommon.swsscommon import RestartWaiter
RestartWaiter.waitAdvancedBootDone()
22 changes: 16 additions & 6 deletions dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true


{% if delay_non_critical_daemon %}
[program:delay]
command=python3 /usr/bin/delay.py
autostart=false
autorestart=false
startsecs=0
dependent_startup=true
{% endif %}

{% if not skip_chassisd and (IS_MODULAR_CHASSIS == 1 or is_smartswitch) %}
[program:chassisd]
command=/usr/local/bin/chassisd
Expand Down Expand Up @@ -64,7 +74,7 @@ stdout_logfile=syslog
stderr_logfile=syslog
startsecs=0
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running
dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}delay:exited{% endif %}
{% endif %}

{% if not skip_fancontrol and HAVE_FANCONTROL_CONF == 1 %}
Expand Down Expand Up @@ -151,7 +161,7 @@ stdout_logfile=syslog
stderr_logfile=syslog
startsecs=10
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running
dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}delay:exited{% endif %}
{% endif %}

{% if not skip_syseepromd %}
Expand All @@ -164,7 +174,7 @@ stdout_logfile=syslog
stderr_logfile=syslog
startsecs=10
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running
dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}delay:exited{% endif %}
{% endif %}

{% if not skip_thermalctld %}
Expand All @@ -178,7 +188,7 @@ stderr_logfile=syslog
startsecs=10
startretries=50
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running
dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}delay:exited{% endif %}
{% endif %}

{% if not skip_pcied %}
Expand All @@ -191,7 +201,7 @@ stdout_logfile=syslog
stderr_logfile=syslog
startsecs=10
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running
dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}delay:exited{% endif %}
{% endif %}

{% if include_sensormond %}
Expand All @@ -204,7 +214,7 @@ stdout_logfile=syslog
stderr_logfile=syslog
startsecs=10
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running
dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}delay:exited{% endif %}
{% endif %}

{% if not skip_stormond %}
Expand Down

0 comments on commit 99eaa84

Please sign in to comment.