This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
sonic-buildimage/files
Stepan Blyshchak b834c9ff34 [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"
2020-01-06 10:32:24 -08:00
..
Aboot [aboot]: preserve snmp.yml and acl.json for eos to sonic fast reboot (#3716) 2019-11-06 20:18:31 -08:00
apt [build]: SONiC buildimage ARM arch support (#2980) 2019-07-25 22:06:41 -07:00
build_scripts [build_debian] Include checksum of ASIC config files in SONiC filesystem (#3384) 2019-09-05 19:41:35 -07:00
build_templates [services] make snmp.timer work again and delay telemetry.service (#3742) 2020-01-06 10:32:24 -08:00
dhcp [baseimage]: Initial changes for dhcp to support eth0 in a mgmt vrf (#2348) 2019-01-15 18:15:56 -08:00
docker [docker-engine]: upgrade docker engine to 18.09 (#2417) 2019-01-04 20:47:43 -08:00
image_config [caclmgrd] Fix application of IPv6 service ACL rules (#3917) 2019-12-31 14:42:49 -08:00
initramfs-tools [build]: enable docker in ram option for small disk device (#3279) 2019-08-06 23:04:00 -07:00
scripts [fast-reboot]: Save fast-reboot state into the db (#3741) 2020-01-06 10:30:36 -08:00
sshd [security] Do not generate ssh server keys for non RSA protocols (#2718) 2019-03-29 15:27:33 -07:00