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 1263853 - rsyslog.service unit file should contain After=network.target
Summary: rsyslog.service unit file should contain After=network.target
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rsyslog
Version: 7.3
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Peter Vrabec
QA Contact: Stefan Dordevic
Depends On:
Blocks: 1203710 1295396 1296594 1313485
TreeView+ depends on / blocked
Reported: 2015-09-16 21:34 UTC by Ryan Sawhill
Modified: 2023-03-24 13:37 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2016-11-04 05:36:44 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1379638 0 unspecified CLOSED rsyslog does not start remote logging at boot 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHEA-2016:2401 0 normal SHIPPED_LIVE rsyslog bug fix and enhancement update 2016-11-03 13:55:50 UTC

Internal Links: 1379638

Description Ryan Sawhill 2015-09-16 21:34:23 UTC
Description of problem:

  rsyslog reads the system hostname when it starts and never thereafter. rsyslog is often used to send local logs to remote central log servers. By default, the local hostname is included in those messages.

  In environments where the local hostname is configured dynamically at boot time by DHCP or reverse-DNS, the hostname will never be set before rsyslog starts, leading to rsyslog reporting localhost.localdomain until it is restarted.

  Note that this could be considered a regression from RHEL6 behavior where rsyslog always started after networking (when using "network"; not NM). Of course the difference there is that we had a simple serialized boot order ...

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

  rsyslog ... any version, even latest in Fedora (rsyslog-8.8.0-3.fc22)

How reproducible:

Steps to Reproduce:

  0. systemctl enable NetworkManager-wait-online.service
  1. rm /etc/hostname
  2. Configure an interface with DHCP (from a server that provides hostnames or in a network that has good DNS PTR records for the DHCP addrs)
  3. reboot

Actual results:

  0. check /var/log/messages and see "localhost"
  1. systemctl restart rsyslog
  2. See proper transient DNS hostname as reported by hostnamectl

Expected results:

  0. grep -q After=network.target /usr/lib/systemd/system/rsyslog.service && echo TRUE (returns TRUE)
  1. Check /var/log/messages and see proper transient DNS hostname as reported by hostnamectl

Additional info:

  While rsyslog.service rightfully doesn't want/require network.target by default, many many many customers use rsyslog to send messages to / receive messages from remote systems.

Similar example: mariadb.service rightfully doesn't want/require network.target (because you can have local MySQL databases), but it DOES have "After=network.target".
    [root@rhel71]# rpm -Vf /usr/lib/systemd/system/mariadb.service
    [root@rhel71]# grep After /usr/lib/systemd/system/mariadb.service

  I'm not proposing we make rsyslog.service require networking; however, it SHOULD at least *try* to start after networking just like it did in RHEL6.

    [root@rhel66]# grep chkconfig /etc/init.d/{network,rsyslog}
    /etc/init.d/network:# chkconfig: 2345 10 90
    /etc/init.d/rsyslog:# chkconfig: 2345 12 88
    [root@rhel66]# ls -1 /etc/rc3.d/*{network,rsyslog}

  Note that with the change I'm proposing, it's not guaranteed we'll have a proper transient hostname by the time rsyslog starts ... unless one of the wait-online services is also enabled, along with networking itself. That's cool though. We can document that. That after all is not going to change. (See http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget)

Comment 11 errata-xmlrpc 2016-11-04 05:36:44 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, and where to find the updated
files, follow the link below.

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


Note You need to log in before you can comment on or make changes to this bug.