summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/execute.c2
-rw-r--r--src/core/main.c1
-rw-r--r--src/core/manager.c12
-rw-r--r--src/core/manager.h1
-rw-r--r--src/core/shutdown.c2
5 files changed, 15 insertions, 3 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index 88d094e8cc..6e76bd5b50 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -571,7 +571,7 @@ static int ask_for_confirmation(char *response, char **argv) {
if (!line)
return -ENOMEM;
- r = ask(response, "yns", "Execute %s? [Yes, No, Skip] ", line);
+ r = ask_char(response, "yns", "Execute %s? [Yes, No, Skip] ", line);
restore_confirm_stdio(&saved_stdin, &saved_stdout);
diff --git a/src/core/main.c b/src/core/main.c
index a732c6945a..e1fc3f3718 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1648,6 +1648,7 @@ int main(int argc, char *argv[]) {
m->initrd_timestamp = initrd_timestamp;
m->security_start_timestamp = security_start_timestamp;
m->security_finish_timestamp = security_finish_timestamp;
+ m->is_first_boot = empty_etc;
manager_set_default_rlimits(m, arg_default_rlimit);
manager_environment_add(m, NULL, arg_default_environment);
diff --git a/src/core/manager.c b/src/core/manager.c
index 0cb2044325..9d078c0af7 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -2476,6 +2476,9 @@ void manager_check_finished(Manager *m) {
/* Turn off confirm spawn now */
m->confirm_spawn = false;
+ /* This is no longer the first boot */
+ m->is_first_boot = false;
+
if (dual_timestamp_is_set(&m->finish_timestamp))
return;
@@ -2628,6 +2631,7 @@ 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);
@@ -2661,8 +2665,14 @@ 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);
+ execute_directory(generator_path, d, DEFAULT_TIMEOUT_USEC, (char**) argv, (char**) env);
finish:
trim_generator_dir(m, &m->generator_unit_path);
diff --git a/src/core/manager.h b/src/core/manager.h
index f2c1b0d227..eff639d1b6 100644
--- a/src/core/manager.h
+++ b/src/core/manager.h
@@ -243,6 +243,7 @@ struct Manager {
bool default_cpu_accounting;
bool default_memory_accounting;
bool default_blockio_accounting;
+ bool is_first_boot;
usec_t default_timer_accuracy_usec;
diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index fde3ce9c27..e7771c968e 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -375,7 +375,7 @@ int main(int argc, char *argv[]) {
arguments[0] = NULL;
arguments[1] = arg_verb;
arguments[2] = NULL;
- execute_directory(SYSTEM_SHUTDOWN_PATH, NULL, DEFAULT_TIMEOUT_USEC, arguments);
+ execute_directory(SYSTEM_SHUTDOWN_PATH, NULL, DEFAULT_TIMEOUT_USEC, arguments, NULL);
if (!in_container && !in_initrd() &&
access("/run/initramfs/shutdown", X_OK) == 0) {