Best way to identify LXD server activity (container start, stop, delete, etc)

Greetings all,

As the title says, we are looking for the best way to identify when some activity happens on an LXD server (start, stop, clone, delete). For now, we are using inotify to watch the /var/lib/lxd/common/lxd/logs file for activity. Is there a better way?

Background: We are running multiple, separate LXD servers (not cluster) and are using redis to keep a list of containers per server. We need watch some sort of event that will trigger our “redis rescan” script to keep our redis DB up-to-date.

In the docs:

Have a look at the following on how to figure out whether a newly launched container has finished starting up. That is, when systemd has completed, including when cloud-init has finished its tasks.