I recently ran into an error condition, in which on my Linux laptop ‘Klystron’, I had pulled up a Printers List within Firefox, to Print out a Web-page. And the list of available printers kept updating, alternately with a network printer displayed as existing, and with the same printer missing, just over once per second.
I was able to get to the root of this problem.
I had recently installed the package ‘avahi-daemon’ on that laptop, prior to which that error condition did not occur. ‘avahi’ is a service-discovery daemon, which means that it scans the network neighborhood, and makes shared resources visible in the lists of GUI applications, where those resources might normally not be visible under Linux.
The cause of this problem seems to be, that if more than one resource exists by the same name, Firefox will continuously be in a state of confusion, about the fact that both resources should exist side-by-side.
For example, it is possible to have a printer named ‘PIXMA_MX922′, which is a WiFi-printer and which is therefore accessible directly on the LAN, by way of the router. It could be installed directly on all the computers by way of CUPS. But at the same time it is possible to have a server set up which is named ‘Phoenix’, the CUPS service of which has that printer installed directly, as well as having the ‘Samba server’ installed, which offers to share all the local printers as a Samba share by the same name, by default.
Next, if we have a laptop named ‘Klystron’, which is running the ‘avahi-daemon’, then according to its new discovery capabilities, there are at least two printers on the same network,
- ‘PIXMA_MX922 As installed on the LAN’ and
- ‘PIXMA_MX922 As belonging to the
As far as I can tell, the problem here is that both printers will have the same name, because the
Samba server serves it out as having the same name it had locally with its own CUPS server. And at that point, the Available Printers List belonging to Firefox becomes unstable.
There is more than one way to solve this problem.
- One way to solve this, might be just to uninstall and purge ‘avahi-daemon’ on the affected local computer. That way, the discovery of the
Samba sharewithin the resources list of the application is no longer automatic. But, a possible problem with this approach could be, that the network resource still exists, and that awareness of it could be cached someplace even after ‘avahi-daemon’ has been removed, which was the process that created awareness of it in the first place.
- Another way in which some people may solve this, is by disabling support for the IPP Protocol, thus removing the direct availability of the printer on the LAN, by way of WiFi. But, I personally find this service, and the availability of the printer, essential and would not think to disable IPP on any computer.
- Finally, it is possible to instruct the Samba server on ‘Phoenix’ no longer to offer its local CUPS printers
as Samba sharesas well. The problem with that would be, that the availability of the redundant resource which once existed, could still be cached locally by ‘avahi’, even though it is no longer being offered by ‘Phoenix’.
And so the fastest solution I was able to find, was to combine (1) and (3) above. There are instructions here about how to disable the sharing of printers on a Samba server. But one problem with these instructions, is that they simply tell us to paste some configuration lines into ‘/etc/samba/smb.conf’, without telling us where in the configuration file to paste them. The suggested options should go into the Global section. And it is important to uninstall and purge ‘avahi-daemon’, such as also to remove any cached record of what that daemon once found.
#Disable Printer Sharing load printers = No printing = bsd printcap name = /dev/null disable spoolss = Yes #Disable Printer Sharing
Be sure to Restart Samba Fully, because simply doing a ‘
reload-config‘ will not do the trick.
At this point, my Linux laptop was only aware of resources that have been configured formally, the way we normally configure them under Linux, and the Available Printers List was stable again, within Firefox.
BTW: I do not actually believe that the list output by ‘avahi-daemon’ itself is unstable. If it was, then certain other software on my LAN should already have failed. I rather suspect that the Mozilla Printers List has a programmed mistake, to use the identifier of the printer itself, as an index to look up, where that printer can be found. And then, to list the same identifier twice, reveals two locations…
Update: I have dug into this problem more deeply, and found there was a mistake in my earlier diagnosis of it.
There was indeed a duplication of printers by name, but this duplication was not due to the Samba server on Phoenix. It was due to the fact that the CUPS server on Phoenix was set to allow sharing of its locally-defined printer, as well as due to the fact that I had set up ‘avahi-daemon’ on the laptop Klystron, where I had the WiFi printer installed as a local printer as well.
Apparently, under Debian / Jessie, when we install ‘avahi-daemon’, this will cause not only the local CUPS printers to be displayed, but also remote CUPS, shared printers as well.
The reverse problem did not seem to happen, just because on my laptop, I had never configured CUPS to share out its printers. And so when I applied solutions (1) and (3) above concurrently, it was really only solution (1) which had done any good.
Because I am a perfectionist, I still want to have ‘avahi-daemon’ running on that laptop. The trick that finally worked was to get in front of Phoenix, and there to go into the settings
K -> System Settings -> Printers -> PIXMA_MX922
And there, simply to uncheck “Share This Printer”
After that, I was able to reinstall ‘avahi-daemon’ on my laptop, and run into no further problems with it.
By now, I have re-enabled printer sharing by way of Samba on Phoenix, without creating any issues on Klystron.