Bionic host reboot 10min

Snap lxd 4 on fresh bionic bare metal host.

The only thing running during that time is

$ systemctl list-jobs
468 snap.lxd.daemon.service            stop  running

It doesn’t matter if i manually lxd stop all containers prior to shutdown now -r or reboot command.

Modified /etc/systemd/system.conf but this did not help either, still 10min.

[Manager]
ShutdownWatchdogSec=1min
DefaultTimeoutStopSec=20s

think it might relate to this one https://github.com/lxc/lxd-pkg-snap/issues/39

This is the report. Note the link to Launchpad for the snapd report where the fix is taking place.
If I understand correctly, it relates to LXD VMs, so if you have a LXD VM running and shutdown the computer, then it takes 10 minutes to shutdown the host. If that is the case, then a workaround for now is to lxc stop vm1 before shutting shown.

Currently, Ubuntu 18.04 LTS has 2.42.1+18.04. The fix will likely make it into snapd 2.44.3.

As i wrote, it does not matter in my case if containers or VM are running. Tested with all off and just containers on and VM off. Waiting on a shutdown as we speak but i did

snap set lxd daemon.debug=true
systemctl reload snap.lxd.daemon

And will check the /var/snap/lxd/common/lxd/logs once i am back up.

No idea how this releases work, yes i am on 2.44.1 now, looks like 2.44.2 is next, wondering how long the release of the fix will take.
Do you think its wise and know a way or can point me to the direction so that i can manually upgrade to snapd to 2.44.3?

If your host is running Ubuntu 18.04 LTS, then you should have 2.42.1+18.04. You verify with apt policy snapd. But you mention 2.44.1; can you double-check?

You can also cross-reference that with https://launchpad.net/snapd/+packages

You can find the latest deb package of snapd for a certain distribution at https://packages.ubuntu.com/disco-updates/snapd (for Ubuntu 18.04 LTS).

On Ubuntu 20.04 I currently have 2.44.2+20.04, and the above URL says that I should be getting 2.44.3+20.04 really really soon. I can verify that the new package is almost there, because I can see it at http://mirrors.edge.kernel.org/ubuntu/pool/main/s/snapd/ I got that link after clicking to download the deb package at https://packages.ubuntu.com/disco-updates/snapd

I do not think it is wise to use the Ubuntu 20.04 snapd package on Ubuntu 18.04. I haven’t tried to test such a thing.

If you first sudo systemctl stop snap.lxd.daemon, does the reboot still takes 10 minutes?

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION=“Ubuntu 18.04.4 LTS”

$ snap --version
snap    2.44.1
snapd   2.44.1
series  16
ubuntu  18.04
kernel  4.15.0-96-generic

Nah, was rather thinking of a ppa or a way to apply the diff and compile the whole thing, guess i wait since i never done this.

Thanks, that worked! I had shutdown all container/vm first.