dbus-manager.c revision 4f7385fa496242f06aaf358b66b28d71348607b3
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering This file is part of systemd.
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering Copyright 2010 Lennart Poettering
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering systemd is free software; you can redistribute it and/or modify it
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering under the terms of the GNU Lesser General Public License as published by
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering (at your option) any later version.
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering systemd is distributed in the hope that it will be useful, but
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering Lesser General Public License for more details.
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering You should have received a copy of the GNU Lesser General Public License
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering return sd_bus_message_append(reply, "s", PACKAGE_VERSION);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering return sd_bus_message_append(reply, "s", SYSTEMD_FEATURES);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering return sd_bus_message_append(reply, "s", id);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering char buf[sizeof("split-usr:mtab-not-symlink:cgroups-missing:local-hwclock:")] = "", *e = buf;
874bc134ac6504c45e94174e37af13ff21a6bfe2Zbigniew Jędrzejewski-Szmek if (readlink_malloc("/etc/mtab", &p) < 0)
874bc134ac6504c45e94174e37af13ff21a6bfe2Zbigniew Jędrzejewski-Szmek if (access("/proc/cgroups", F_OK) < 0)
874bc134ac6504c45e94174e37af13ff21a6bfe2Zbigniew Jędrzejewski-Szmek e = stpcpy(e, "cgroups-missing:");
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering /* remove the last ':' */
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering return sd_bus_message_append(reply, "s", buf);
968f319679d9069af037240d0c3bcd126181cdacZbigniew Jędrzejewski-Szmek return sd_bus_message_append(reply, "s", log_target_to_string(log_get_target()));
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering const char *t;
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering r = log_level_to_string_alloc(log_get_max_level(), &t);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering return sd_bus_message_append(reply, "s", t);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering const char *t;
968f319679d9069af037240d0c3bcd126181cdacZbigniew Jędrzejewski-Szmek r = sd_bus_message_read(value, "s", &t);
968f319679d9069af037240d0c3bcd126181cdacZbigniew Jędrzejewski-Szmek return log_set_max_level_from_string(t);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering return sd_bus_message_append(reply, "u", (uint32_t) hashmap_size(m->units));
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering return sd_bus_message_append(reply, "u", (uint32_t) hashmap_size(m->jobs));
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering if (dual_timestamp_is_set(&m->finish_timestamp))
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering d = 1.0 - ((double) hashmap_size(m->jobs) / (double) m->n_installed_jobs);
874bc134ac6504c45e94174e37af13ff21a6bfe2Zbigniew Jędrzejewski-Szmek return sd_bus_message_append(reply, "d", d);
874bc134ac6504c45e94174e37af13ff21a6bfe2Zbigniew Jędrzejewski-Szmekstatic int property_set_runtime_watchdog(
40b71e89bae4e51768db4dc50ec64c1e9c96eec4Sebastian Thorarensen assert_cc(sizeof(usec_t) == sizeof(uint64_t));
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poetteringstatic int method_get_unit(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering r = sd_bus_message_read(message, "s", &name);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s not loaded.", name);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering r = selinux_unit_access_check(u, bus, message, "status", error);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering return sd_bus_reply_method_return(message, "o", path);
c79e98eadd3056a36a662699fa650db5b1bca0c3Lennart Poetteringstatic int method_get_unit_by_pid(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
1dfa7e79a60de680086b1d93fcc3629b463f58bdLennart Poettering assert_cc(sizeof(pid_t) == sizeof(uint32_t));
1dfa7e79a60de680086b1d93fcc3629b463f58bdLennart Poettering r = sd_bus_message_read(message, "u", &pid);
56f64d95763a799ba4475daf44d8e9f72a1bd474Michal Schmidt _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
1dfa7e79a60de680086b1d93fcc3629b463f58bdLennart Poettering r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_PID, &creds);
1dfa7e79a60de680086b1d93fcc3629b463f58bdLennart Poettering return sd_bus_error_setf(error, BUS_ERROR_NO_UNIT_FOR_PID, "PID %u does not belong to any loaded unit.", pid);
1dfa7e79a60de680086b1d93fcc3629b463f58bdLennart Poettering r = selinux_unit_access_check(u, bus, message, "status", error);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering return sd_bus_reply_method_return(message, "o", path);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poetteringstatic int method_load_unit(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering r = sd_bus_message_read(message, "s", &name);
c79e98eadd3056a36a662699fa650db5b1bca0c3Lennart Poettering r = manager_load_unit(m, name, NULL, error, &u);
c79e98eadd3056a36a662699fa650db5b1bca0c3Lennart Poettering r = selinux_unit_access_check(u, bus, message, "status", error);
c79e98eadd3056a36a662699fa650db5b1bca0c3Lennart Poettering return sd_bus_reply_method_return(message, "o", path);
c79e98eadd3056a36a662699fa650db5b1bca0c3Lennart Poetteringstatic int method_start_unit_generic(sd_bus *bus, sd_bus_message *message, Manager *m, JobType job_type, bool reload_if_possible, sd_bus_error *error) {
c79e98eadd3056a36a662699fa650db5b1bca0c3Lennart Poettering r = sd_bus_message_read(message, "s", &name);
da927ba997d68401563b927f92e6e40e021a8e5cMichal Schmidt r = manager_load_unit(m, name, NULL, error, &u);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering return bus_unit_method_start_generic(bus, message, u, job_type, reload_if_possible, error);
3b3154df7e2773332bb814e167187367a0ccae4aLennart Poetteringstatic int method_start_unit(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
3b3154df7e2773332bb814e167187367a0ccae4aLennart Poettering return method_start_unit_generic(bus, message, userdata, JOB_START, false, error);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poetteringstatic int method_stop_unit(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering return method_start_unit_generic(bus, message, userdata, JOB_STOP, false, error);
f7a5bb2842037fa27dbc99d92c3fee7fe1bbbc2aZbigniew Jędrzejewski-Szmekstatic int method_reload_unit(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
f7a5bb2842037fa27dbc99d92c3fee7fe1bbbc2aZbigniew Jędrzejewski-Szmek return method_start_unit_generic(bus, message, userdata, JOB_RELOAD, false, error);
4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4fMichal Schmidtstatic int method_restart_unit(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4fMichal Schmidt return method_start_unit_generic(bus, message, userdata, JOB_RESTART, false, error);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poetteringstatic int method_try_restart_unit(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering return method_start_unit_generic(bus, message, userdata, JOB_TRY_RESTART, false, error);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poetteringstatic int method_reload_or_restart_unit(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
4a61c3e51e96a747c30598d78ee3a24e7c569e9fZbigniew Jędrzejewski-Szmek return method_start_unit_generic(bus, message, userdata, JOB_RESTART, true, error);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poetteringstatic int method_reload_or_try_restart_unit(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering return method_start_unit_generic(bus, message, userdata, JOB_TRY_RESTART, true, error);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poetteringstatic int method_start_unit_replace(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4fMichal Schmidt r = sd_bus_message_read(message, "s", &old_name);
23bbb0de4e3f85d9704a5c12a5afa2dfa0159e41Michal Schmidt if (!u || !u->job || u->job->type != JOB_START)
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_JOB, "No job queued for unit %s", old_name);
0153028ae379eb7c9a463c548ef73ea392c6cdb0Lennart Poettering return method_start_unit_generic(bus, message, m, JOB_START, false, error);
static int method_kill_unit(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
const char *name;
Unit *u;
assert(m);
static int method_reset_failed_unit(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
const char *name;
Unit *u;
assert(m);
static int method_set_unit_properties(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
const char *name;
Unit *u;
assert(m);
static int method_start_transient_unit(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
UnitType t;
Unit *u;
assert(m);
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Unit type %s does not support transient units.");
if (mode < 0)
r = unit_make_transient(u);
r = unit_load(u);
static int method_get_job(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
Job *j;
assert(m);
if (!path)
return -ENOMEM;
static int method_cancel_job(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
Job *j;
assert(m);
static int method_clear_jobs(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
assert(m);
static int method_reset_failed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
assert(m);
static int method_list_units(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
Iterator i;
Unit *u;
assert(m);
if (k != u->id)
if (!unit_path)
return -ENOMEM;
if (u->job) {
if (!job_path)
return -ENOMEM;
u->id,
unit_description(u),
static int method_list_jobs(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
Iterator i;
Job *j;
assert(m);
if (!job_path)
return -ENOMEM;
if (!unit_path)
return -ENOMEM;
j->id,
static int method_subscribe(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
assert(m);
static int method_unsubscribe(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
assert(m);
assert(m);
return -ENOMEM;
fflush(f);
if (ferror(f))
return -ENOMEM;
static int method_create_snapshot(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
const char *name;
int cleanup;
Snapshot *s;
assert(m);
if (!path)
return -ENOMEM;
static int method_remove_snapshot(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
const char *name;
Unit *u;
assert(m);
static int method_reload(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
assert(m);
static int method_reexecute(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
assert(m);
assert(m);
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "Exit is only supported for user service managers.");
static int method_reboot(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
assert(m);
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "Reboot is only supported for system managers.");
static int method_poweroff(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
assert(m);
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "Powering off is only supported for system managers.");
assert(m);
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "Halt is only supported for system managers.");
static int method_kexec(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
assert(m);
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "KExec is only supported for system managers.");
static int method_switch_root(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
assert(m);
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "KExec is only supported for system managers.");
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Specified switch root path %s does not seem to be an OS tree. /etc/os-release is missing.", root);
return -ENOMEM;
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Specified init binary %s does not exist.", p);
if (!rt)
return -ENOMEM;
if (!ri) {
return -ENOMEM;
static int method_set_environment(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
assert(m);
static int method_unset_environment(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
assert(m);
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid environment variable names or assignments");
static int method_unset_and_set_environment(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
assert(m);
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid environment variable names or assignments");
static int method_list_unit_files(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
Hashmap *h;
Iterator i;
assert(m);
return -ENOMEM;
r = unit_file_get_list(m->running_as == SYSTEMD_SYSTEM ? UNIT_FILE_SYSTEM : UNIT_FILE_USER, NULL, h);
goto fail;
goto fail;
goto fail;
fail:
static int method_get_unit_file_state(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
const char *name;
assert(m);
if (state < 0)
return state;
static int method_get_default_target(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
assert(m);
r = sd_bus_message_new_signal(bus, "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "UnitFilesChanged", &message);
static int reply_unit_file_changes_and_free(
Manager *m,
int carries_install_info,
unsigned n_changes) {
if (n_changes > 0)
goto fail;
if (carries_install_info >= 0) {
goto fail;
goto fail;
for (i = 0; i < n_changes; i++) {
goto fail;
goto fail;
fail:
static int method_enable_unit_files_generic(
Manager *m, const
char *verb,
int (*call)(UnitFileScope scope, bool runtime, const char *root_dir, char *files[], bool force, UnitFileChange **changes, unsigned *n_changes),
bool carries_install_info,
unsigned n_changes = 0;
assert(m);
#ifdef HAVE_SELINUX
STRV_FOREACH(i, l) {
Unit *u;
u = manager_get_unit(m, *i);
return reply_unit_file_changes_and_free(m, bus, message, carries_install_info ? r : -1, changes, n_changes);
static int method_enable_unit_files(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
return method_enable_unit_files_generic(bus, message, userdata, "enable", unit_file_enable, true, error);
static int method_reenable_unit_files(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
return method_enable_unit_files_generic(bus, message, userdata, "enable", unit_file_reenable, true, error);
static int method_link_unit_files(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
return method_enable_unit_files_generic(bus, message, userdata, "enable", unit_file_link, false, error);
static int method_preset_unit_files(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
return method_enable_unit_files_generic(bus, message, userdata, "enable", unit_file_preset, true, error);
static int method_mask_unit_files(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
return method_enable_unit_files_generic(bus, message, userdata, "disable", unit_file_mask, false, error);
static int method_disable_unit_files_generic(
Manager *m, const
char *verb,
int (*call)(UnitFileScope scope, bool runtime, const char *root_dir, char *files[], UnitFileChange **changes, unsigned *n_changes),
unsigned n_changes = 0;
int r, runtime;
assert(m);
static int method_disable_unit_files(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
return method_disable_unit_files_generic(bus, message, userdata, "disable", unit_file_disable, error);
static int method_unmask_unit_files(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
return method_disable_unit_files_generic(bus, message, userdata, "enable", unit_file_unmask, error);
static int method_set_default_target(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
unsigned n_changes = 0;
const char *name;
int force, r;
assert(m);
SD_BUS_PROPERTY("Virtualization", "s", property_get_virtualization, 0, SD_BUS_VTABLE_PROPERTY_CONST),
BUS_PROPERTY_DUAL_TIMESTAMP("FirmwareTimestamp", offsetof(Manager, firmware_timestamp), SD_BUS_VTABLE_PROPERTY_CONST),
BUS_PROPERTY_DUAL_TIMESTAMP("LoaderTimestamp", offsetof(Manager, loader_timestamp), SD_BUS_VTABLE_PROPERTY_CONST),
BUS_PROPERTY_DUAL_TIMESTAMP("KernelTimestamp", offsetof(Manager, kernel_timestamp), SD_BUS_VTABLE_PROPERTY_CONST),
BUS_PROPERTY_DUAL_TIMESTAMP("InitRDTimestamp", offsetof(Manager, initrd_timestamp), SD_BUS_VTABLE_PROPERTY_CONST),
BUS_PROPERTY_DUAL_TIMESTAMP("UserspaceTimestamp", offsetof(Manager, userspace_timestamp), SD_BUS_VTABLE_PROPERTY_CONST),
BUS_PROPERTY_DUAL_TIMESTAMP("FinishTimestamp", offsetof(Manager, finish_timestamp), SD_BUS_VTABLE_PROPERTY_CONST),
BUS_PROPERTY_DUAL_TIMESTAMP("SecurityStartTimestamp", offsetof(Manager, security_start_timestamp), SD_BUS_VTABLE_PROPERTY_CONST),
BUS_PROPERTY_DUAL_TIMESTAMP("SecurityFinishTimestamp", offsetof(Manager, security_finish_timestamp), SD_BUS_VTABLE_PROPERTY_CONST),
BUS_PROPERTY_DUAL_TIMESTAMP("GeneratorsStartTimestamp", offsetof(Manager, generators_start_timestamp), SD_BUS_VTABLE_PROPERTY_CONST),
BUS_PROPERTY_DUAL_TIMESTAMP("GeneratorsFinishTimestamp", offsetof(Manager, generators_finish_timestamp), SD_BUS_VTABLE_PROPERTY_CONST),
BUS_PROPERTY_DUAL_TIMESTAMP("UnitsLoadStartTimestamp", offsetof(Manager, units_load_start_timestamp), SD_BUS_VTABLE_PROPERTY_CONST),
BUS_PROPERTY_DUAL_TIMESTAMP("UnitsLoadFinishTimestamp", offsetof(Manager, units_load_finish_timestamp), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("NInstalledJobs", "u", bus_property_get_unsigned, offsetof(Manager, n_installed_jobs), 0),
SD_BUS_PROPERTY("NFailedJobs", "u", bus_property_get_unsigned, offsetof(Manager, n_failed_jobs), 0),
SD_BUS_PROPERTY("ConfirmSpawn", "b", bus_property_get_bool, offsetof(Manager, confirm_spawn), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("ShowStatus", "b", bus_property_get_bool, offsetof(Manager, show_status), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("UnitPath", "as", NULL, offsetof(Manager, lookup_paths.unit_path), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultStandardOutput", "s", bus_property_get_exec_output, offsetof(Manager, default_std_output), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultStandardError", "s", bus_property_get_exec_output, offsetof(Manager, default_std_output), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_WRITABLE_PROPERTY("RuntimeWatchdogUSec", "t", bus_property_get_usec, property_set_runtime_watchdog, offsetof(Manager, runtime_watchdog), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_WRITABLE_PROPERTY("ShutdownWatchdogUSec", "t", bus_property_get_usec, bus_property_set_usec, offsetof(Manager, shutdown_watchdog), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_METHOD("SwitchRoot", "ss", NULL, method_switch_root, SD_BUS_VTABLE_CAPABILITY(CAP_SYS_BOOT)),
SD_BUS_METHOD("GetUnitFileState", "s", "s", method_get_unit_file_state, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("GetDefaultTarget", NULL, "s", method_get_default_target, SD_BUS_VTABLE_UNPRIVILEGED),
int bus_manager_foreach_client(Manager *m, int (*send_message)(sd_bus *bus, const char *destination, void *userdata), void *userdata) {
Iterator i;
sd_bus *b;
int r, ret;
BusTrackedClient *d;
ret = 0;
ret = r;
if (m->api_bus) {
ret = r;
return ret;
r = sd_bus_message_new_signal(bus, "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "StartupFinished", &message);
r = sd_bus_message_append(message, "tttttt", times[0], times[1], times[2], times[3], times[4], times[5]);
Manager *m,
assert(m);
r = sd_bus_message_new_signal(bus, "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "Reloading", &message);
assert(m);