Enable sairedis counter thread in 3 minutes after SONiC was started (#1813)
* Enable sairedis counter thread in 3 minutes after SONiC was started * Enable all counters
This commit is contained in:
parent
4eb866c615
commit
6568203c15
7
files/build_templates/enable_counters.service
Normal file
7
files/build_templates/enable_counters.service
Normal file
@ -0,0 +1,7 @@
|
||||
[Unit]
|
||||
Description=Enable SONiC counters
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash -c '/usr/bin/counterpoll queue enable ; /usr/bin/counterpoll port enable ; /usr/bin/pfcwd counter_poll enable'
|
||||
RemainAfterExit=yes
|
9
files/build_templates/enable_counters.timer
Normal file
9
files/build_templates/enable_counters.timer
Normal file
@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Delays the SONiC counters gathering until SONiC has started
|
||||
|
||||
[Timer]
|
||||
OnBootSec=3min
|
||||
Unit=enable_counters.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
@ -1,12 +1,9 @@
|
||||
[Unit]
|
||||
Description=SNMP container
|
||||
Requires=updategraph.service swss.service
|
||||
After=updategraph.service swss.service
|
||||
Requires=updategraph.service swss.service enable_counters.service
|
||||
After=updategraph.service swss.service enable_counters.service
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
|
||||
ExecStart=/usr/bin/{{docker_container_name}}.sh attach
|
||||
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
9
files/build_templates/snmp.timer
Normal file
9
files/build_templates/snmp.timer
Normal file
@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Delays snmp container until SONiC has started
|
||||
|
||||
[Timer]
|
||||
OnBootSec=3min 30 sec
|
||||
Unit=snmp.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
@ -272,6 +272,14 @@ sudo LANG=C chroot $FILESYSTEM_ROOT fuser -km /sys || true
|
||||
sudo LANG=C chroot $FILESYSTEM_ROOT umount -lf /sys
|
||||
{% endif %}
|
||||
|
||||
# Copy systemd timer configuration
|
||||
# It implements delayed start of services
|
||||
sudo cp $BUILD_TEMPLATES/enable_counters.timer $FILESYSTEM_ROOT/etc/systemd/system/
|
||||
sudo cp $BUILD_TEMPLATES/enable_counters.service $FILESYSTEM_ROOT/etc/systemd/system/
|
||||
sudo cp $BUILD_TEMPLATES/snmp.timer $FILESYSTEM_ROOT/etc/systemd/system/
|
||||
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable enable_counters.timer
|
||||
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable snmp.timer
|
||||
|
||||
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get remove -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 autoremove -y
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit ce6abfa3acc4ffc376844d46d051a1e5647945e0
|
||||
Subproject commit 17fd36e2e115af90dea491f71689147fc06f7d30
|
@ -1 +1 @@
|
||||
Subproject commit 7a9f49b7be2d2ecfa971c38ec0c5ff5da8187893
|
||||
Subproject commit 06718ad33eae0f14659dbe6401d9f63088dd263f
|
@ -1 +1 @@
|
||||
Subproject commit c641d2b3eec5684182eb56ee71ac3843dbf3b0d0
|
||||
Subproject commit 27bea61072d0a4c8756b4be89b4b349f72918889
|
Reference in New Issue
Block a user