dbus-manager.c revision 17f62e9bd00f5fefd486475861b06d3ec6b7ee10
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering This file is part of systemd.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering Copyright 2010 Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering systemd is free software; you can redistribute it and/or modify it
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering under the terms of the GNU Lesser General Public License as published by
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering (at your option) any later version.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering systemd is distributed in the hope that it will be useful, but
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering Lesser General Public License for more details.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering You should have received a copy of the GNU Lesser General Public License
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering return sd_bus_message_append(reply, "s", PACKAGE_VERSION);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering return sd_bus_message_append(reply, "s", SYSTEMD_FEATURES);
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart Poettering /* Make sure to return the empty string when we detect no virtualization, as that is the API.
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart Poettering * https://github.com/systemd/systemd/issues/1423
4e945a6f7971fd7d1f6b2c62ee3afdaff3c95ce4Lennart Poettering v == VIRTUALIZATION_NONE ? "" : virtualization_to_string(v));
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering return sd_bus_message_append(reply, "s", architecture_to_string(uname_architecture()));
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering char buf[sizeof("split-usr:cgroups-missing:local-hwclock:")] = "", *e = buf;
6f4dedb250f2d607eceefaa491f338becbeee7c0Tom Gundersen /* remove the last ':' */
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering return sd_bus_message_append(reply, "s", buf);
6f4dedb250f2d607eceefaa491f338becbeee7c0Tom Gundersen return sd_bus_message_append(reply, "s", log_target_to_string(log_get_target()));
6073b6f26ab9fc6bf335faa7073ec443eef093fdTom Gundersen const char *t;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering r = log_level_to_string_alloc(log_get_max_level(), &t);
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering return sd_bus_message_append(reply, "s", t);
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart Poettering const char *t;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering return sd_bus_message_append(reply, "u", (uint32_t) hashmap_size(m->units));
4e945a6f7971fd7d1f6b2c62ee3afdaff3c95ce4Lennart Poettering return sd_bus_message_append(reply, "u", (uint32_t) set_size(m->failed_units));
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering return sd_bus_message_append(reply, "u", (uint32_t) hashmap_size(m->jobs));
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering if (dual_timestamp_is_set(&m->finish_timestamp))
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering d = 1.0 - ((double) hashmap_size(m->jobs) / (double) m->n_installed_jobs);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering return sd_bus_message_append(reply, "d", d);
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering return sd_bus_message_append(reply, "s", manager_state_to_string(manager_state(m)));
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering assert_cc(sizeof(usec_t) == sizeof(uint64_t));
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering return sd_bus_message_append(reply, "t", (uint64_t) prctl(PR_GET_TIMERSLACK));
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poetteringstatic int method_get_unit(sd_bus_message *message, void *userdata, sd_bus_error *error) {
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering /* Anyone can call this method */
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering r = sd_bus_message_read(message, "s", &name);
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_PID, &creds);
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_UNIT, "Client not member of any unit.");
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s not loaded.", name);
4e945a6f7971fd7d1f6b2c62ee3afdaff3c95ce4Lennart Poettering r = mac_selinux_unit_access_check(u, message, "status", error);
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering return sd_bus_reply_method_return(message, "o", path);
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poetteringstatic int method_get_unit_by_pid(sd_bus_message *message, void *userdata, sd_bus_error *error) {
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering assert_cc(sizeof(pid_t) == sizeof(uint32_t));
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering /* Anyone can call this method */
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering r = sd_bus_message_read(message, "u", &pid);
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid PID " PID_FMT, pid);
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_PID, &creds);
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering return sd_bus_error_setf(error, BUS_ERROR_NO_UNIT_FOR_PID, "PID "PID_FMT" does not belong to any loaded unit.", pid);
ec2c5e4398f9d65e5dfe61530f2556224733d1e6Lennart Poettering r = mac_selinux_unit_access_check(u, message, "status", error);
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poettering return sd_bus_reply_method_return(message, "o", path);
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poetteringstatic int method_load_unit(sd_bus_message *message, void *userdata, sd_bus_error *error) {
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart Poettering /* Anyone can call this method */
1716f6dcf54d4c181c2e2558e3d5414f54c8d9caLennart Poettering r = sd_bus_message_read(message, "s", &name);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering r = sd_bus_query_sender_creds(message, SD_BUS_CREDS_PID, &creds);
if (!path)
return -ENOMEM;
static int method_start_unit_generic(sd_bus_message *message, Manager *m, JobType job_type, bool reload_if_possible, sd_bus_error *error) {
const char *name;
Unit *u;
assert(m);
static int method_reload_or_restart_unit(sd_bus_message *message, void *userdata, sd_bus_error *error) {
static int method_reload_or_try_restart_unit(sd_bus_message *message, void *userdata, sd_bus_error *error) {
static int method_start_unit_replace(sd_bus_message *message, void *userdata, sd_bus_error *error) {
const char *old_name;
Unit *u;
assert(m);
const char *name;
Unit *u;
assert(m);
const char *name;
Unit *u;
assert(m);
static int method_set_unit_properties(sd_bus_message *message, void *userdata, sd_bus_error *error) {
const char *name;
Unit *u;
assert(m);
static int transient_unit_from_message(
Manager *m,
const char *name,
Unit *u;
assert(m);
u->fragment_path ||
u->source_path ||
u->refs ||
r = unit_make_transient(u);
*unit = u;
static int transient_aux_units_from_message(
Manager *m,
Unit *u;
assert(m);
if (r < 0 && r != -EEXIST)
if (r != -EEXIST) {
r = unit_load(u);
static int method_start_transient_unit(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.", unit_type_to_string(t));
if (mode < 0)
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
r = unit_load(u);
Job *j;
assert(m);
if (!path)
return -ENOMEM;
Job *j;
assert(m);
assert(m);
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
assert(m);
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
static int list_units_filtered(sd_bus_message *message, void *userdata, sd_bus_error *error, char **states) {
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_units_filtered(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,
assert(m);
if (!m->subscribed) {
assert(m);
assert(m);
return -ENOMEM;
r = fflush_and_check(f);
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "Support for snapshots has been removed.");
assert(m);
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
assert(m);
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
assert(m);
assert(m);
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "Reboot is only supported for system managers.");
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.");
assert(m);
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "KExec is only supported for system managers.");
assert(m);
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "Root switching is only supported by system manager.");
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Specified switch root path %s does not seem to be an OS tree. os-release file 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;
assert(m);
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
assert(m);
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid environment variable names or assignments");
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
static int method_unset_and_set_environment(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");
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
assert(m);
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "ExitCode can only be set for user service managers or in containers.");
Hashmap *h;
Iterator i;
assert(m);
return -ENOMEM;
r = unit_file_get_list(m->running_as == MANAGER_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_message *message, void *userdata, sd_bus_error *error) {
const char *name;
assert(m);
static int method_get_default_target(sd_bus_message *message, void *userdata, sd_bus_error *error) {
assert(m);
r = sd_bus_message_new_signal(bus, &message, "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "UnitFilesChanged");
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);
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
if (r == -ESHUTDOWN)
return reply_unit_file_changes_and_free(m, message, carries_install_info ? r : -1, changes, n_changes);
return method_enable_unit_files_generic(message, userdata, "enable", unit_file_enable, true, error);
static int method_reenable_unit_files(sd_bus_message *message, void *userdata, sd_bus_error *error) {
return method_enable_unit_files_generic(message, userdata, "enable", unit_file_reenable, true, error);
static int unit_file_preset_without_mode(UnitFileScope scope, bool runtime, const char *root_dir, char **files, bool force, UnitFileChange **changes, unsigned *n_changes) {
return unit_file_preset(scope, runtime, root_dir, files, UNIT_FILE_PRESET_FULL, force, changes, n_changes);
return method_enable_unit_files_generic(message, userdata, "enable", unit_file_preset_without_mode, true, error);
return method_enable_unit_files_generic(message, userdata, "disable", unit_file_mask, false, error);
static int method_preset_unit_files_with_mode(sd_bus_message *message, void *userdata, sd_bus_error *error) {
unsigned n_changes = 0;
const char *mode;
assert(m);
if (mm < 0)
return -EINVAL;
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
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);
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
static int method_disable_unit_files(sd_bus_message *message, void *userdata, sd_bus_error *error) {
static int method_set_default_target(sd_bus_message *message, void *userdata, sd_bus_error *error) {
unsigned n_changes = 0;
const char *name;
int force, r;
assert(m);
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
static int method_preset_all_unit_files(sd_bus_message *message, void *userdata, sd_bus_error *error) {
unsigned n_changes = 0;
const char *mode;
assert(m);
if (mm < 0)
return -EINVAL;
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
static int method_add_dependency_unit_files(sd_bus_message *message, void *userdata, sd_bus_error *error) {
unsigned n_changes = 0;
char *target;
char *type;
assert(m);
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
if (dep < 0)
return -EINVAL;
if (r == -ESHUTDOWN)
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("NFailedUnits", "u", property_get_n_failed_units, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
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), 0),
SD_BUS_WRITABLE_PROPERTY("ShutdownWatchdogUSec", "t", bus_property_get_usec, bus_property_set_usec, offsetof(Manager, shutdown_watchdog), 0),
SD_BUS_PROPERTY("DefaultTimerAccuracyUSec", "t", bus_property_get_usec, offsetof(Manager, default_timer_accuracy_usec), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultTimeoutStartUSec", "t", bus_property_get_usec, offsetof(Manager, default_timeout_start_usec), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultTimeoutStopUSec", "t", bus_property_get_usec, offsetof(Manager, default_timeout_stop_usec), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultRestartUSec", "t", bus_property_get_usec, offsetof(Manager, default_restart_usec), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultStartLimitInterval", "t", bus_property_get_usec, offsetof(Manager, default_start_limit_interval), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultStartLimitBurst", "u", bus_property_get_unsigned, offsetof(Manager, default_start_limit_burst), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultCPUAccounting", "b", bus_property_get_bool, offsetof(Manager, default_cpu_accounting), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultBlockIOAccounting", "b", bus_property_get_bool, offsetof(Manager, default_blockio_accounting), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultMemoryAccounting", "b", bus_property_get_bool, offsetof(Manager, default_memory_accounting), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultTasksAccounting", "b", bus_property_get_bool, offsetof(Manager, default_tasks_accounting), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitCPU", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_CPU]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitFSIZE", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_FSIZE]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitDATA", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_DATA]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitSTACK", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_STACK]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitCORE", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_CORE]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitRSS", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_RSS]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitNOFILE", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_NOFILE]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitAS", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_AS]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitNPROC", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_NPROC]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitMEMLOCK", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_MEMLOCK]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitLOCKS", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_LOCKS]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitSIGPENDING", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_SIGPENDING]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitMSGQUEUE", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_MSGQUEUE]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitNICE", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_NICE]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitRTPRIO", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_RTPRIO]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultLimitRTTIME", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_RTTIME]), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("DefaultTasksMax", "t", NULL, offsetof(Manager, default_tasks_max), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("TimerSlackNSec", "t", property_get_timer_slack_nsec, 0, SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_METHOD("StartUnitReplace", "sss", "o", method_start_unit_replace, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ReloadOrRestartUnit", "ss", "o", method_reload_or_restart_unit, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ReloadOrTryRestartUnit", "ss", "o", method_reload_or_try_restart_unit, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("SetUnitProperties", "sba(sv)", NULL, method_set_unit_properties, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("StartTransientUnit", "ssa(sv)a(sa(sv))", "o", method_start_transient_unit, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ListUnitsFiltered", "as", "a(ssssssouso)", method_list_units_filtered, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("SwitchRoot", "ss", NULL, method_switch_root, SD_BUS_VTABLE_CAPABILITY(CAP_SYS_BOOT)),
SD_BUS_METHOD("UnsetEnvironment", "as", NULL, method_unset_environment, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("UnsetAndSetEnvironment", "asas", NULL, method_unset_and_set_environment, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("GetUnitFileState", "s", "s", method_get_unit_file_state, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("EnableUnitFiles", "asbb", "ba(sss)", method_enable_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("DisableUnitFiles", "asb", "a(sss)", method_disable_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("ReenableUnitFiles", "asbb", "ba(sss)", method_reenable_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("LinkUnitFiles", "asbb", "a(sss)", method_link_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("PresetUnitFiles", "asbb", "ba(sss)", method_preset_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("PresetUnitFilesWithMode", "assbb", "ba(sss)", method_preset_unit_files_with_mode, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("MaskUnitFiles", "asbb", "a(sss)", method_mask_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("UnmaskUnitFiles", "asb", "a(sss)", method_unmask_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("SetDefaultTarget", "sb", "a(sss)", method_set_default_target, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("GetDefaultTarget", NULL, "s", method_get_default_target, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("PresetAllUnitFiles", "sbb", "a(sss)", method_preset_all_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("AddDependencyUnitFiles", "asssbb", "a(sss)", method_add_dependency_unit_files, SD_BUS_VTABLE_UNPRIVILEGED),
r = sd_bus_message_new_signal(bus, &message, "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "StartupFinished");
r = sd_bus_message_append(message, "tttttt", times[0], times[1], times[2], times[3], times[4], times[5]);
Manager *m,
assert(m);
r = bus_foreach_bus(
NULL,
r = sd_bus_message_new_signal(bus, &message, "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "Reloading");
assert(m);
"/org/freedesktop/systemd1",
"org.freedesktop.systemd1.Manager",
NULL);
assert(m);