[hostcfgd] Delay hostcfgd and aaastatsd for faster boot time (#7965)

#### Why I did it
hostcfgd is starting at the same time as 'create_switch' method is called on orchagent process.
This introduce a degradation on the function execution time which eventually cause the fast-boot flow and a boot scenarion in general to run slower (~6 seconds).
This change will delay the start time of this daemon.
The aaastatsd will delay as well since it has a dependency on hostcfgd, so it is required to delay both.
90 seconds determined as the maximum allowed downtime for control plane to come back up on fast-boot flow.

#### How I did it
Add two timers for hostcfgd and aaastatsd  services in order to delay the startup of these services.

#### How to verify it
Install an image with this change and observe the daemons start 90 seconds after the system boot.
This commit is contained in:
shlomibitton 2021-08-10 14:22:58 +03:00 committed by Judy Joseph
parent 418ee0cd38
commit cbb825cb4b
4 changed files with 22 additions and 6 deletions

View File

@ -12,6 +12,3 @@ Restart=on-failure
RestartSec=10 RestartSec=10
TimeoutStopSec=3 TimeoutStopSec=3
[Install]
WantedBy=sonic.target

View File

@ -0,0 +1,11 @@
[Unit]
Description=Delays aaastatsd daemon until SONiC has started
PartOf=aaastatsd.service
[Timer]
OnActiveSec=1min 30 sec
Unit=aaastatsd.service
[Install]
WantedBy=timers.target sonic.target

View File

@ -9,6 +9,3 @@ After=sonic.target
Type=simple Type=simple
ExecStart=/usr/local/bin/hostcfgd ExecStart=/usr/local/bin/hostcfgd
[Install]
WantedBy=sonic.target

View File

@ -0,0 +1,11 @@
[Unit]
Description=Delays hostcfgd daemon until SONiC has started
PartOf=hostcfgd.service
[Timer]
OnActiveSec=1min 30 sec
Unit=hostcfgd.service
[Install]
WantedBy=timers.target sonic.target