nspawn: flush out environment block of the -a stub init process

The container detection code in virt.c we ship checks for /proc/1/environ,
looking for "container=" in it. Let's make sure our "-a" init stub exposes that
correctly.

Without this "systemd-detect-virt" run in a "-a" container won't detect that it
is being run in a container.
This commit is contained in:
Lennart Poettering
2016-12-14 18:29:30 +01:00
parent 8d6e80343a
commit 75bf701f5c
3 changed files with 32 additions and 3 deletions
+1 -1
View File
@@ -2278,7 +2278,7 @@ static int inner_child(
return log_error_errno(errno, "Failed to change to specified working directory %s: %m", arg_chdir);
if (arg_start_mode == START_PID2) {
r = stub_pid1();
r = stub_pid1(arg_uuid);
if (r < 0)
return r;
}