You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Debian Stretch, dedicated hosts. Agent version is 6.41.1, from commit fa227f0, serialisation version 4.12.0, Go version go1.12.9; representing an install of the Debian package version 1:6.14.1-1. systemd is systemd 232; the YAML of the check is:
A connection to /run/systemd/private will always be refused when running as a uid other than root; see this discussion for a similar issue with the Prometheus project. The agent correctly then detects the error and falls back to using dbus.
The failing connection does, however, cause systemd to emit security messages about the denied connection which are currently flooding our log aggregation :)
Configuring an alternative path such as /dev/null to cause the connection to fail more quietly removes the dbus fallback which causes the check not to work. Lennart Poettering has said that /run/systemd/private shouldn't generally be considered a public API; the commit history suggests that this is in order to access the host systemd from within a Docker container, but perhaps that behaviour could be suppressed when not running within a container, since it cannot work unless running as root anyway?
The text was updated successfully, but these errors were encountered:
danpalmer
added a commit
to danpalmer/datadog-agent
that referenced
this issue
Oct 29, 2019
See: DataDog/dd-agent#3860
The default systemd socket is a private API not intended for external use. For this reason, processes must be run as root to access them, and therefore this is typically very unlikely to work as the agent does not run as root by default. We re-order the checks to try dbus first which is far more likely to succeed.
This has the benefit of not causing extensive logging is syslog for failed connections due to insufficient permissions.
Co-authored-by: Alistair Lynn <[email protected]>
Output of the info page
Additional environment details (Operating System, Cloud provider, etc):
Debian Stretch, dedicated hosts. Agent version is 6.41.1, from commit fa227f0, serialisation version 4.12.0, Go version go1.12.9; representing an install of the Debian package version 1:6.14.1-1.
systemd
is systemd 232; the YAML of the check is:With the latter service absent the behaviour is the same.
Steps to reproduce the issue:
$ sudo -u dd-agent -- datadog-agent check systemd
$ sudo journalctl --since '2m ago'
Describe the results you received:
Logs of the following format:
systemd[1]: Incoming private connection from unprivileged client, refusing: Operation not permitted
Describe the results you expected:
The sound of silence.
Additional information you deem important (e.g. issue happens only occasionally):
This happens every time the agent tries to communicate with systemd. It is triggered by this line:
https://github.com/DataDog/datadog-agent/blob/6.14.1/pkg/collector/corechecks/systemd/systemd.go#L236
A connection to
/run/systemd/private
will always be refused when running as a uid other than root; see this discussion for a similar issue with the Prometheus project. The agent correctly then detects the error and falls back to using dbus.The failing connection does, however, cause systemd to emit security messages about the denied connection which are currently flooding our log aggregation :)
Configuring an alternative path such as
/dev/null
to cause the connection to fail more quietly removes the dbus fallback which causes the check not to work. Lennart Poettering has said that/run/systemd/private
shouldn't generally be considered a public API; the commit history suggests that this is in order to access the host systemd from within a Docker container, but perhaps that behaviour could be suppressed when not running within a container, since it cannot work unless running as root anyway?The text was updated successfully, but these errors were encountered: