Snaps failing on an Ubuntu 22.04 ZFS system because of missing systemd unit files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
New
|
Undecided
|
Unassigned |
Bug Description
Snaps started being listed as `broken` after rebooting.
After a lot of trouble, I discovered that the `squashfs` file that contains the snap was failing to be mounted, because the ZFS partition that it was on hadn't finished mounting.
My hypothesis is that snapd `2.58` (installed as a snap) when *combined* with snap `2.57` (as installed by apt in Ubuntu 22.04) fails on ZFS systems because the unit file required that ensures `zfs.mount.service` is read (`snapd.
```
tak# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_
DISTRIB_
DISTRIB_
```
```
tak# snap --version
snap 2.58
snapd 2.58
series 16
ubuntu 22.04
kernel 5.15.0-58-generic
```
```
tak# snap list | grep snapd
snapd 2.58 17950 latest/stable canonical** snapd
```
```
tak# apt-cache policy snapd
snapd:
Installed: 2.57.5+
Candidate: 2.57.5+
Version table:
*** 2.57.5+
500 http://
500 http://
100 /var/lib/
2.55.3+22.04 500
500 http://
```
Ubuntu 22.04 installs `2.57`, but then Snap updates itself with the snap for `2.58`.
In this situation, the `.mount` file generated includes the clause `After=
Unit files with the right configuration *do* exist in `/snap/snapd/` but they're not installed into a directory where systemd will process them:
```
tak# find /snap/snapd/
/snap/snapd/
/snap/snapd/
```
So the fix for my system was to manually copy these files to `/etc/systemd/
I think, if the snap for `snapd` is going to be installed to "upgrade" it, it'll need to put these systemd files in the right place or it'll continue to fail for Ubuntu systems running on ZFS.
description: | updated |
I should note that the fix for my system was actually to manually create unit files called `snapd. mounts- pre.target` and `snapd. mounts. target` and fumble about until I worked out what needed to go in them. I didn't discover the files in `/snap/ snapd/current/ lib/systemd/ system/ ` until later.