To reproduce
set service snmp community public client 127.0.0.1 commit delete service snmp commit [ service snmp ] Job for snmpd.service failed because the control process exited with error code. See "systemctl status snmpd.service" and "journalctl -xeu snmpd.service" for details.
Journalctl
vyos@r4# journalctl -xeu snmpd.service
░░ The job identifier is 2624 and the job result is done.
Nov 04 13:27:41 r4 systemd[1]: Starting snmpd.service - Simple Network Management Protocol (SNMP) Daemon....
░░ Subject: A start job for unit snmpd.service has begun execution
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit snmpd.service has begun execution.
░░
░░ The job identifier is 2688.
Nov 04 13:27:41 r4 snmpd[4088]: /etc/snmp/snmpd.conf: line 16: Error: Blank line following iquerySecName token.
Nov 04 13:27:41 r4 snmpd[4088]: /usr/share/snmp/snmpd.conf: line 3: Error: Blank line following rwuser token.
Nov 04 13:27:41 r4 snmpd[4088]: net-snmp: 2 error(s) in config file(s)
Nov 04 13:27:41 r4 snmpd[4088]: /etc/snmp/snmpd.conf: line 16: Error: Blank line following iquerySecName token.
Nov 04 13:27:41 r4 snmpd[4088]: iquerySecName has not been configured - internal queries will fail
Nov 04 13:27:41 r4 snmpd[4088]: /etc/snmp/snmpd.conf: line 22: Error: You must specify a default user name using the agentSecName token
Nov 04 13:27:41 r4 snmpd[4088]: /etc/snmp/snmpd.conf: line 23: Error: You must specify a default user name using the agentSecName token
Nov 04 13:27:41 r4 snmpd[4088]: /usr/share/snmp/snmpd.conf: line 3: Error: Blank line following rwuser token.
Nov 04 13:27:41 r4 snmpd[4088]: net-snmp: 4 error(s) in config file(s)
Nov 04 13:27:41 r4 snmpd[4088]: Warning: no access control information configured.
(Config search path: /etc/snmp:/usr/share/snmp:/usr/lib/x86_64-linux-gnu/snmp)
It's unlikely this agent can serve any useful purpose in this state.
Run "snmpconf -g basic_setup" to help you configure the snmpd.conf file for this agent.
Nov 04 13:27:41 r4 snmpd[4088]: Error opening specified endpoint "6:161"
Nov 04 13:27:41 r4 snmpd[4088]: Server Exiting with code 1
Nov 04 13:27:41 r4 systemd[1]: snmpd.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ An ExecStart= process belonging to unit snmpd.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Nov 04 13:27:41 r4 systemd[1]: snmpd.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit snmpd.service has entered the 'failed' state with result 'exit-code'.
Nov 04 13:27:41 r4 systemd[1]: Failed to start snmpd.service - Simple Network Management Protocol (SNMP) Daemon..
░░ Subject: A start job for unit snmpd.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit snmpd.service has finished with a failure.
░░
░░ The job identifier is 2688 and the job result is failed.
[edit]
vyos@r4#It is trying to restart the service instead of delete and generates part of config that already not in the dictionary.
For example, after deleting line 16 is empty
vyos@r4# cat -n /etc/snmp/snmpd.conf
1 ### Autogenerated by snmp.py ###
2
3 # non configurable defaults
4 sysObjectID 1.3.6.1.4.1.44641
5 sysServices 14
6 master agentx
7 agentXPerms 0777 0777
8 pass .1.3.6.1.2.1.31.1.1.1.18 /opt/vyatta/sbin/if-mib-alias
9 smuxpeer .1.3.6.1.2.1.83
10 smuxpeer .1.3.6.1.2.1.157
11 smuxsocket localhost
12
13 # linkUp/Down configure the Event MIB tables to monitor
14 # the ifTable for network interfaces being taken up or down
15 # for making internal queries to retrieve any necessary information
16 iquerySecName
17
18 # Modified from the default linkUpDownNotification
19 # to include more OIDs and poll more frequently
20 notificationEvent linkUpTrap linkUp ifIndex ifDescr ifType ifAdminStatus ifOperStatus
21 notificationEvent linkDownTrap linkDown ifIndex ifDescr ifType ifAdminStatus ifOperStatus
22 monitor -r 10 -e linkUpTrap "Generate linkUp" ifOperStatus != 2
23 monitor -r 10 -e linkDownTrap "Generate linkDown" ifOperStatus == 2
24
25 # Remove all old ifTable entries with the same ifName as newly appeared
26 # interface (with different ifIndex) - this is the case on e.g. ppp interfaces
27 interface_replace_old yes
28
29 # T4902: exclude container storage from monitoring
30 ignoreDisk /usr/lib/live/mount/persistence/container
31
32 ########################
33 # configurable section #
34 ########################
35
36 # Default system description is VyOS version
37 sysDescr VyOS
38
39
40 # Listen
41 agentaddress unix:/run/snmpd.socket,:161,6:161
42
43 # SNMP communities
44
45 # Default RESTRICTED view
46 view RESTRICTED included .1 80
47 # ipRouteTable oid: excluded
48 view RESTRICTED excluded .1.3.6.1.2.1.4.21
49 # ipNetToMediaTable oid: excluded
50 view RESTRICTED excluded .1.3.6.1.2.1.4.22
51 # ipNetToPhysicalPhysAddress oid: excluded
52 view RESTRICTED excluded .1.3.6.1.2.1.4.35
53 # ipForward oid: excluded
54 view RESTRICTED excluded .1.3.6.1.2.1.4.24
55
56
57
58
59
60