WebThingsIO / gateway-docker

Legacy docker image for WebThings Gateway - now moved to main gateway repo at https://github.com/WebThingsIO/gateway
Mozilla Public License 2.0
72 stars 25 forks source link

Avahi - daemon already running #29

Closed gorbunovav closed 4 years ago

gorbunovav commented 4 years ago

My container logs are spammed with the following message:

Daemon already running on PID X

The PID inside the container corresponds to the avahi daemon. It has started after the upgrade from 0.9.2 version of the image (most likely after #28).

I am running the container with "network_mode: host" on Raspberry PI, which already has the avahi daemon running on the host.

Environment:

Raspberry Pi 4 Raspbian 10 Docker version 19.03.5, build 633a0ea Image: mozillaiot/gateway:0.10.0-arm

docker-compose.yml:

version: "3"

services:
  webthings-gateway:
    container_name: webthings-gateway
    image: mozillaiot/gateway:arm
    restart: unless-stopped
    network_mode: host
    ports:
      - "8080:8080"
      - "4443:4443"
    volumes:
      - ./data:/home/node/.mozilla-iot
mrstegeman commented 4 years ago

I knew this was going to cause some issues...

Would an environment variable help? That way, you could disable avahi selectively.

mrstegeman commented 4 years ago

@white-gecko do you have a better solution for this?

gorbunovav commented 4 years ago

@mrstegeman as far as I understand the avahi daemon is required for the webthing-arduino add-on only, right?

In that case, I am ok with the environment variable solution, since I am not going to use it in the nearest feature 🤔

mrstegeman commented 4 years ago

It's used for a couple things:

Neither of these are absolutely necessary, but are definitely conveniences.

white-gecko commented 4 years ago

Ah yes, I can see the same message in my logs as well. But I think the avahi daemons seam not to further interfere as it seems to me.

white-gecko commented 4 years ago

But sure I think an environment variable could control whether the daemon should be running. But this would not solve the issue to prevent the log messages.

mrstegeman commented 4 years ago

I think the issue here is that avahi is running on the host as well, and the Docker container is using host networking, so the two are somehow interfering.

snorp commented 4 years ago

I have this log message too, and my host (CoreOS) isn't running avahi.