diff options
Diffstat (limited to 'src/core/manager.c')
-rw-r--r-- | src/core/manager.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/core/manager.c b/src/core/manager.c index 9d078c0af7..3dffbe259b 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -2477,7 +2477,7 @@ void manager_check_finished(Manager *m) { m->confirm_spawn = false; /* This is no longer the first boot */ - m->is_first_boot = false; + manager_set_first_boot(m, false); if (dual_timestamp_is_set(&m->finish_timestamp)) return; @@ -2631,7 +2631,6 @@ void manager_run_generators(Manager *m) { _cleanup_closedir_ DIR *d = NULL; const char *generator_path; const char *argv[5]; - const char *env[2]; int r; assert(m); @@ -2665,14 +2664,8 @@ void manager_run_generators(Manager *m) { argv[3] = m->generator_unit_path_late; argv[4] = NULL; - if (m->is_first_boot) { - env[0] = (char*) "SYSTEMD_FIRST_BOOT=1"; - env[1] = NULL; - } else - env[0] = NULL; - RUN_WITH_UMASK(0022) - execute_directory(generator_path, d, DEFAULT_TIMEOUT_USEC, (char**) argv, (char**) env); + execute_directory(generator_path, d, DEFAULT_TIMEOUT_USEC, (char**) argv); finish: trim_generator_dir(m, &m->generator_unit_path); @@ -2816,6 +2809,20 @@ static bool manager_get_show_status(Manager *m) { return plymouth_running(); } +void manager_set_first_boot(Manager *m, bool b) { + assert(m); + + if (m->running_as != SYSTEMD_SYSTEM) + return; + + m->first_boot = b; + + if (m->first_boot) + touch("/run/systemd/first-boot"); + else + unlink("/run/systemd/first-boot"); +} + void manager_status_printf(Manager *m, bool ephemeral, const char *status, const char *format, ...) { va_list ap; |