Skip to content

OCI/ROCK Container: Avahi sees printer as remote service not as local service #110

Open
@tillkamppeter

Description

@tillkamppeter

When running the (immutable) OCI container of ipp-usb, from PR #106, from https://github.com/im0vishal/ipp-usb/tree/immutable-ipp-usb, commit 44b2745 ("Updated ReadMe to include runtime flags for data persistence"), started with the command lines

sudo docker volume create ipp-usb-data
sudo docker run -d --network host -v /dev/bus/usb:/dev/bus/usb:ro -v ipp-usb-data:/var/lib/ipp-usb --device-cgroup-rule='c 189:* rmw' --name ipp-usb ipp-usb:latest

the avahi-daemon on the host system sees ipp-usb as a remote service and not as a local service. So running ippfind --local does not list the printer but ippfind --remote lists it.

Especially client tools then do not replace the network host name (XXX.local) by localhost, and if ipp-usb is providing the printer only on the local machine (lo network interface) the printer cannot be accessed as the URI ipp://XXX.local:60000/ipp/print is advertised and used, while ipp://localhost:60000/ipp/print works.

This can be caused by the container running its own avahi-daemon and so the host's avahidaemon receiving the service from the container's avahi-daemon and not directly.

In avahi (I am using 0.8.0), the function avahi_server_is_service_local() in the file avahi-core/server.c of the Avahi source code is actually determining whether a service is local or not.

The function is left by the return 0; in these lines:

    e = find_entry(s, interface, protocol, key);
    avahi_key_unref(key);
    if (!e)
        return 0;

and therefore the service is see as not local. This I found out by applying the attached patch to the Avahi source code and looking for XXX in the /var/log/syslog file and I saw XXX6 but not XXX10 right afterwards.

check-local.patch.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions