Using needrestart 3.6 coming with Ubuntu 24.04 LTS and LXD 5.21.3.
As it fails to detect LXD, it wants to restart a container with "lxc-stop", which obviously fails.
In #26 (Commit e584a67) the detection for LXD was added, but this seems to check for /usr/bin/lxc and /var/lib/lxd/containers/$name, which do not exist here. It should check for /snap/bin/lxc as well, or maybe better search for lxc in $PATH, and /var/snap/lxd/common/lxd/containers/$name.
Since there is incus as well, it should be considered to make this configurable somewhere? Edit: incus seems already been implemented.