[services][mgmt-framework] delay mgmt-framework service on boot (#5226)
management framework provides management plane services like rest and CLI which is not needed right after boot, instead by delaying this service we give some more CPU for data plane and control plane services on fast/warm boot. Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
This commit is contained in:
parent
7d3ec60b1f
commit
b31050d60e
@ -29,7 +29,7 @@
|
|||||||
("syncd", "enabled", false, "enabled"),
|
("syncd", "enabled", false, "enabled"),
|
||||||
("teamd", "enabled", false, "enabled")] %}
|
("teamd", "enabled", false, "enabled")] %}
|
||||||
{%- if include_iccpd == "y" %}{% do features.append(("iccpd", "disabled", false, "enabled")) %}{% endif %}
|
{%- if include_iccpd == "y" %}{% do features.append(("iccpd", "disabled", false, "enabled")) %}{% endif %}
|
||||||
{%- if include_mgmt_framework == "y" %}{% do features.append(("mgmt-framework", "enabled", false, "enabled")) %}{% endif %}
|
{%- if include_mgmt_framework == "y" %}{% do features.append(("mgmt-framework", "enabled", true, "enabled")) %}{% endif %}
|
||||||
{%- if include_nat == "y" %}{% do features.append(("nat", "disabled", false, "enabled")) %}{% endif %}
|
{%- if include_nat == "y" %}{% do features.append(("nat", "disabled", false, "enabled")) %}{% endif %}
|
||||||
{%- if include_restapi == "y" %}{% do features.append(("restapi", "enabled", false, "enabled")) %}{% endif %}
|
{%- if include_restapi == "y" %}{% do features.append(("restapi", "enabled", false, "enabled")) %}{% endif %}
|
||||||
{%- if include_sflow == "y" %}{% do features.append(("sflow", "disabled", false, "enabled")) %}{% endif %}
|
{%- if include_sflow == "y" %}{% do features.append(("sflow", "disabled", false, "enabled")) %}{% endif %}
|
||||||
|
@ -10,5 +10,3 @@ ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
|
|||||||
ExecStart=/usr/bin/{{docker_container_name}}.sh wait
|
ExecStart=/usr/bin/{{docker_container_name}}.sh wait
|
||||||
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
|
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
|
9
files/build_templates/mgmt-framework.timer
Normal file
9
files/build_templates/mgmt-framework.timer
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Delays management framework container until SONiC has started
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnBootSec=3min 30 sec
|
||||||
|
Unit=mgmt-framework.service
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
@ -78,7 +78,7 @@ sudo mkdir -p $FILESYSTEM_ROOT/etc/sonic/
|
|||||||
sudo mkdir -p $FILESYSTEM_ROOT/etc/modprobe.d/
|
sudo mkdir -p $FILESYSTEM_ROOT/etc/modprobe.d/
|
||||||
sudo mkdir -p $FILESYSTEM_ROOT/var/cache/sonic/
|
sudo mkdir -p $FILESYSTEM_ROOT/var/cache/sonic/
|
||||||
sudo mkdir -p $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/
|
sudo mkdir -p $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/
|
||||||
# This is needed for Stretch and might not be needed for Buster where Linux create this directory by default.
|
# This is needed for Stretch and might not be needed for Buster where Linux create this directory by default.
|
||||||
# Keeping it generic. It should not harm anyways.
|
# Keeping it generic. It should not harm anyways.
|
||||||
sudo mkdir -p $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM
|
sudo mkdir -p $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM
|
||||||
|
|
||||||
@ -542,11 +542,17 @@ sudo LANG=C cp $SCRIPTS_DIR/sonic-netns-exec $FILESYSTEM_ROOT/usr/bin/sonic-netn
|
|||||||
# It implements delayed start of services
|
# It implements delayed start of services
|
||||||
sudo cp $BUILD_TEMPLATES/snmp.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM
|
sudo cp $BUILD_TEMPLATES/snmp.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM
|
||||||
echo "snmp.timer" | sudo tee -a $GENERATED_SERVICE_FILE
|
echo "snmp.timer" | sudo tee -a $GENERATED_SERVICE_FILE
|
||||||
|
|
||||||
{% if include_system_telemetry == 'y' %}
|
{% if include_system_telemetry == 'y' %}
|
||||||
sudo cp $BUILD_TEMPLATES/telemetry.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM
|
sudo cp $BUILD_TEMPLATES/telemetry.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM
|
||||||
echo "telemetry.timer" | sudo tee -a $GENERATED_SERVICE_FILE
|
echo "telemetry.timer" | sudo tee -a $GENERATED_SERVICE_FILE
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if include_mgmt_framework == 'y' %}
|
||||||
|
sudo cp $BUILD_TEMPLATES/mgmt-framework.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM
|
||||||
|
echo "mgmt-framework.timer" | sudo tee -a $GENERATED_SERVICE_FILE
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
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 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 clean -y
|
||||||
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get autoremove -y
|
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get autoremove -y
|
||||||
|
Loading…
Reference in New Issue
Block a user