Snmp shows error "snmpd dead but subsys locked"
Environment
- Red Hat Enterprise Linux Hypervisor
Issue
- When running
service snmpd startthere is no failure message, andservice snmpd statusreturns with "snmpd dead but subsys locked"
Resolution
- Removing the -v flag from /etc/sysconfig/snmpd resolves the issue
Root Cause
- The snmpd service was configured in /etc/sysconfig/snmpd to run with the -v flag. This flag tells snmpd to print the version number and then exit.
Diagnostic Steps
- Reviewing an strace from the system, we see that the service is running with the -v flag which tells it to exit after printing the version number:
25515 14:40:22.445810 open("/etc/sysconfig/snmpd", O_RDONLY) = 3
25515 14:40:22.445853 fstat(3, {st_mode=S_IFREG|0644, st_size=112, ...}) = 0
25515 14:40:22.445905 read(3, "# snmpd command line options\n# OPTIONS=\"-LS0-6d -Lf /dev/null -p /var/run/snmpd.pid\"\nOPTIONS=\"-v -Lf /dev/null\"\n", 112) = 112
25515 14:40:22.445955 close(3) = 0
- Review /etc/sysconfig/snmpd:
$ cat etc/sysconfig/snmpd
# snmpd command line options
# OPTIONS="-LS0-6d -Lf /dev/null -p /var/run/snmpd.pid"
OPTIONS="-v -Lf /dev/null"
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
