diff options
author | Lennart Poettering <lennart@poettering.net> | 2024-05-27 19:06:08 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2024-05-28 15:05:11 +0200 |
commit | 7c1a1aa42c474daee5b90f102285676fd9cafd6c (patch) | |
tree | 1d265fec990cf334c486b84d9cbe43371e58c310 /src | |
parent | Merge pull request #33052 from yuwata/missing-loop (diff) | |
download | systemd-7c1a1aa42c474daee5b90f102285676fd9cafd6c.tar.xz systemd-7c1a1aa42c474daee5b90f102285676fd9cafd6c.zip |
machined: downgrade warning if we cannot drop ref to systemd unit if disconnected from bus
if machined exits while a machine is still running, we'll issue the
UnrefUnit() call on the unit. This quite likely will fail if during
shutdown the bus connection is already down. But that's no reason to
warn at all, since the ref count will implicitly be dropped if our side
disappears from the bus. Hence, downgrade to LOG_DEBUG in case of
connection problems.
Diffstat (limited to 'src')
-rw-r--r-- | src/machine/machine.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/machine/machine.c b/src/machine/machine.c index 5c21a039e5..0eb9a55e5f 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -675,8 +675,9 @@ void machine_release_unit(Machine *m) { r = manager_unref_unit(m->manager, m->unit, &error); if (r < 0) - log_warning_errno(r, "Failed to drop reference to machine scope, ignoring: %s", - bus_error_message(&error, r)); + log_full_errno(ERRNO_IS_DISCONNECT(r) ? LOG_DEBUG : LOG_WARNING, r, + "Failed to drop reference to machine scope, ignoring: %s", + bus_error_message(&error, r)); m->referenced = false; } |