Snap lxd: how to restart lxd without restarting containers?

With unprivileged containers we have sometime to map namespace id’s from host to containers to access mounts (https://github.com/lxc/lxd/blob/master/doc/userns-idmap.md), that means also setting subuid and subgid on lxd, and restart it.

Doing a restart make all containers restart too. Is there a way to prevent this?

So it depends, for the snap you can do systemctl reload snap.lxd.daemon but then again the snap doesn’t actually use /etc/subuid and /etc/subgid so that shouldn’t be needed in the first place.

For the deb, you can normally do systemctl restart lxd which shouldn’t impact running containers.