When machined is started earlier than DBus service, the execution is
blocked by reading properties through DBus for a while. Let's return
earlier if the DBus connection is not ready.
Fixes issue reported in #40414.
assert(manager);
assert(unit);
+ r = sd_bus_is_ready(manager->api_bus);
+ if (r < 0)
+ return r;
+ if (r == 0)
+ return -ENOTCONN;
+
path = unit_dbus_path_from_name(unit);
if (!path)
return -ENOMEM;
assert(manager);
assert(path);
+ r = sd_bus_is_ready(manager->api_bus);
+ if (r < 0)
+ return r;
+ if (r == 0)
+ return -ENOTCONN;
+
r = sd_bus_get_property(
manager->api_bus,
"org.freedesktop.systemd1",