homebridge: hb-service listening on port 5353 which conflicts with avahi daemon

Current Situation

I currently have homebridge running on a raspberry pi 4, historically the “.local” address for homebridge has not been consistent, presumably due to mDNS. To resolve this issue, I have been using Ciao for mDNS and disabled Avahi. When Homebridge 1.4.0 came out, I switched back to Avahi since Homebridge now supported it.

Unfortunately the issue with homebridge’s “.local” not being accessible has comeback. I started debugging this, the first thing I did was look at Avahi’s log (by running sudo systemctl status avahi-daemon.service), which included the following sentence: *** WARNING: Detected another IPv4 mDNS stack running on this host. This makes mDNS unreliable and is thus not recommended. ***

Note that this is not always seen in the log since it depends on the order in which the various services listening on port 5353 are started, so after a “clean” restart this usually would not be visible but rather only upon restarting the avahi daemon.

I then proceeded to check which processes were listening on port 5353 (mDNS) and surprisingly discovered that there were 3:

  1. avahi-daemon
  2. chromium-browser
  3. hb-service

I first disabled chromium-browser listening on this port by creating a policy file which disabled Chromium’s media browser, this is done by creating a file named “disable_mediarouter.json” at “/etc/chromium-browser/policies/managed” which contains the following JSON: { “EnableMediaRouter”: false }

I then restarted the server and was indeed happy to discover that Chromium was no longer listening on port 5353. Unfortunately, the warning message still persists because hb-service is still listening on port 5353 in parallel to Avahi. I suspect the problem will persist as well, though I can’t be sure for the time being. If not, then this can just be ignored obviously.

My question is why is hb-service listening on this port given it should be using Avahi as set in the configuration? is there a way to disable it from listening on this port? is this even a problem?

Thanks in advance

Logs

● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
   Loaded: loaded (/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2022-01-25 18:05:48 IST; 2s ago
 Main PID: 3579 (avahi-daemon)
   Status: "avahi-daemon 0.7 starting up."
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/avahi-daemon.service
           ├─3579 avahi-daemon: running [homebridge.local]
           └─3580 avahi-daemon: chroot helper

Jan 25 18:05:48 homebridge avahi-daemon[3579]: *** WARNING: Detected another IPv4 mDNS stack running on this host. This makes mDNS unreliable and is thus not recommended. ***

pi@homebridge:~ $ sudo lsof -i:5353
COMMAND    PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
hb-servic  882    pi   19u  IPv4  20089      0t0  UDP *:mdns 
avahi-dae 3579 avahi   12u  IPv4  40351      0t0  UDP *:mdns 
avahi-dae 3579 avahi   13u  IPv6  40352      0t0  UDP *:mdns

Configuration

N/A

Environment

  • OS: Rasperry Pi OS
  • Software: Homebridge 1.4.0
  • Node: v16.13.1
  • npm: 8.3.0

Process Supervisor

hb-service

Additional Context

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 27 (1 by maintainers)

Most upvoted comments

This should probably also be raise at homebridge-config-ui-x, as that is what hb-service is built into.

Done.