nspawn: use FOREACH_STRING() more
This commit is contained in:
committed by
Luca Boccassi
parent
7e570d575f
commit
a50966416e
+8
-8
@@ -3513,6 +3513,7 @@ static int inner_child(
|
||||
(void) fdset_close_others(fds);
|
||||
|
||||
if (arg_start_mode == START_BOOT) {
|
||||
const char *init;
|
||||
char **a;
|
||||
size_t m;
|
||||
|
||||
@@ -3523,14 +3524,13 @@ static int inner_child(
|
||||
memcpy_safe(a + 1, arg_parameters, m * sizeof(char*));
|
||||
a[1 + m] = NULL;
|
||||
|
||||
a[0] = (char*) "/usr/lib/systemd/systemd";
|
||||
execve(a[0], a, env_use);
|
||||
|
||||
a[0] = (char*) "/lib/systemd/systemd";
|
||||
execve(a[0], a, env_use);
|
||||
|
||||
a[0] = (char*) "/sbin/init";
|
||||
execve(a[0], a, env_use);
|
||||
FOREACH_STRING(init,
|
||||
"/usr/lib/systemd/systemd",
|
||||
"/lib/systemd/systemd",
|
||||
"/sbin/init") {
|
||||
a[0] = (char*) init;
|
||||
execve(a[0], a, env_use);
|
||||
}
|
||||
|
||||
exec_target = "/usr/lib/systemd/systemd, /lib/systemd/systemd, /sbin/init";
|
||||
} else if (!strv_isempty(arg_parameters)) {
|
||||
|
||||
Reference in New Issue
Block a user