Comment 21 for bug 1760173

Revision history for this message
Stéphane Graber (stgraber) wrote :

That's because an attached process ("lxc-attach" or "lxc exec") isn't a child of init, it's spawned directly by liblxc and so does have our env variable set.

Any process which is a direct or indirect child of PID1 in the container will be inheriting its environment through that path and as init systems strip any inherited environment, the container env variable will not be set for those.

So for example, sshing into your container will not have the env variable set, same goes for any systemd unit.