#include "dbus-client-track.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_load_state, unit_load_state, UnitLoadState);
+static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_job_mode, job_mode, JobMode);
static int property_get_names(
sd_bus *bus,
return r;
LIST_FOREACH(conditions, c, u->conditions) {
- r = sd_bus_message_append(reply, "sbbsi", condition_type_to_string(c->type), c->trigger, c->negate, c->parameter, c->state);
+ r = sd_bus_message_append(reply, "(sbbsi)",
+ condition_type_to_string(c->type),
+ c->trigger, c->negate,
+ c->parameter, c->state);
if (r < 0)
return r;
if (r < 0)
return r;
- r = sd_bus_message_enter_container(message, 'a', "(sv)");
- if (r < 0)
- return r;
-
r = bus_unit_set_properties(u, message, runtime ? UNIT_RUNTIME : UNIT_PERSISTENT, true, error);
if (r < 0)
return r;
- r = sd_bus_message_exit_container(message);
- if (r < 0)
- return r;
-
return sd_bus_reply_method_return(message, NULL);
}
SD_BUS_PROPERTY("TriggeredBy", "as", property_get_dependencies, offsetof(Unit, dependencies[UNIT_TRIGGERED_BY]), 0),
SD_BUS_PROPERTY("PropagatesReloadTo", "as", property_get_dependencies, offsetof(Unit, dependencies[UNIT_PROPAGATES_RELOAD_TO]), 0),
SD_BUS_PROPERTY("ReloadPropagatedFrom", "as", property_get_dependencies, offsetof(Unit, dependencies[UNIT_RELOAD_PROPAGATED_FROM]), 0),
+ SD_BUS_PROPERTY("JoinsNamespaceOf", "as", property_get_dependencies, offsetof(Unit, dependencies[UNIT_JOINS_NAMESPACE_OF]), 0),
SD_BUS_PROPERTY("RequiresMountsFor", "as", NULL, offsetof(Unit, requires_mounts_for), 0),
SD_BUS_PROPERTY("Documentation", "as", NULL, offsetof(Unit, documentation), 0),
SD_BUS_PROPERTY("Description", "s", property_get_description, 0, 0),
SD_BUS_PROPERTY("RefuseManualStop", "b", bus_property_get_bool, offsetof(Unit, refuse_manual_stop), 0),
SD_BUS_PROPERTY("AllowIsolate", "b", bus_property_get_bool, offsetof(Unit, allow_isolate), 0),
SD_BUS_PROPERTY("DefaultDependencies", "b", bus_property_get_bool, offsetof(Unit, default_dependencies), 0),
- SD_BUS_PROPERTY("OnFailureIsolate", "b", bus_property_get_bool, offsetof(Unit, on_failure_isolate), 0),
+ SD_BUS_PROPERTY("OnFailureJobMode", "s", property_get_job_mode, offsetof(Unit, on_failure_job_mode), 0),
SD_BUS_PROPERTY("IgnoreOnIsolate", "b", bus_property_get_bool, offsetof(Unit, ignore_on_isolate), 0),
SD_BUS_PROPERTY("IgnoreOnSnapshot", "b", bus_property_get_bool, offsetof(Unit, ignore_on_snapshot), 0),
SD_BUS_PROPERTY("NeedDaemonReload", "b", property_get_need_daemon_reload, 0, 0),
void bus_unit_send_change_signal(Unit *u) {
int r;
-
assert(u);
if (u->in_dbus_queue) {
r = bus_manager_foreach_client(u->manager, u->sent_dbus_new_signal ? send_changed_signal : send_new_signal, u);
if (r < 0)
- log_warning("Failed to send unit change signal for %s: %s", u->id, strerror(-r));
+ log_debug("Failed to send unit change signal for %s: %s", u->id, strerror(-r));
u->sent_dbus_new_signal = true;
}
void bus_unit_send_removed_signal(Unit *u) {
int r;
-
assert(u);
if (!u->sent_dbus_new_signal)
r = bus_manager_foreach_client(u->manager, send_removed_signal, u);
if (r < 0)
- log_warning("Failed to send unit change signal for %s: %s", u->id, strerror(-r));
+ log_debug("Failed to send unit remove signal for %s: %s", u->id, strerror(-r));
}
int bus_unit_queue_job(
path = job_dbus_path(j);
if (!path)
- return r;
+ return -ENOMEM;
return sd_bus_reply_method_return(message, "o", path);
}
if (r < 0)
return r;
+ r = sd_bus_message_exit_container(message);
+ if (r < 0)
+ return r;
+
return 1;
}
r = sd_bus_message_rewind(message, false);
if (r < 0)
return r;
+
for_real = true;
continue;
}
n += for_real;
}
+ r = sd_bus_message_exit_container(message);
+ if (r < 0)
+ return r;
+
if (commit && n > 0 && UNIT_VTABLE(u)->bus_commit_properties)
UNIT_VTABLE(u)->bus_commit_properties(u);