Bug 1478214 - Unit files wait for network.target instead of network-online.target
Unit files wait for network.target instead of network-online.target
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: zabbix (Show other bugs)
25
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Volker Fröhlich
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-03 22:10 EDT by Mitchell Berger
Modified: 2017-12-12 05:18 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-12-12 05:18:37 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mitchell Berger 2017-08-03 22:10:15 EDT
Description of problem:

The zabbix-agent.service file specifies network.target in its After=
line because the Zabbix agent requires working network at startup.
Unfortunately, network.target is essentially meaningless at startup;
you need network-online.target for that purpose (see
https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/).

The result of this is a race condition where sometimes at startup,
if the network is not yet working when the agent starts, it fails to
resolve the hostname of the server that it needs to communicate with.
Sometimes this fails to correct itself once the network really is
working, and a restart of the zabbix-agent service is required for
monitoring to resume (and while the fact that it never corrects itself
sometimes ought to be fixed upstream, we shouldn't end up in this
situation to begin with because we should be ordering this service
after the correct target).

This is likely a problem with all the other service files as well, as
they all order themselves after network.target instead of
network-online.target.

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

3.0.7-1.fc25.x86_64

How reproducible:

The incorrect After= line in /usr/lib/systemd/system/zabbix-agent.service
is trivial to see.  Witnessing a loss of the race at startup reliably is
probably somewhat difficult, but also probably unnecessary.

Steps to Reproduce:
1.  Setup zabbix-agent to talk to a remote server
2.  Configure few enough other services as enabled at startup that
    zabbix-agent is likely to start prior to the network interfaces being
    fully configured.

Actual results:

zabbix-agent sometimes starts before the network is available, logs
failure to resolve the hostname of its server, and then does not send
any active check data to the server, either for some interval of time,
or indefinitely until it is restarted.

Expected results:

zabbix-agent only starts once the network is available.
Comment 1 Volker Fröhlich 2017-10-24 04:14:43 EDT
Zabbix doesn't necessarily need to resolve a name, as you can specify an IP address as well. In particular, in the case of an active-only-agent I can imagine it being able to start, since it's not binding to any interface that might be missing. The startup historically involved an invocation of res_init() to initialize name resolution. This used to happen only once, so if resolv.conf was empty or wrong, this never fixed itself. This has changed for most maintained releases: https://support.zabbix.com/browse/ZBXNEXT-1862
Comment 2 Fedora End Of Life 2017-11-16 14:23:18 EST
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Comment 3 Fedora End Of Life 2017-12-12 05:18:37 EST
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

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