OCI/ROCK Container: Avahi sees printer as remote service not as local service
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- docker
- Domain
- infrastructure, networking
Research direction
Reproduce the issue with the Docker command and inspect the attached check-local.patch.txt alongside avahi-core/server.c, especially avahi_server_is_service_local(). Compare the host and container Avahi behavior using ippfind --local and ippfind --remote; done means the printer is recognized as a local service and advertised with the usable local URI.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Go
- Stars
- 210
- Forks
- 35
- Avg merge
- 5h 47m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenPrinting/ipp-usb
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
OpenPrinting/ipp-usb#136 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
OpenPrinting/ipp-usb#124 · 5 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 32/100
OpenPrinting/ipp-usb#123 · 10 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
OpenPrinting/ipp-usb#122 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
OpenPrinting/ipp-usb#116 · 2 comments ·
All issues in OpenPrinting/ipp-usb
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
SocialGouv/iterion#2369 ·
Maintainers usually reply within 1 day
-
area/ci bug priority/p3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
documentation help wanted needs-triage
Difficulty 1/5 1-3 hours Newbie friendliness 75/100
hivecommons/hive#11606 · 2 comments ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 85/100
gravitational/teleport#69869 ·
-
category:agent
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
LanternOps/breeze#8493 ·
Maintainers usually reply within 1 day