sudo taking as much as 25 seconds to execute a simple command. As far as I can make out its the sudo process which is deadlocking rather than the su’ed process.
time sudo cat /etc/sudoers.d/90-cloud-init-users
Created by cloud-init v. 22.1-4.el8 on Tue, 16 Aug 2022 14:15:05 +0000
So now the question is why doesn’t LXD honour the 127.0.1.1 loopback address?. Assumings its not some artefact because I’m running RHEL 8
Some software (e.g., GNOME) expects the system hostname to be resolvable to an IP address with a canonical fully qualified domain name. This is really improper because system hostnames and domain names are two very different things; but there you have it. In order to support that software, it is necessary to ensure that the system hostname can be resolved. Most often this is done by putting a line in /etc/hosts containing some IP address and the system hostname. If your system has a permanent IP address then use that; otherwise use the address 127.0.1.1.
# localhost:
# This option ensures that an entry is present for fqdn as described in
# section 5.1.2 of the debian manual
# http://www.debian.org/doc/manuals/debian-reference/ch05.en.html
#
# cloud-init will generally own the 127.0.1.1 entry, and will update
# it to the hostname and fqdn on every boot. All other entries will
# be left as is. 'ping `hostname`' will ping 127.0.1.1
#
# If you want a fqdn entry with aliases other than 'hostname' to resolve
# to a localhost interface, you'll need to use something other than
# 127.0.1.1. For example:
# 127.0.1.2 myhost.fqdn.example.com myhost whatup.example.com