I have set up a avahi
daemon to publish my service on a RPi, and have successfully found the service on a different PC using an mDNS client library. The mDNS library (javascript) has event callbacks for the service being "up" or "down". The service is specified by a .conf in /etc/avahi/services/
.
When the RPi is shutdown, I would like the PC side client to know, is there a way to have the avahi
daemon (running on the RPi) to broadcast the service going "down"?
My thinking is that the avahi
daemon (presumably) gets an OS signal that the RPi is shutting down, so would it make sense for the daemon to update the mDNS clients that the service is going down? I don't see any documentation to support this, so I guess this is not reasonable.
Maybe the way forward is for my application to broadcast the service is going down. I have not investigated my application creating an mDNS publishing service because I was using the avahi
daemon to do the publishing. But as I write this, it seems this is the way forward I should try.