Systemd by default executes things, with execv, not execve. Hence the default environment is not available. However, cloud-init generator is executed by /bin/sh which does that a built-in default path
$ lxc launch images:opensuse/15.0 test-sh-built-in-path
$ lxc exec test-sh-built-in-path -- env -u PATH /bin/sh -c 'echo $PATH' /usr/local/bin:/usr/bin:/bin:.
On ubuntu, it is instead:
$ env -u PATH /bin/dash -c 'echo $PATH' /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
$ env -u PATH /bin/bash -c 'echo $PATH' /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:.
Maybe you want to report a bug against Suse's default /bin/sh about this....
Also /bin/dash and /bin/bash differences are akward....
Systemd by default executes things, with execv, not execve. Hence the default environment is not available. However, cloud-init generator is executed by /bin/sh which does that a built-in default path
$ lxc launch images: opensuse/ 15.0 test-sh- built-in- path
$ lxc exec test-sh- built-in- path -- env -u PATH /bin/sh -c 'echo $PATH' bin:/usr/ bin:/bin: .
/usr/local/
On ubuntu, it is instead:
$ env -u PATH /bin/dash -c 'echo $PATH' sbin:/usr/ local/bin: /usr/sbin: /usr/bin: /sbin:/ bin
/usr/local/
$ env -u PATH /bin/bash -c 'echo $PATH' bin:/usr/ local/sbin: /usr/bin: /usr/sbin: /bin:/sbin: .
/usr/local/
Maybe you want to report a bug against Suse's default /bin/sh about this....
Also /bin/dash and /bin/bash differences are akward....