/snap/bin not in default PATH for units, snapd should ship system-environment-generators to inject /snap/bin into $PATH

Bug #1771858 reported by Dan Watkins
36
This bug affects 5 people
Affects Status Importance Assigned to Milestone
snapd (Ubuntu)
Fix Released
Critical
Michael Vogt
Xenial
Won't Fix
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned
Cosmic
Fix Released
Critical
Michael Vogt
systemd (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned
Cosmic
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

 * This means that software installed via snap isn't transparently available for units to use. As snaps are first-class citizens in Ubuntu, we should update the PATH.

 * When a generator started to be provided by systemd, it was recognized that $PATH is not correctly set, nonetheless, due to an environment bug that systemd generators run in.

[Testcase]

# make snapd-env-generator executable if it is not
$ sudo chmod +x /usr/lib/systemd/system-environment-generators/snapd-env-generator

# reboot, then test the effect of the fix
$ systemd-run /usr/bin/env
$ journalctl -e | grep PATH

Output should contain /snap/bin

Output should contain a complete and a valid PATH, i.e.
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin" or similar.

[Regression Potential]

 * snapd generator was already fixed separately to cause no harm, when running under a broken systemd. With the corrected environment, generators will now run with a correct PATH out of the box. A slight change of PATH will be observed by all generators, when running in containers/initramfs-less boots. However most generators will not be affected as they typically do not execute external binaries.

Related branches

description: updated
description: updated
Changed in systemd (Ubuntu Cosmic):
status: New → Won't Fix
Changed in systemd (Ubuntu Bionic):
status: New → Won't Fix
Changed in systemd (Ubuntu Xenial):
status: New → Confirmed
description: updated
summary: - /snap/bin not in default PATH for units
+ /snap/bin not in default PATH for units, snapd should ship system-
+ environment-generators to inject /snap/bin into $PATH
description: updated
Revision history for this message
Oliver Grawert (ogra) wrote :

snapd ships a snippet in /etc/profile.d that sets the PATH to /snap/bin and should theoretically work for all login shells (except for zsh which doesn't respect the profile.d standard) ... bug 1640514 and bug 1659719 are related.

Revision history for this message
Oliver Grawert (ogra) wrote :

i meant to say above is that it would be nice to find a way that covers all use-cases with one code path (sorry, just noticed what i wrote wasnt clear in that regard)

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

/etc/profile.d is for the login shells.

the bug is about the environment of systemd units as started by systemd. That environment is not created / does not parse /etc/profile.d

this new integration is to fix the environment as seen by binaries spawned by systemd (e.g. cloud-init). Specifically see my example $ systemd-run /usr/bin/env

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

re:single code path

we do have a lot of duplication. I think profile.d is actually good enough for all the logged in users. However, for now, the /usr/lib/systemd/system-environment-generators is a special place to integrate and ensure that environment that systemd creates for units has everything setup correctly.

Revision history for this message
Oliver Grawert (ogra) wrote :

well, my subtle hint would point to simply add it to /etc/environment here, which would globally cover for everything, would allow us to drop the profile.d snippet in ubuntu images/installs and to my knowledge would even be used by systemd (or am i wrong here ?) ...

(and i think it would even work for zsh)

Revision history for this message
Dimitri John Ledkov (xnox) wrote : Re: [Bug 1771858] Re: /snap/bin not in default PATH for units, snapd should ship system-environment-generators to inject /snap/bin into $PATH

On 18 May 2018 at 19:01, Oliver Grawert <email address hidden> wrote:
> well, my subtle hint would point to simply add it to /etc/environment
> here, which would globally cover for everything, would allow us to drop
> the profile.d snippet in ubuntu images/installs and to my knowledge
> would even be used by systemd (or am i wrong here ?) ...
>
> (and i think it would even work for zsh)
>

Sorry, I do not have time for subtle hints.

As you are well aware, snapd cannot modify /etc/environment; (not
owned by it, it is freeform text, can contain anything, may or may not
have PATH setting, not-upgradable, so on and so forth)
said file is not used by systemd;
it would not cover things globally;
and specifically it would not cover things across other distributions.

There are reasons why integration snippet was shipped by snapd in
profile.d, and all of those reasons still stand.

And more-over the ethos for snapd packaging is to integrate into as
many systems as possible, in a native way.
Shipping appropriate system-environment-generators will achieve that
not only on Ubuntu classic installs but on any systemd-based Linux
distros too, which my understanding is the scope for the snapd
project.

--
Regards,

Dimitri.

Revision history for this message
Seth Arnold (seth-arnold) wrote :

On Fri, May 18, 2018 at 06:01:19PM -0000, Oliver Grawert wrote:
> well, my subtle hint would point to simply add it to /etc/environment
> here, which would globally cover for everything, would allow us to drop

Note that /etc/environment is only used by PAM-aware services that have
been configured to use pam_env in the corresponding /etc/pam.d/ files.

systemd will not use PAM when launching services.

This might still match your idea of "everything" but I wanted to make sure.

Thanks

Revision history for this message
Michael Vogt (mvo) wrote :

https://github.com/snapcore/snapd/pull/5226 <- contians a PR for this now.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in snapd (Ubuntu Bionic):
status: New → Confirmed
Changed in snapd (Ubuntu Xenial):
status: New → Confirmed
Changed in snapd (Ubuntu):
status: New → Confirmed
Changed in systemd (Ubuntu):
status: New → Confirmed
Revision history for this message
Robert C Jennings (rcj) wrote :

I'll mention this here because I believe it's related, if not please correct me and I'll file a separate bug. When cron jobs are run /snap/bin is not in the path.

Revision history for this message
Robie Basak (racb) wrote :

A related issue is that "ssh <host-with-snaps> <snap-command>" currently fails because /snap/bin isn't in PATH. In that case, sshd sets PATH via pam_env. I'm not sure if a systemd environment generator will help with this use case or not.

Revision history for this message
Robie Basak (racb) wrote :

I filed bug 1777445 for the non-interactive ssh case.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

still not fixed in snapd.

Changed in snapd (Ubuntu Cosmic):
importance: Undecided → Critical
assignee: nobody → Michael Vogt (mvo)
Revision history for this message
Michael Vogt (mvo) wrote :
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Using this bug to fix systemd exported environment to the generators.

Changed in systemd (Ubuntu Cosmic):
status: Won't Fix → Fix Committed
Changed in systemd (Ubuntu Bionic):
status: Won't Fix → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 239-7ubuntu9

---------------
systemd (239-7ubuntu9) cosmic; urgency=medium

  * core: export environment when running generators.
    Ensure that manager's environment (including e.g. PATH) is exported when
    running generators. Otherwise, one is at a mercy of running without PATH which
    can lead to buggy generator behaviour. (LP: #1771858)

 -- Dimitri John Ledkov <email address hidden> Wed, 26 Sep 2018 11:01:58 +0100

Changed in systemd (Ubuntu Cosmic):
status: Fix Committed → Fix Released
Changed in systemd (Ubuntu Bionic):
status: Confirmed → In Progress
description: updated
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Dan, or anyone else affected,

Accepted systemd into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/237-3ubuntu10.8 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in systemd (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Dan, or anyone else affected,

Accepted systemd into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/237-3ubuntu10.10 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Using systemd 237-3ubuntu10.10, executing the test case i see /snap/bin in path

ubuntu@ubuntu:~$ dpkg-query -W systemd
systemd 237-3ubuntu10.10
ubuntu@ubuntu:~$ sudo systemd-run /usr/bin/env
[sudo] password for ubuntu:
Running as unit: run-rc05da62ca3b445e4b3259a6a17063a61.service
ubuntu@ubuntu:~$ journalctl -e | grep PATH
Dec 04 12:19:11 ubuntu env[1671]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Jon Wedaman (jweede) wrote :

Just noticed what might be a regression from this fix. `/usr/local/sbin:/usr/local/bin` are now missing from unit on newest ubuntu bionic ami (us-east-1: ami-012fd5eb46f56731f)

ubuntu@ubuntu:~$ dpkg-query -W systemd
systemd 237-3ubuntu10.11
ubuntu@ubuntu:~$ sudo systemd-run /usr/bin/env
Running as unit: run-r6c6668bf9774455dbb628d2d79de5949.service
ubuntu@ubuntu:~$ journalctl -e | grep PATH=
Feb 01 20:46:24 ubuntu env[6051]: PATH=/sbin:/usr/sbin:/bin:/usr/bin:/snap/bin

The prior ami (us-east-1: ami-0b86cfbff176b7d3a) doesn't have this issue. So I checked for differences. I noticed that if I remove `/usr/lib/systemd/system-environment-generators/snapd-env-generator` and reboot then I get better output:

ubuntu@ubuntu:~$ sudo systemd-run /usr/bin/env
Running as unit: run-r6c6668bf9774455dbb628d2d79de5949.service
ubuntu@ubuntu:~$ journalctl -e | grep PATH=
Feb 01 20:51:44 ubuntu env[3337]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

@jweede

Hm. And is the instance booted with or without initramfs?

Revision history for this message
Jon Wedaman (jweede) wrote :

@xnox

The grub config makes me believe the aws image is booted with initramfs.

Thanks for responding, I wasn't sure if this was the right spot to report this bug.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

FYI, this bug is marked Fix Committed against systemd for bionic, but there is currently nothing in bionic-proposed.

tags: added: id-5d0bec28939a024305398e2a
Balint Reczey (rbalint)
description: updated
description: updated
Revision history for this message
Balint Reczey (rbalint) wrote :

@mvo /usr/lib/systemd/system-environment-generators/snapd-env-generator is working in Bosmic and up, but in Bionic it is not executable.
Could this please be fixed?

Changed in snapd (Ubuntu Cosmic):
status: Confirmed → Fix Released
Balint Reczey (rbalint)
description: updated
description: updated
Revision history for this message
Balint Reczey (rbalint) wrote :

@jweede I uploaded the SRU fix again for Bionic and tried to reproduce the regression you observed but it works for me:

ubuntu@ip-172-31-47-218:~$ uname -a
Linux ip-172-31-47-218 4.15.0-1041-aws #43-Ubuntu SMP Thu Jun 6 13:39:11 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
ubuntu@ip-172-31-47-218:~$ sudo chmod +x /usr/lib/systemd/system-environment-generators/snapd-env-generator

... reboot ---
ubuntu@ip-172-31-47-218:~$ sudo systemd-run /usr/bin/env
Running as unit: run-rdad5335f105948a3935b9c5a6773e793.service
ubuntu@ip-172-31-47-218:~$ journalctl -e | grep PATH=
Jun 25 14:11:20 ip-172-31-47-218 env[1200]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

Maybe it was a temporary issue with snapd's environment generator.

Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Dan, or anyone else affected,

Accepted systemd into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/237-3ubuntu10.24 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed verification-needed-bionic
removed: verification-done verification-done-bionic
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Autopkgtest regression report (systemd/237-3ubuntu10.24)

All autopkgtests for the newly accepted systemd (237-3ubuntu10.24) for bionic have finished running.
There have been regressions in tests triggered by the package. Please visit the sru report page and investigate the failures.

https://people.canonical.com/~ubuntu-archive/pending-sru.html#bionic

Revision history for this message
Balint Reczey (rbalint) wrote :

Verified 237-3ubuntu10.24 on Bionic:

root@bb:~# systemd-run /usr/bin/env
Running as unit: run-r14e6d7c0430841c59697a5c84ded2a88.service
root@bb:~# dpkg -l systemd | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-================-============-=================================
ii systemd 237-3ubuntu10.23 amd64 system and service manager
root@bb:~# systemd-run /usr/bin/env
Running as unit: run-r512450e1e4134a86bc6c65eb4b68d9c3.service
root@bb:~# journalctl -e | grep PATH
Jun 26 06:54:12 bb env[2830]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Jun 26 06:54:38 bb env[2835]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
root@bb:~# sed -i 's/-backports/-proposed/' /etc/apt/sources.list
root@bb:~# apt update -qq
16 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@bb:~# apt install -y -qq systemd
...
root@bb:~# ls -alh /usr/lib/systemd/system-environment-generators/snapd-env-generator
-rw-r--r-- 1 root root 44K Jun 5 06:41 /usr/lib/systemd/system-environment-generators/snapd-env-generator
root@bb:~# chmod +x /usr/lib/systemd/system-environment-generators/snapd-env-generator
root@bb:~# reboot

Session terminated, terminating shell...rbalint@yogi:~$ lxc shell bb
mesg: ttyname failed: No such device
root@bb:~# dpkg -l systemd | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-================-============-=================================
ii systemd 237-3ubuntu10.24 amd64 system and service manager
root@bb:~# journalctl -e | grep PATH
Jun 26 06:54:12 bb env[2830]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Jun 26 06:54:38 bb env[2835]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
root@bb:~# systemd-run /usr/bin/env
Running as unit: run-r5a67017348664e9face4a9f084dfcde7.service
root@bb:~# journalctl -e | grep PATH
Jun 26 06:54:12 bb env[2830]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Jun 26 06:54:38 bb env[2835]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Jun 26 06:59:20 bb env[311]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

tags: added: verification-done-bionic
removed: verification-needed-bionic
Revision history for this message
Balint Reczey (rbalint) wrote :

The autopkgtest failures seem to be unrelated. I re-triggered flaky tests and I'm updating the hints where needed.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

We have codepaths with and without initrd, which results in different environment that systemd starts up with.

In bionic, initramfs-tools sets PATH to PATH=/sbin:/usr/sbin:/bin:/usr/bin

In later releases, initramfs-tools sets PATH to
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

And systemd can come up without initrd (lxd) in which case PATH is not set at all, and internally systemd uses the built-in compiled PATH.

The snapd environment generator has been fixed to handle the case of empty or unset PATH. But it only appends the snapd path, meaning that it doesn't inject /usr/local into the PATH.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

In effect, I'm saying that we need to (a) fix systemd as per this bug report (b) fix initramfs-tools (c) only then enable snapd env generator

Revision history for this message
Balint Reczey (rbalint) wrote :

The snapd and systemd fixes triggered LP: #1814355 together and I'm now investigating if the initiramfs fix for that 'regression' should be backported to Bionic, too. In that case I'll add a new Breaks: to the systemd upload.

Revision history for this message
Balint Reczey (rbalint) wrote :

@xnox we were investigating this in parallel :-)

Revision history for this message
Balint Reczey (rbalint) wrote :

The added Breaks: will ensure that the fixes are applied together.

Revision history for this message
Michael Vogt (mvo) wrote :

When we disabled the generator in snapd we added a regression test (tests/main/snap-system-env):
https://github.com/snapcore/snapd/pull/6470/files

With the current systemd (not the one in -proposed) I get:
```
grep error: pattern not found, got:
LANG=C.UTF-8
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/snap/bin
```
which is expected and shows that the generator is broken.

When running the same regression test with the systemd in -proposed I get no error so the update looks fine (as far as our test case goes). I heard some concerns from xnox about systems with initrd that need to be explored too.

Revision history for this message
Michael Vogt (mvo) wrote :

The PR to re-enable the generator: https://github.com/snapcore/snapd/pull/7031 and updates the test.

Revision history for this message
Balint Reczey (rbalint) wrote :

@mvo thanks for the test! Nor @xnox or I could reproduce the problem of missing /usr/local/bin and /usr/local/sbin when booting with initramfs.
I tried even downgrading snapd to 2.37.1+18.04 and systemd to 237-3ubuntu10.10 with no luck.
I seems it is safe to go ahead with the snapd fix, too.

Revision history for this message
Balint Reczey (rbalint) wrote :

@mvo @xnox ok, so if I run unfixed systemd and fixed snapd and unfixed initramfs-tools /usr/local/... patch are missing when booting with initramfs:

ubuntu@ubuntu-Standard-PC-i440FX-PIIX-1996:~$ sudo systemd-run --pty --wait /usr/bin/env | grep PATH
Running as unit: run-u69.service
Press ^] three times within 1s to disconnect TTY.
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/snap/bin
Finished with result: success
Main processes terminated with: code=exited/status=0
Service runtime: 8ms
ubuntu@ubuntu-Standard-PC-i440FX-PIIX-1996:~$ dpkg -l systemd
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-======================-================-================-==================================================
ii systemd 237-3ubuntu10.23 amd64 system and service manager
ubuntu@ubuntu-Standard-PC-i440FX-PIIX-1996:~$ dpkg -l snapd
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-======================-================-================-==================================================
ii snapd 2.37.1+18.04 amd64 Daemon and tooling that enable snap packages

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Dan, or anyone else affected,

Accepted systemd into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/229-4ubuntu21.22 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in systemd (Ubuntu Xenial):
status: Confirmed → Fix Committed
tags: added: verification-needed-xenial
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Autopkgtest regression report (systemd/229-4ubuntu21.22)

All autopkgtests for the newly accepted systemd (229-4ubuntu21.22) for xenial have finished running.
There have been regressions in tests triggered by the package. Please visit the sru report page and investigate the failures.

https://people.canonical.com/~ubuntu-archive/pending-sru.html#xenial

Revision history for this message
Dan Streetman (ddstreet) wrote :

re: autopkgtests, a few failed, but I re-ran them and they passed on the re-run.

Revision history for this message
Balint Reczey (rbalint) wrote :

Tested 229-4ubuntu21.22 on Xenial:

ubuntu@ubuntu-Standard-PC-i440FX-PIIX-1996:~$ sudo systemd-run /usr/bin/env
[sudo] password for ubuntu:
Running as unit run-r22d04a00a8304e2da719773bb14b6fb4.service.
ubuntu@ubuntu-Standard-PC-i440FX-PIIX-1996:~$ journalctl -a | grep PATH
Jul 02 14:31:04 ubuntu-Standard-PC-i440FX-PIIX-1996 env[2093]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
ubuntu@ubuntu-Standard-PC-i440FX-PIIX-1996:~$ dpkg -l systemd
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=======================-================-================-===================================================
ii systemd 229-4ubuntu21.22 amd64 system and service manager
ubuntu@ubuntu-Standard-PC-i440FX-PIIX-1996:~$ dmesg | grep initr
[ 0.243635] Unpacking initramfs...
[ 0.891349] Freeing initrd memory: 54320K

The fix for Xenial does not depend on snapd's environment generator, just hardcodes including /snap/bin in the PATH.

Changed in snapd (Ubuntu Xenial):
status: Confirmed → Invalid
Balint Reczey (rbalint)
tags: added: verification-done verification-done-xenial
removed: verification-needed verification-needed-xenial
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 237-3ubuntu10.24

---------------
systemd (237-3ubuntu10.24) bionic; urgency=medium

  [Dimitri John Ledkov 🌈]
  * core: export environment when running generators.
    Ensure that manager's environment (including e.g. PATH) is exported when
    running generators. Otherwise, one is at a mercy of running without PATH which
    can lead to buggy generator behaviour. (LP: #1771858)

 -- Balint Reczey <email address hidden> Mon, 24 Jun 2019 14:50:38 +0200

Changed in systemd (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for systemd has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 229-4ubuntu21.22

---------------
systemd (229-4ubuntu21.22) xenial; urgency=medium

  [ Dan Streetman ]
  * d/t/systemd-fsckd, d/t/cmdline-upstart-boot:
    - skip on s390x; requires grub (LP: #1830477)
  * d/p/ask-password-prevent-buffer-overrow-when-reading-fro.patch:
    - prevent buffer overflow when reading keyring (LP: #1814373)

  [ Dimitri John Ledkov ]
  * Specify Ubuntu's Vcs-Git

  [ Balint Reczey ]
  * Append /snap/bin to default PATH.
    Snapd ships snapd-env-generator, but systemd does not not support
    environment generators. Hard-coding /snap/bin is less risky than
    backporting environment generator support and since snaps are considered
    to be first class packages on Ubuntu /snap/bin can safely added to
    the default PATH. (LP: #1771858)

  [ Ioanna Alifieraki ]
  * d/p/systemctl-Replace-check_one_unit-by-get_state_one_un.patch
    - Backport upstream PR#2768 needed for next patch
  * d/p/systemctl-load-unit-if-needed-in-systemctl-is-active.patch
    - Backport upstream PR#7997 to fix alias service reports inactive while
      aliased is active (LP: #1828892)

 -- Dan Streetman <email address hidden> Wed, 24 Apr 2019 17:15:36 -0400

Changed in systemd (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Installed snapd from proposed, rebooted, and /snap/bin is now in path of systemd-run unit

Nov 18 18:25:26 well-monkey env[298]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

# dpkg-query -W snapd
snapd 2.42.1+18.04

Prior to reboot it was not in PATH of a systemd-run unit.

tags: added: verification-needed-bionic
removed: verification-done-bionic
tags: added: verification-done-bionic
removed: verification-needed-bionic
Changed in snapd (Ubuntu Bionic):
status: Confirmed → Fix Committed
Changed in snapd (Ubuntu):
status: Confirmed → Fix Released
Mathew Hodson (mhodson)
Changed in snapd (Ubuntu Xenial):
status: Invalid → Won't Fix
Changed in snapd (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Brandon (bdever) wrote :

This has NOT been fixed in Bionic. or it came back. My cron script that uses a program in /snap/bin can not be found I have to create a sym link to /usr/bin

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.