If snapd is not working it can take down systemd

Bug #1792644 reported by Henry Wertz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
New
Undecided
Unassigned

Bug Description

I'll start out with saying, this bug is probably priority "invalid" due to my non-stock configuration (this 18.04.1 install is on an Acer Chromebook 13, so it has a held back kernel and Xorg for the lovely nvidia drivers it came with.) But I figure I'll file anyway since the problem is rather serious if it arises on your particular system, and the workaround/fix is easy once you figure out what the heck is happening.

So, snapd has errored out since I updated to 18.04 due to my held back kernel (snap packages are using xz compression, and this kernel has no xz support...) I found within the last day or so that my machine would not boot to graphical environment, just to text login with no networking up and several missing services (ntp and a few others.) journalctl -xe showed failures due to "file not found" on files like tr, cut, modprobe, cat, that should definitely be found. PATH problems! Ultimately, I found /usr/lib/systemd/system-environment-generators/snapd-env-generator (which appears -- not sure since it's a binary instead of a shell script -- to be intended to just add "/snap/bin" to the PATH.) I moved this out of the folder, on reboot everything worked fine. Then I went ahead and uninstalled snapd.

I suspect systemd is "too smart for it's own good", and instead of providing it's own environment variables then letting items in /usr/lib/systemd/system-environment-generators/ modify the environment (as docs say), instead systemd either decided "snapd-env-generator" is setting a PATH so systemd doesn't have to (resulting in PATH of ":/snap/bin") or systemd "rolled back" that PATH when snapd service failed, resetting PATH to empty instead of the default PATH value.

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

yeah, there is/was a bug in both systemd and snapd w.r.t. injecting :/snap/bin. I believe it is fixed in cosmic already, and bionic should be fixed soon too. I will mark this report as a duplicate.

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

Other bug subscribers

Remote bug watches

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