Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printing Issue #222

Closed
sjordahl opened this issue Feb 15, 2020 · 4 comments
Closed

Printing Issue #222

sjordahl opened this issue Feb 15, 2020 · 4 comments
Labels

Comments

@sjordahl
Copy link

At present I'm using the --printer option to allow the container to print through the host. Printing works fine when I start the container, but after some amount of time it stops working. In digging into it I'm finding that the cups.sock socket appears to be changed by the host, thereby invalidating it in the container.

Before going further I wanted to validate that I wasn't reinventing the wheel. My first thought is to pass the cups directory through rather than the file, which should allow the container to access the new socket, assuming it is, in fact, being changed.

@mviereck
Copy link
Owner

Thank you for the report and your investigation!

I wonder why the cups socket might change. Maybe the cups server is restarted for some reason? I see no good reason for cups to recreate the socket under normal circumstances.

I followed your suggestion, x11docker now shares entire /run/cups.

assuming it is, in fact, being changed.

Maybe you could validate this? ls -l /run/cups/cups.sock should show the time you've booted the system. If not, the socket has been changed meanwhile.


For the full picture yet: Another possibility is a TCP connection with --printer=tcp. But it needs some host configuration:

    note "Option --printer: Network setup for CUPS detected.
  Server address: $Cupsserver
  You may need to allow container access in /etc/cups/cupsd.conf, e.g.:

Port 631
<Location />
  # Allow remote access...
  Order allow,deny
  Allow 172.17.0.*
  Allow 127.0.0.1
</Location>"

@sjordahl
Copy link
Author

Thank you for the follow-up. Per your suggestion I took a look at the timestamp of the socket. In my case, the container showed "Feb 9 11:21" and the host shows "Feb 15 05:08", so the service definitely restarted. This particular system is an Ubuntu MATE instance, so Gnome 2-based which might have a legacy aspect (restarting cups) as I don't recall having this issue on my previous non-MATE install.

I'll try the change you've committed as soon as I have time.

@sjordahl
Copy link
Author

I've updated my x11docker to master and upon starting my container my printing is working fine. As time progresses I'll let you know if it starts failing again.

@mviereck
Copy link
Owner

Great!
I'll close for now, I assume the issue won't appear anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants