snmptrapd.service failing to start on RHEL 9.4

Posted on

My production server is RHEL 8.9
Installed snmp rpm's

net-snmp.x86_64                          1:5.8-28.el8                            @rhel-8-for-x86_64-appstream-rpms
net-snmp-agent-libs.x86_64               1:5.8-28.el8                            @rhel-8-for-x86_64-appstream-rpms
net-snmp-devel.x86_64                    1:5.8-28.el8                            @rhel-8-for-x86_64-appstream-rpms
net-snmp-libs.x86_64                     1:5.8-28.el8                            @rhel-8-for-x86_64-baseos-rpms
net-snmp-utils.x86_64                    1:5.8-28.el8                            @rhel-8-for-x86_64-appstream-rpms
rsyslog-mmsnmptrapd.x86_64               8.2102.0-15.el8                         @rhel-8-for-x86_64-appstream-rpms

Because of the number of

createUser -e 800092C404534...

lines in my snmptrapd.conf I had to increase the timeout for the service to start by editing /usr/lib/systemd/system/snmptrapd.service

[Unit]
Description=Simple Network Management Protocol (SNMP) Trap Daemon.
After=syslog.target network-online.target

[Service]
TimeoutSec=300 <--- timeout added by me
Type=notify
Environment=OPTIONS="-Lsd"
EnvironmentFile=-/etc/sysconfig/snmptrapd
ExecStart=/usr/sbin/snmptrapd $OPTIONS -f
ExecReload=/bin/kill -HUP $MAINPID


[Install]
WantedBy=multi-user.target

I ran

systemctl daemon-reload
systemctl start snmptrapd

It starts fine.

On my DEV RHEL 9.4 server, which has

net-snmp.x86_64                           1:5.9.1-13.el9                 @rhel-9-for-x86_64-appstream-rpms
net-snmp-agent-libs.x86_64                1:5.9.1-13.el9                 @rhel-9-for-x86_64-appstream-rpms
net-snmp-devel.x86_64                     1:5.9.1-13.el9                 @rhel-9-for-x86_64-appstream-rpms
net-snmp-libs.x86_64                      1:5.9.1-13.el9                 @rhel-9-for-x86_64-appstream-rpms
net-snmp-utils.x86_64                     1:5.9.1-13.el9                 @rhel-9-for-x86_64-appstream-rpms
rsyslog-mmsnmptrapd.x86_64                8.2310.0-4.el9                 @rhel-9-for-x86_64-appstream-rpms

I performed the same steps but in this case it errors

Job for snmptrapd.service failed because the control process exited with error code.
See "systemctl status snmptrapd.service" and "journalctl -xeu snmptrapd.service" for details.

systemctl status snmptrapd.service shows

[root@hostname sbin]# systemctl status snmptrapd.service
× snmptrapd.service - Simple Network Management Protocol (SNMP) Trap Daemon.
     Loaded: loaded (/usr/lib/systemd/system/snmptrapd.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Fri 2024-06-28 12:57:26 EDT; 17s ago
    Process: 1599356 ExecStart=/usr/sbin/snmptrapd $OPTIONS -f (code=exited, status=1/FAILURE)
   Main PID: 1599356 (code=exited, status=1/FAILURE)
        CPU: 2min 30.398s

Jun 28 12:54:54 Server_FQDN systemd[1]: Starting Simple Network Management Protocol (SNMP) Trap Daemon....
Jun 28 12:57:26 Server_FQDN systemd[1]: snmptrapd.service: Main process exited, code=exited, status=1/FAILURE
Jun 28 12:57:26 Server_FQDN systemd[1]: snmptrapd.service: Failed with result 'exit-code'.
Jun 28 12:57:26 Server_FQDN systemd[1]: Failed to start Simple Network Management Protocol (SNMP) Trap Daemon..
Jun 28 12:57:26 Server_FQDN systemd[1]: snmptrapd.service: Consumed 2min 30.398s CPU time.

journalctl -xeu snmptrapd.service shows

Jun 28 12:57:26 Server_FQDN systemd[1]: snmptrapd.service: Main process exited, code=exited, status=1/FAILURE
Subject: Unit process exited
Defined-By: systemd
Support: https://access.redhat.com/support

An ExecStart= process belonging to unit snmptrapd.service has exited.

The process' exit code is 'exited' and its exit status is 1.
Jun 28 12:57:26 Server_FQDN systemd[1]: snmptrapd.service: Failed with result 'exit-code'.
Subject: Unit failed
Defined-By: systemd
Support: https://access.redhat.com/support

The unit snmptrapd.service has entered the 'failed' state with result 'exit-code'.
Jun 28 12:57:26 Server_FQDN systemd[1]: Failed to start Simple Network Management Protocol (SNMP) Trap Daemon..
Subject: A start job for unit snmptrapd.service has failed
Defined-By: systemd
Support: https://access.redhat.com/support

A start job for unit snmptrapd.service has finished with a failure.

The job identifier is 142767 and the job result is failed.
Jun 28 12:57:26 Server_FQDN systemd[1]: snmptrapd.service: Consumed 2min 30.398s CPU time.
Subject: Resources consumed by unit runtime
Defined-By: systemd
Support: https://access.redhat.com/support

The unit snmptrapd.service completed and consumed the indicated resources.

I've spent the last several hours scouring for a soloution, but have come up empty.
Hopefully this isn't a unique issue and someone has an answer.

regards,
Tom

Responses