manager: do not print timing when running in test mode
This commit is contained in:
parent
14fe721b5f
commit
56dacdbc1c
|
@ -2580,44 +2580,12 @@ bool manager_unit_inactive_or_pending(Manager *m, const char *name) {
|
||||||
return unit_inactive_or_pending(u);
|
return unit_inactive_or_pending(u);
|
||||||
}
|
}
|
||||||
|
|
||||||
void manager_check_finished(Manager *m) {
|
static void manager_notify_finished(Manager *m) {
|
||||||
char userspace[FORMAT_TIMESPAN_MAX], initrd[FORMAT_TIMESPAN_MAX], kernel[FORMAT_TIMESPAN_MAX], sum[FORMAT_TIMESPAN_MAX];
|
char userspace[FORMAT_TIMESPAN_MAX], initrd[FORMAT_TIMESPAN_MAX], kernel[FORMAT_TIMESPAN_MAX], sum[FORMAT_TIMESPAN_MAX];
|
||||||
usec_t firmware_usec, loader_usec, kernel_usec, initrd_usec, userspace_usec, total_usec;
|
usec_t firmware_usec, loader_usec, kernel_usec, initrd_usec, userspace_usec, total_usec;
|
||||||
Unit *u = NULL;
|
|
||||||
Iterator i;
|
|
||||||
|
|
||||||
assert(m);
|
|
||||||
|
|
||||||
if (m->n_running_jobs == 0)
|
|
||||||
m->jobs_in_progress_event_source = sd_event_source_unref(m->jobs_in_progress_event_source);
|
|
||||||
|
|
||||||
if (hashmap_size(m->jobs) > 0) {
|
|
||||||
|
|
||||||
if (m->jobs_in_progress_event_source)
|
|
||||||
sd_event_source_set_time(m->jobs_in_progress_event_source, now(CLOCK_MONOTONIC) + JOBS_IN_PROGRESS_WAIT_USEC);
|
|
||||||
|
|
||||||
|
if (m->test_run)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
manager_flip_auto_status(m, false);
|
|
||||||
|
|
||||||
/* Notify Type=idle units that we are done now */
|
|
||||||
m->idle_pipe_event_source = sd_event_source_unref(m->idle_pipe_event_source);
|
|
||||||
manager_close_idle_pipe(m);
|
|
||||||
|
|
||||||
/* Turn off confirm spawn now */
|
|
||||||
m->confirm_spawn = false;
|
|
||||||
|
|
||||||
/* No need to update ask password status when we're going non-interactive */
|
|
||||||
manager_close_ask_password(m);
|
|
||||||
|
|
||||||
/* This is no longer the first boot */
|
|
||||||
manager_set_first_boot(m, false);
|
|
||||||
|
|
||||||
if (dual_timestamp_is_set(&m->finish_timestamp))
|
|
||||||
return;
|
|
||||||
|
|
||||||
dual_timestamp_get(&m->finish_timestamp);
|
|
||||||
|
|
||||||
if (m->running_as == SYSTEMD_SYSTEM && detect_container(NULL) <= 0) {
|
if (m->running_as == SYSTEMD_SYSTEM && detect_container(NULL) <= 0) {
|
||||||
|
|
||||||
|
@ -2673,10 +2641,6 @@ void manager_check_finished(Manager *m) {
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
SET_FOREACH(u, m->startup_units, i)
|
|
||||||
if (u->cgroup_path)
|
|
||||||
cgroup_context_apply(unit_get_cgroup_context(u), unit_get_cgroup_mask(u), u->cgroup_path, manager_state(m));
|
|
||||||
|
|
||||||
bus_manager_send_finished(m, firmware_usec, loader_usec, kernel_usec, initrd_usec, userspace_usec, total_usec);
|
bus_manager_send_finished(m, firmware_usec, loader_usec, kernel_usec, initrd_usec, userspace_usec, total_usec);
|
||||||
|
|
||||||
sd_notifyf(false,
|
sd_notifyf(false,
|
||||||
|
@ -2685,6 +2649,50 @@ void manager_check_finished(Manager *m) {
|
||||||
format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC));
|
format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void manager_check_finished(Manager *m) {
|
||||||
|
Unit *u = NULL;
|
||||||
|
Iterator i;
|
||||||
|
|
||||||
|
assert(m);
|
||||||
|
|
||||||
|
if (m->n_running_jobs == 0)
|
||||||
|
m->jobs_in_progress_event_source = sd_event_source_unref(m->jobs_in_progress_event_source);
|
||||||
|
|
||||||
|
if (hashmap_size(m->jobs) > 0) {
|
||||||
|
|
||||||
|
if (m->jobs_in_progress_event_source)
|
||||||
|
sd_event_source_set_time(m->jobs_in_progress_event_source, now(CLOCK_MONOTONIC) + JOBS_IN_PROGRESS_WAIT_USEC);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
manager_flip_auto_status(m, false);
|
||||||
|
|
||||||
|
/* Notify Type=idle units that we are done now */
|
||||||
|
m->idle_pipe_event_source = sd_event_source_unref(m->idle_pipe_event_source);
|
||||||
|
manager_close_idle_pipe(m);
|
||||||
|
|
||||||
|
/* Turn off confirm spawn now */
|
||||||
|
m->confirm_spawn = false;
|
||||||
|
|
||||||
|
/* No need to update ask password status when we're going non-interactive */
|
||||||
|
manager_close_ask_password(m);
|
||||||
|
|
||||||
|
/* This is no longer the first boot */
|
||||||
|
manager_set_first_boot(m, false);
|
||||||
|
|
||||||
|
if (dual_timestamp_is_set(&m->finish_timestamp))
|
||||||
|
return;
|
||||||
|
|
||||||
|
dual_timestamp_get(&m->finish_timestamp);
|
||||||
|
|
||||||
|
manager_notify_finished(m);
|
||||||
|
|
||||||
|
SET_FOREACH(u, m->startup_units, i)
|
||||||
|
if (u->cgroup_path)
|
||||||
|
cgroup_context_apply(unit_get_cgroup_context(u), unit_get_cgroup_mask(u), u->cgroup_path, manager_state(m));
|
||||||
|
}
|
||||||
|
|
||||||
static int create_generator_dir(Manager *m, char **generator, const char *name) {
|
static int create_generator_dir(Manager *m, char **generator, const char *name) {
|
||||||
char *p;
|
char *p;
|
||||||
int r;
|
int r;
|
||||||
|
|
Loading…
Reference in a new issue