X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fmanager.c;h=827e9937c65af551456a24142fd4851c84f6a72f;hp=32cd642213793e9cd136203c530c5ff36b1d7685;hb=b853f6e9d60c0eab2038227718ee1ed1266f94de;hpb=6210e7fc31e14159627144f7409eadd3ce0d72b9 diff --git a/src/manager.c b/src/manager.c index 32cd64221..827e9937c 100644 --- a/src/manager.c +++ b/src/manager.c @@ -907,7 +907,7 @@ static void transaction_drop_redundant(Manager *m) { LIST_FOREACH(transaction, k, j) { if (!job_is_anchor(k) && - job_type_is_redundant(k->type, unit_active_state(k->unit))) + (j->installed || job_type_is_redundant(k->type, unit_active_state(k->unit)))) continue; changes_something = true; @@ -917,7 +917,7 @@ static void transaction_drop_redundant(Manager *m) { if (changes_something) continue; - log_debug("Found redundant job %s/%s, dropping.", j->unit->meta.id, job_type_to_string(j->type)); + /* log_debug("Found redundant job %s/%s, dropping.", j->unit->meta.id, job_type_to_string(j->type)); */ transaction_delete_job(m, j, false); again = true; break; @@ -1069,10 +1069,15 @@ static void transaction_collect_garbage(Manager *m) { again = false; HASHMAP_FOREACH(j, m->transaction_jobs, i) { - if (j->object_list) + if (j->object_list) { + /* log_debug("Keeping job %s/%s because of %s/%s", */ + /* j->unit->meta.id, job_type_to_string(j->type), */ + /* j->object_list->subject ? j->object_list->subject->unit->meta.id : "root", */ + /* j->object_list->subject ? job_type_to_string(j->object_list->subject->type) : "root"); */ continue; + } - log_debug("Garbage collecting job %s/%s", j->unit->meta.id, job_type_to_string(j->type)); + /* log_debug("Garbage collecting job %s/%s", j->unit->meta.id, job_type_to_string(j->type)); */ transaction_delete_job(m, j, true); again = true; break; @@ -1184,8 +1189,10 @@ static int transaction_apply(Manager *m) { } while ((j = hashmap_steal_first(m->transaction_jobs))) { - if (j->installed) + if (j->installed) { + /* log_debug("Skipping already installed job %s/%s as %u", j->unit->meta.id, job_type_to_string(j->type), (unsigned) j->id); */ continue; + } if (j->unit->meta.job) job_free(j->unit->meta.job); @@ -1352,7 +1359,7 @@ static Job* transaction_add_one_job(Manager *m, JobType type, Unit *unit, bool o if (is_new) *is_new = true; - log_debug("Added job %s/%s to transaction.", unit->meta.id, job_type_to_string(type)); + /* log_debug("Added job %s/%s to transaction.", unit->meta.id, job_type_to_string(type)); */ return j; } @@ -2008,7 +2015,7 @@ static int manager_start_target(Manager *m, const char *name, JobMode mode) { dbus_error_init(&error); - log_info("Activating special unit %s", name); + log_debug("Activating special unit %s", name); if ((r = manager_add_job_by_name(m, JOB_START, name, mode, true, &error, NULL)) < 0) log_error("Failed to enqueue %s job: %s", name, bus_error(&error, r)); @@ -2185,6 +2192,9 @@ static int process_event(Manager *m, struct epoll_event *ev) { assert(w = ev->data.ptr); + if (w->type == WATCH_INVALID) + return 0; + switch (w->type) { case WATCH_SIGNAL: @@ -2437,8 +2447,8 @@ void manager_send_unit_plymouth(Manager *m, Unit *u) { zero(sa); sa.sa.sa_family = AF_UNIX; - strncpy(sa.un.sun_path+1, "/ply-boot-protocol", sizeof(sa.un.sun_path)-1); - if (connect(fd, &sa.sa, sizeof(sa.un)) < 0) { + strncpy(sa.un.sun_path+1, "/org/freedesktop/plymouthd", sizeof(sa.un.sun_path)-1); + if (connect(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + 1 + strlen(sa.un.sun_path+1)) < 0) { if (errno != EPIPE && errno != EAGAIN && @@ -2829,7 +2839,7 @@ void manager_run_generators(Manager *m) { assert(m); - generator_path = m->running_as == MANAGER_SYSTEM ? SYSTEM_GENERATOR_PATH : SESSION_GENERATOR_PATH; + generator_path = m->running_as == MANAGER_SYSTEM ? SYSTEM_GENERATOR_PATH : USER_GENERATOR_PATH; if (!(d = opendir(generator_path))) { if (errno == ENOENT) @@ -2842,9 +2852,9 @@ void manager_run_generators(Manager *m) { if (!m->generator_unit_path) { char *p; char system_path[] = "/dev/.systemd/generator-XXXXXX", - session_path[] = "/tmp/systemd-generator-XXXXXX"; + user_path[] = "/tmp/systemd-generator-XXXXXX"; - if (!(p = mkdtemp(m->running_as == MANAGER_SYSTEM ? system_path : session_path))) { + if (!(p = mkdtemp(m->running_as == MANAGER_SYSTEM ? system_path : user_path))) { log_error("Failed to generate generator directory: %m"); goto finish; } @@ -2980,7 +2990,7 @@ void manager_undo_generators(Manager *m) { static const char* const manager_running_as_table[_MANAGER_RUNNING_AS_MAX] = { [MANAGER_SYSTEM] = "system", - [MANAGER_SESSION] = "session" + [MANAGER_USER] = "user" }; DEFINE_STRING_TABLE_LOOKUP(manager_running_as, ManagerRunningAs);