sonic-buildimage/files/build_templates
Stepan Blyshchak 4ba0ff25d2 [services] make snmp.timer work again and delay telemetry.service (#3742)
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"
2019-12-16 09:07:05 -08:00
..
bgp.service.j2 [services] Services which start containers now use 'docker wait' instead of 'docker attach' (#2661) 2019-03-08 10:59:41 -08:00
buffers_config.j2 Revert "Configure buffer profile to all ports (#3561)" (#3628) 2019-10-18 09:14:39 -07:00
config-setup.service.j2 [config-setup]: create a SONiC configuration management service (#3227) 2019-12-04 07:15:58 -08:00
database.service.j2 create multiple Redis DB instances based on CONFIG at /etc/sonic/database_config.json (#2182) 2019-08-28 11:15:10 -07:00
dhcp_relay.service.j2 [services] Remove explicit dependencies from dhcp_relay service file, control in swss.sh (#3823) 2019-11-26 16:59:45 -08:00
docker_image_ctl.j2 [fast-reboot]: Save fast-reboot state into the db (#3741) 2019-12-04 14:10:19 -08:00
lldp.service.j2 [Services] Restart LLDP service upon unexpected critical process exit. (#3713) 2019-11-06 11:02:57 -08:00
organization_extensions.sh Framework to plugin Organization specific scripts during ONIE Image build (#951) 2017-09-19 16:23:31 -07:00
pmon.service.j2 [Services] Restart Platform-monitor service upon unexpected critical process exit. (#3689) 2019-11-04 17:44:01 -08:00
qos_config.j2 Adopt per-port buffer and qos profile (#3542) 2019-10-02 13:01:16 -07:00
radv.service.j2 [services] improve startup time by changing startup order (#3656) 2019-10-31 09:18:26 -07:00
sflow.service.j2 [services] sflow service sets swss service as Requisite=, not Requires= (#3819) 2019-12-03 09:50:49 -08:00
snmp.service.j2 [services] make snmp.timer work again and delay telemetry.service (#3742) 2019-12-16 09:07:05 -08:00
snmp.timer [services] make snmp.timer work again and delay telemetry.service (#3742) 2019-12-16 09:07:05 -08:00
sonic_debian_extension.j2 [services] make snmp.timer work again and delay telemetry.service (#3742) 2019-12-16 09:07:05 -08:00
swss.service.j2 [submodule] update sonic-linux-kernel (#2985) 2019-06-18 10:00:16 -07:00
syncd.service.j2 [submodule] update sonic-linux-kernel (#2985) 2019-06-18 10:00:16 -07:00
teamd.service.j2 [Services] Restart Teamd service upon unexpected critical process exit. (#3703) 2019-11-04 17:45:41 -08:00
telemetry.service.j2 [services] make snmp.timer work again and delay telemetry.service (#3742) 2019-12-16 09:07:05 -08:00
telemetry.timer [services] make snmp.timer work again and delay telemetry.service (#3742) 2019-12-16 09:07:05 -08:00
updategraph.service.j2 [config-setup]: create a SONiC configuration management service (#3227) 2019-12-04 07:15:58 -08:00