Dbus: Failed to connect to socket /host/run/dbus/system


I am trying to check if the time was NTP synchronized.
I connect via resin CLI and then go into one of my containers.

root@a6e385b:~# balena exec -it 4aba7fde2842 bin//bash
root@raspberrypi3-a6e385b:/# DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket \
>   dbus-send \
>   --system \
>   --print-reply \
>   --reply-timeout=2000 \
>   --type=method_call \
>   --dest=org.freedesktop.timedate1 \
>   /org/freedesktop/timedate1  \
>   org.freedesktop.DBus.Properties.GetAll \
>   string:"org.freedesktop.timedate1"
Failed to open connection to "system" message bus: Failed to connect to socket /host/run/dbus/system_bus_socket: No such file or directory

Any idea what went wrong?


Hi @zagatta-sonah!

If you’re using a multi-container setup, you have to specifically specify which container(s) will get access to the DBUS socket via labels in the docker-compose.yml file, see: https://docs.resin.io/learn/develop/multicontainer/#labels

Let us know if that helps!