Enable sairedis counter thread in 3 minutes after SONiC was started (#1805)
This commit is contained in:
parent
7389443597
commit
07ea9741fb
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=/usr/bin/counterpoll queue 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
|
@ -276,6 +276,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 4ef45eed56a4ec34c225d2a37cc02efc2131033b
|
||||
Subproject commit 5fee797a1d2ae4d4ba7d7c7ea8cc79578f5c19f5
|
@ -1 +1 @@
|
||||
Subproject commit 4df9c289a6c2d41e4dee09f3055f0ac6d8e98ded
|
||||
Subproject commit 98ad0bd500fc23fb61197e0ff8390d332216c9e8
|
@ -1 +1 @@
|
||||
Subproject commit b4367a440fb7b188c60774808195164438061bba
|
||||
Subproject commit 8c5dab6b341752b4bda3f63917a9c143df778322
|
Reference in New Issue
Block a user