avahi client via dbus with dynamic user
General information
To distribute package archives (for pacman
/ Arch Linux) in local network I wrote a tool called pacredir
. It redirects http requests to other hosts, these are found via avahi
client API.
The described issue started to happen with dbus
1.14.0
, everything worked fine with version 1.12.x
.
To reproduce
Steps to reproduce the behavior:
- install
pacredir
:pacman -S pacredir
- try to start the service:
systemctl start pacredir.service
Expected result
The service starts pacredir
with a dynamic user (systemd
's DynamicUser=on
). The service should connect to avahi
, receive information and start redirecting requests.
Actual result
The service fails to start with:
pacredir[355]: Failed to create client: An unexpected D-Bus error occurred
The failing call is avahi_client_new().
Starting the command from terminal (as root) or with DynamicUser=off
works around the issue and communication with avahi
daemon works as expected.