X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fdbus-manager.c;h=6d0ecc3df95720e248df6b3771953ac598ad34c4;hb=b95cf3629e8d78a0d28e71b0f5559fa9a8c038b5;hp=63e80838059be507fccceb3e2e1cb4f3bc7d5845;hpb=8fe914ec81d9f57bcc083036f528b00119ed2e3b;p=elogind.git diff --git a/src/dbus-manager.c b/src/dbus-manager.c index 63e808380..6d0ecc3df 100644 --- a/src/dbus-manager.c +++ b/src/dbus-manager.c @@ -131,6 +131,7 @@ " \n" \ " \n" \ " \n" \ + " \n" \ " \n" \ " \n" \ " \n" \ @@ -240,6 +241,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection, { "org.freedesktop.systemd1.Manager", "Environment", bus_property_append_strv, "as", m->environment }, { "org.freedesktop.systemd1.Manager", "ConfirmSpawn", bus_property_append_bool, "b", &m->confirm_spawn }, { "org.freedesktop.systemd1.Manager", "ShowStatus", bus_property_append_bool, "b", &m->show_status }, + { "org.freedesktop.systemd1.Manager", "SysVConsole", bus_property_append_bool, "b", &m->sysv_console }, { "org.freedesktop.systemd1.Manager", "UnitPath", bus_property_append_strv, "as", m->lookup_paths.unit_path }, { "org.freedesktop.systemd1.Manager", "SysVInitPath", bus_property_append_strv, "as", m->lookup_paths.sysvinit_path }, { "org.freedesktop.systemd1.Manager", "SysVRcndPath", bus_property_append_strv, "as", m->lookup_paths.sysvrcnd_path }, @@ -413,6 +415,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection, const char *description, *load_state, *active_state, *sub_state, *sjob_type, *following; DBusMessageIter sub2; uint32_t job_id; + Unit *f; if (k != u->meta.id) continue; @@ -424,7 +427,9 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection, load_state = unit_load_state_to_string(u->meta.load_state); active_state = unit_active_state_to_string(unit_active_state(u)); sub_state = unit_sub_state_to_string(u); - following = u->meta.following ? u->meta.following->meta.id : ""; + + f = unit_following(u); + following = f ? f->meta.id : ""; if (!(u_path = unit_dbus_path(u))) goto oom; @@ -796,8 +801,11 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection, job_type = JOB_RELOAD; } - if (job_type == JOB_START && u->meta.only_by_dependency) { - dbus_set_error(&error, BUS_ERROR_ONLY_BY_DEPENDENCY, "Unit may be activated by dependency only."); + if ((job_type == JOB_START && u->meta.refuse_manual_start) || + (job_type == JOB_STOP && u->meta.refuse_manual_stop) || + ((job_type == JOB_RESTART || job_type == JOB_TRY_RESTART) && + (u->meta.refuse_manual_start || u->meta.refuse_manual_stop))) { + dbus_set_error(&error, BUS_ERROR_ONLY_BY_DEPENDENCY, "Operation refused, may be requested by dependency only."); return bus_send_error_reply(m, connection, message, &error, -EPERM); }