Open CharlieChenEC opened 1 year ago
@SuvarnaMeenakshi , can you help on this issue?
The issue had been fixed on the latest image built from master branch on 2024/4/22. Close this issue.
Here are the test logs.
admin@sonic:~$ show version
SONiC Software Version: SONiC.master.528795-f60ef62c7
SONiC OS Version: 12
Distribution: Debian 12.5
Kernel: 6.1.0-11-2-amd64
Build commit: f60ef62c7
Build date: Mon Apr 22 13:04:15 UTC 2024
Built by: AzDevOps@vmss-soni003IIT
Platform: x86_64-accton_as7816_64x-r0
HwSKU: Accton-AS7816-64X
ASIC: broadcom
ASIC Count: 1
Serial Number: 781654X1911006
Model Number: FP3ZZ7664022A
Hardware Revision: N/A
...
bgp enabled
database always_enabled
dhcp_relay enabled
eventd enabled
gnmi enabled
lldp enabled
macsec enabled
mgmt-framework enabled
mux enabled
nat enabled
pmon enabled
radv enabled
sflow enabled
snmp enabled
swss enabled
syncd enabled
teamd enabled
root@sonic:~# config feature autorestart snmp disabled
root@sonic:~# show feature autorestart
Feature AutoRestart
-------------- --------------
bgp enabled
database always_enabled
dhcp_relay enabled
eventd enabled
gnmi enabled
lldp enabled
macsec enabled
mgmt-framework enabled
mux enabled
nat enabled
pmon enabled
radv enabled
sflow enabled
snmp disabled
swss enabled
syncd enabled
teamd enabled
root@sonic:~# grep snmp /var/log/syslog
...
Jan 26 21:55:00.452858 sonic INFO featured: Auto-restart status of feature 'snmp' is changed from 'enabled' to 'disabled' ...
Jan 26 21:55:00.453096 sonic INFO featured: Updating feature 'snmp' systemd config file related to auto-restart ...
Jan 26 21:55:00.453263 sonic INFO featured: Feature 'snmp' systemd config file related to auto-restart is updated!
root@sonic:~# docker stop snmp
snmp
root@sonic:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f51ae1b81964 docker-platform-monitor:latest "/usr/bin/docker_ini" 7 minutes ago Up 7 minutes pmon
7c484537180d docker-sonic-mgmt-framework:latest "/usr/local/bin/supe" 7 minutes ago Up 7 minutes mgmt-framework
eca0b53376c3 docker-lldp:latest "/usr/bin/docker-lld" 7 minutes ago Up 7 minutes lldp
603a0c9b3011 docker-sonic-gnmi:latest "/usr/local/bin/supe" 7 minutes ago Up 7 minutes gnmi
753c26504757 docker-fpm-frr:latest "/usr/bin/docker_ini" 8 minutes ago Up 8 minutes bgp
23e0494d952d docker-router-advertiser:latest "/usr/bin/docker-ini" 8 minutes ago Up 8 minutes radv
4291f710a93f docker-syncd-brcm:latest "/usr/local/bin/supe" 8 minutes ago Up 8 minutes syncd
e5dfdf5e7c16 docker-teamd:latest "/usr/local/bin/supe" 8 minutes ago Up 8 minutes teamd
5e010552894b docker-orchagent:latest "/usr/bin/docker-ini" 8 minutes ago Up 8 minutes swss
f846eff51d9a docker-eventd:latest "/usr/local/bin/supe" 8 minutes ago Up 8 minutes eventd
020d9d01f8f9 docker-database:latest "/usr/local/bin/dock" 8 minutes ago Up 8 minutes database
root@sonic:~# systemctl status snmp
snmp.service - SNMP container
Loaded: loaded (/lib/systemd/system/snmp.service; static)
Drop-In: /etc/systemd/system/snmp.service.d
auto_restart.conf
Active: inactive (dead)
Jan 26 21:50:42 sonic container[9113]: container_wait: END -- transitioning to >
Jan 26 21:57:37 sonic container[9113]: docker cmd: wait for snmp
Jan 26 21:57:37 sonic container[12216]: container_stop: BEGIN
Jan 26 21:57:37 sonic container[12216]: read_data: config:True feature:snmp fie>
Jan 26 21:57:37 sonic container[12216]: read_data: config:False feature:snmp fi>
Jan 26 21:57:37 sonic container[12216]: container_stop: snmp: set_owner:local c>
Jan 26 21:57:37 sonic container[12216]: docker cmd: stop for snmp
Jan 26 21:57:37 sonic container[12216]: container_stop: END
Jan 26 21:57:37 sonic root[12251]: Stopped snmp service...
Jan 26 21:57:37 sonic systemd[1]: snmp.service: Deactivated successfully.
root@sonic:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f51ae1b81964 docker-platform-monitor:latest "/usr/bin/docker_ini…" 21 minutes ago Up 21 minutes pmon
7c484537180d docker-sonic-mgmt-framework:latest "/usr/local/bin/supe…" 21 minutes ago Up 21 minutes mgmt-framework
eca0b53376c3 docker-lldp:latest "/usr/bin/docker-lld…" 21 minutes ago Up 21 minutes lldp
603a0c9b3011 docker-sonic-gnmi:latest "/usr/local/bin/supe…" 21 minutes ago Up 21 minutes gnmi
753c26504757 docker-fpm-frr:latest "/usr/bin/docker_ini…" 22 minutes ago Up 22 minutes bgp
23e0494d952d docker-router-advertiser:latest "/usr/bin/docker-ini…" 22 minutes ago Up 22 minutes radv
4291f710a93f docker-syncd-brcm:latest "/usr/local/bin/supe…" 22 minutes ago Up 22 minutes syncd
e5dfdf5e7c16 docker-teamd:latest "/usr/local/bin/supe…" 22 minutes ago Up 22 minutes teamd
5e010552894b docker-orchagent:latest "/usr/bin/docker-ini…" 22 minutes ago Up 22 minutes swss
f846eff51d9a docker-eventd:latest "/usr/local/bin/supe…" 22 minutes ago Up 22 minutes eventd
020d9d01f8f9 docker-database:latest "/usr/local/bin/dock…" 22 minutes ago Up 22 minutes database
Description
After issuing a command to disable the snmp autorestart through the CLI command "config feature autorestart snmp disabled", and ensures the request has taken effect by looking up syslog. If I execute the docker command to stop snmp container to emulate the abnormal termination of snmp container, the status of snmp.service is expected to change to inactive and keep in that state. However, it restarts automatically.
Steps to reproduce the issue:
Describe the results you received:
At Step 4, the snmp service stops and is restarted immediately.
Describe the results you expected:
At Step 4, the snmp service should not be restarted.
Output of
show version
:Version: master.0-948ce3fe0
Syslog:
Additional information you deem important (e.g. issue happens only occasionally):