mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
run: ignore bus connection error in acquiring invocation ID
Similar to 2b983b43c6, but for acquiring
invocation ID.
Fixes #37675.
This commit is contained in:
@@ -2063,8 +2063,18 @@ static int acquire_invocation_id(sd_bus *bus, const char *unit, sd_id128_t *ret)
|
||||
&error,
|
||||
&reply,
|
||||
"ay");
|
||||
if (r < 0)
|
||||
if (r < 0) {
|
||||
/* Let's ignore connection errors. This might be caused by that the service manager is being
|
||||
* restarted. Handle this gracefully. */
|
||||
if (bus_error_is_connection(&error) || bus_error_is_unknown_service(&error)) {
|
||||
log_debug_errno(r, "Invocation ID request failed due to bus connection problems, ignoring: %s",
|
||||
bus_error_message(&error, r));
|
||||
*ret = SD_ID128_NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return log_error_errno(r, "Failed to request invocation ID for unit: %s", bus_error_message(&error, r));
|
||||
}
|
||||
|
||||
r = bus_message_read_id128(reply, ret);
|
||||
if (r < 0)
|
||||
|
||||
Reference in New Issue
Block a user