Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1775304

Summary: snmpd starts before the network stack is online (network.target vs network-online.target)
Product: Red Hat Enterprise Linux 8 Reporter: Ravindra Patil <ravpatil>
Component: net-snmpAssignee: Josef Ridky <jridky>
Status: CLOSED ERRATA QA Contact: Evgeny Fedin <efedin>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 8.1CC: apmukher, djez, efedin, fadamo, jafa81, ovasik
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: net-snmp-5.8-15.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 02:07:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ravindra Patil 2019-11-21 17:13:24 UTC
Description of problem:
The snmpd service reporting error for hostname resolution which are configured in /etc/snmpd.conf at boot 

cannot resolve source hostname

# vi /etc/snmp/snmpd.conf

rocommunity public_server node2.example.com
rocommunity public_server node3.example.com
rocommunity public_server node4.example.com
rocommunity public_server node5.example.com

At boot these hostnames are not getting resolved due to dependencies of unit files. 

Nov 19 12:41:18 node1 NetworkManager[1181]: <info>  [1574163678.0176] hostname: hostname: using hostnamed
Nov 19 12:41:18 node1 NetworkManager[1181]: <info>  [1574163678.0179] hostname: hostname changed from (none) to "node1.example.com"
Nov 19 12:41:18 node1 NetworkManager[1181]: <info>  [1574163678.0184] dns-mgr[0x555ae735a250]: init: dns=default,systemd-resolved rc-manager=symlink
Nov 19 12:41:18 node1 crond[1257]: (CRON) INFO (running with inotify support)
Nov 19 12:41:18 node1 snmpd[1238]: /etc/snmp/snmpd.conf: line 44: Error: cannot resolve source hostname
Nov 19 12:41:18 node1 snmpd[1238]: /etc/snmp/snmpd.conf: line 45: Error: cannot resolve source hostname
Nov 19 12:41:18 node1 snmpd[1238]: /etc/snmp/snmpd.conf: line 46: Error: cannot resolve source hostname
Nov 19 12:41:18 node1 snmpd[1238]: /etc/snmp/snmpd.conf: line 47: Error: cannot resolve source hostname
Nov 19 12:41:18 node1 snmpd[1238]: net-snmp: 4 error(s) in config file(s)
Nov 19 12:41:18 node1 NetworkManager[1181]: <info>  [1574163678.0899] Loaded device plugin: NMTeamFactory (/usr/lib64/NetworkManager/1.20.0-3.el8/libnm-device-plugin-team.so)
Nov 19 12:41:18 node1 NetworkManager[1181]: <info>  [1574163678.0900] manager: rfkill: Wi-Fi enabled by radio killswitch; enabled by state file
Nov 19 12:41:18 node1 NetworkManager[1181]: <info>  [1574163678.0901] manager: rfkill: WWAN enabled by radio killswitch; enabled by state file
Nov 19 12:41:18 node1 NetworkManager[1181]: <info>  [1574163678.0902] manager: Networking is enabled by state file

The snmpd service depends on network-online.target instead of network.target.

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


Version-Release number of selected component (if applicable):


How reproducible:
5.8-10.el8.x86_64 

Steps to Reproduce:
1. Configure hostnames in community strings
2. Reboot the system
3.

Actual results:
snmpd reports Error: cannot resolve source hostname

Expected results:
snmpd should start only after network-online.target and should resolve the hostnames. 


Additional info:
Similar bugzilla filed for RHEL 7.2 :

Bug 1388118 - snmpd starts before the network stack is online (network.target vs network-online.target)

Comment 7 Michal Middleton 2020-06-26 18:56:55 UTC
This issue is still present in net-snmp-5.8-14.el8.x86_64 / 8.2 release

Comment 8 Josef Ridky 2020-06-26 19:01:16 UTC
This issue was fixed in net-snmp-5.8-15.el8, that will be available with RHEL-8.3 release.

Comment 12 errata-xmlrpc 2020-11-04 02:07:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (net-snmp bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4576