ubuntu@autopkgtest:~$ apt list snapd
Listing... Done
snapd/bionic-updates 2.33.1+18.04ubuntu2 amd64
N: There is 1 additional version. Please use the '-a' switch to see it
ubuntu@autopkgtest:~$ sudo systemd-run --pty --wait '/bin/echo' '$PATH'
Running as unit: run-u7.service
Press ^] three times within 1s to disconnect TTY.
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Finished with result: success
Main processes terminated with: code=exited/status=0
Service runtime: 13ms
After just upgrading snapd (latest version) and rebooting:
ubuntu@autopkgtest:~$ apt list snapd
Listing... Done
snapd/bionic-updates,now 2.37.1+18.04 amd64 [installed]
ubuntu@autopkgtest:~$ sudo systemd-run --pty --wait '/bin/echo' '$PATH'
Running as unit: run-u7.service
Press ^] three times within 1s to disconnect TTY.
/sbin:/usr/sbin:/bin:/usr/bin:/snap/bin
Finished with result: success
Main processes terminated with: code=exited/status=0
Service runtime: 15ms
So this appears to be real. We added the systemd environment generator (/usr/lib/systemd/system-environment-generators/snapd-env-generator) in 2.35.1 so that seems like a likely culprit. We also ship this in 18.10 where it does not have these ill effects (but there is also a different systemd version used there).
Here is what I see in a clean VM:
ubuntu@ autopkgtest: ~$ apt list snapd updates 2.33.1+18.04ubuntu2 amd64
Listing... Done
snapd/bionic-
N: There is 1 additional version. Please use the '-a' switch to see it
ubuntu@ autopkgtest: ~$ sudo systemd-run --pty --wait '/bin/echo' '$PATH' sbin:/usr/ local/bin: /usr/sbin: /usr/bin: /sbin:/ bin status= 0
Running as unit: run-u7.service
Press ^] three times within 1s to disconnect TTY.
/usr/local/
Finished with result: success
Main processes terminated with: code=exited/
Service runtime: 13ms
After just upgrading snapd (latest version) and rebooting:
ubuntu@ autopkgtest: ~$ apt list snapd updates, now 2.37.1+18.04 amd64 [installed]
Listing... Done
snapd/bionic-
ubuntu@ autopkgtest: ~$ sudo systemd-run --pty --wait '/bin/echo' '$PATH' usr/sbin: /bin:/usr/ bin:/snap/ bin status= 0
Running as unit: run-u7.service
Press ^] three times within 1s to disconnect TTY.
/sbin:/
Finished with result: success
Main processes terminated with: code=exited/
Service runtime: 15ms
So this appears to be real. We added the systemd environment generator (/usr/lib/ systemd/ system- environment- generators/ snapd-env- generator) in 2.35.1 so that seems like a likely culprit. We also ship this in 18.10 where it does not have these ill effects (but there is also a different systemd version used there).