4ba0ff25d2
Delay CPU intensive services at boot - How I did it Made snmp.timer work and add telemetry.timer. But this is not enough because it breaks the existing snmp dependency on swss. So, in this solution snmp timer is a wanted by swss service, but since OnBootSec timer expires only once it will not trigger snmp service, so I added line "OnUnitActiveSec=0 sec" which will start snmp service based on the last time it was active. On boot only OnBootSec will expire, on swss start/restarts only second timer will expire immediately and trigger snmp service. However, snmp service will not stop after "systemctl stop snmp" because of the second timer which will always expire when snmp service because unavailable. So there is a conflict which will be handled by systemd if we add "Conflicts=" line to both snmp.service and snmp.timer. So during boot: snmp does not start by default swss starts and starts snmp timer OnUnitActiveSec=0 does not expire since there is no snmp active OnBootSec expires and starts snmp service and snmp timer gets stopped During "systemctl restart swss" snmp stops because of Requisite on swss snmp unblocks snmp timer from running swss starts and starts snmp timer OnUnitActiveSec=0 expires imidiately and start snmp which stops snmp timer During "systemctl stop snmp" stop of snmp service unblocks snmp timer but no one starts the timer so it is not started by "OnUnitActiveSec=0" |
||
---|---|---|
.. | ||
bgp.service.j2 | ||
buffers_config.j2 | ||
config-setup.service.j2 | ||
database.service.j2 | ||
dhcp_relay.service.j2 | ||
docker_image_ctl.j2 | ||
lldp.service.j2 | ||
organization_extensions.sh | ||
pmon.service.j2 | ||
qos_config.j2 | ||
radv.service.j2 | ||
sflow.service.j2 | ||
snmp.service.j2 | ||
snmp.timer | ||
sonic_debian_extension.j2 | ||
swss.service.j2 | ||
syncd.service.j2 | ||
teamd.service.j2 | ||
telemetry.service.j2 | ||
telemetry.timer | ||
updategraph.service.j2 |