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

Abierto
#110 11 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
docker

Línea de trabajo

Reproduzca el problema con el comando de Docker e inspeccione check-local.patch.txt junto con avahi-core/server.c, especialmente avahi_server_is_service_local(). Compare el comportamiento de Avahi en el host y en el contenedor usando ippfind --local e ippfind --remote; se considera completado cuando la impresora se reconoce como un servicio local y se anuncia con la URI local utilizable.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

When running the (immutable) OCI container of ipp-usb, from PR #106, from https://github.com/im0vishal/ipp-usb/tree/immutable-ipp-usb, commit 44b2745f ("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

Lenguaje dominante
Go
Estrellas
211
Forks
35
Merge medio
5 h 47 min
PR fusionados (30 d)
1

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de OpenPrinting/ipp-usb

Todos los issues de OpenPrinting/ipp-usb

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.