Two snap-lxd-mount daemons running

Hello,

I came across the following error while starting a stopped LXD container:

cannot mount ‘syspool/lxd/containers/ag-zep-1’: filesystem already mounted

I try to apply this solution without any luck.

I can find the mount:

root@n6:~# nsenter --mount=/run/snapd/ns/lxd.mnt grep ag-zep-1 /proc/self/mountinfo
4796 4960 0:410 / /var/snap/lxd/common/shmounts/storage-pools/system/containers/ag-zep-1 rw shared:395 - zfs syspool/lxd/containers/ag-zep-1 rw,xattr,posixacl

But the stat tells me the path does not exist:

root@n6:~# nsenter --mount=/run/snapd/ns/lxd.mnt stat -f /var/snap/lxd/common/shmounts/storage-pools/system/containers/ag-zep-1
stat: cannot read file system information for ‘/var/snap/lxd/common/shmounts/storage-pools/system/containers/ag-zep-1’: No such file or directory

I tried to find the daemon responsible for these mounts and this is where i found out the daemon from the previous snap release (I scheduled the refresh once a week) was still running so there are two of them:

root@n6:~# systemctl status snap-lxd-*
● snap-lxd-16100.mount - Mount unit for lxd, revision 16100
Loaded: loaded (/etc/systemd/system/snap-lxd-16100.mount; enabled; vendor preset: enabled)
Active: active (mounted) since Wed 2020-07-15 19:03:22 UTC; 5 days ago
Where: /snap/lxd/16100
What: /dev/loop28
Tasks: 0 (limit: 8601)
Memory: 428.0K
CGroup: /system.slice/snap-lxd-16100.mount

Jul 15 19:03:22 n6 systemd[1]: Mounting Mount unit for lxd, revision 16100…
Jul 15 19:03:22 n6 systemd[1]: Mounted Mount unit for lxd, revision 16100.

● snap-lxd-16044.mount - Mount unit for lxd, revision 16044
Loaded: loaded (/etc/systemd/system/snap-lxd-16044.mount; enabled; vendor preset: enabled)
Active: active (mounted) since Wed 2020-07-08 19:02:39 UTC; 1 weeks 5 days ago
Where: /snap/lxd/16044
What: /dev/loop26
Tasks: 0 (limit: 8601)
Memory: 420.0K
CGroup: /system.slice/snap-lxd-16044.mount

Jul 08 19:02:39 n6 systemd[1]: Mounting Mount unit for lxd, revision 16044…
Jul 08 19:02:39 n6 systemd[1]: Mounted Mount unit for lxd, revision 16044.

Can I safely stop the daemon from the previous release? Could it be that it’s this one that still holds the zfs mount?

Thanks for your help