You are not logged in.

#1 2019-03-13 19:07:48

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

[Solved]avahi vs cups

I was happily using cups and had my office printers set up in a local cups server.

However, I enabled avahi-daemon today in order to find a new network printer that they put in because the old one's lease was up. In any case, once avahi-daemon was started, I started seeing 2 instances of all the printers in my apps like libreoffice etc. Once i stopped avahi-daemon, I only saw the printers that I had configured in CUPS.

So my question is: Is it better to "only" use avahi-daemon for network printing or is a local cups server still the preferred method?


Our office does replace printers when their lease is up and they might also change the IP(unlikely, but possible at times). In such a scenario, I think avahi-daemon seems to be the better bet in finding your printer and printing without issues. The printers that I am concerned with at my workplace also all support IPP/zeroconf/dnssd/socket. But driverless configuration seems the best bet, no?

Will avahi-daemon also "see" network printers that are in sleep mode due to lack of activity?


I have read the Avahi and CUPS wiki pages, but they don't list the possible pros and cons of using one or the other

Thoughts?

Last edited by Inxsible (2019-04-01 19:29:32)


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#2 2019-03-14 14:07:04

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

Re: [Solved]avahi vs cups

That may be because they don't conflict but work well together.

Cups allows you to add printers discovered automatically (using avahi) or added manually.
I also think most users enable avahi when they install cups so don't even realise you can use cups without avahi running.

Avahi can discover a lot more then printers though.
If your network environment changes often, use avahi. Incase your network environment is static you don't need avahi but it doesn't hurt.


Will avahi-daemon also "see" network printers that are in sleep mode due to lack of activity?

no idea

So my question is: Is it better to "only" use avahi-daemon for network printing or is a local cups server still the preferred method?

I favor a cups local server PLUS avahi.
I find the functionality browsers have to print info from the net lacking a lot (not the browser fault, website creators just seem to forget people may want to print some info from their site) and install cups-pdf practically everywhere.

So avahi is present on the system and enabling it is simple and often saves having to figure out ip-address and hostnames of networked printers.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2019-03-14 15:21:45

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [Solved]avahi vs cups

Lone_Wolf wrote:

Avahi can discover a lot more then printers though.

True, but I, personally, am not interested in any other services except the printers on my office network.

Lone_Wolf wrote:

If your network environment changes often, use avahi. Incase your network environment is static you don't need avahi but it doesn't hurt.

But a network environment doesn't change that often in an office setting or home setting. The only time it would change is if you travel a lot and use different facilities for your work. I guess in that scenario, avahi should be your only option


Lone_Wolf wrote:

I favor a cups local server PLUS avahi.

Why exactly? Can you list the benefits? I personally don't want to see 2 instances of every printer (especially if i also have configured cups) and then keep trying to figure out which printer to print to each time

Lone_Wolf wrote:

I find the functionality browsers have to print info from the net lacking a lot (not the browser fault, website creators just seem to forget people may want to print some info from their site) and install cups-pdf practically everywhere.

I don't have cups-pdf installed and yet my browsers have the option of printing to pdf. Also the Print to file option in most apps like libreoffice seem to be able to create a pdf file. (I have to look up the package which provides this "Print to file" option)

Lone_Wolf wrote:

So avahi is present on the system and enabling it is simple and often saves having to figure out ip-address and hostnames of networked printers.

That is an advantage, but again if your network is static, I would still go with one or the other, not both.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#4 2019-03-15 12:00:21

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

Re: [Solved]avahi vs cups

I would still go with one or the other, not both.

It seems I failed to make clear how avahi and cups work together.

If avahi is active , cups will use it.
This gives 2 options to add printers : discovered ones and manually added ones.

If avahi isn't active cups doesn't use printer discovery.
This gives only one option : manually added printers.

The question is not avahi or cups but : Do I need/want printer autodiscovery or not ?
If answer is yes > enable avahi , if answer is no > disable avahi

People that start with avahi enabled will only use manual adding for printers not found by avahi.

People that start with avahi disabled will have to add any printer they want to use manually.
If they enable avahi later they should see double entries for every manually added printers that is discovered by avahi .
If they want to continue using avahi the sensible choice is to remove the manually added entries.

TL;DR it's impossible to use one or the other. your choices are use one (cups) or both (cups+avahi) .

------------------------------------------------

cups-pdf

Imagine you're in an environment without any physical printers available and you need to print something.

A common workaround is to create a file that can be printed later when a physical printer becomes available .
PDF is my preferred format for that file.

This prompts me to distinguish between 3 groups of programs :

A. programs that only support printing to printers added in cups
example : thunderbird

B. programs that support print to file and printing to installed printers
example firefox

C - programs that support writing to pdf without needing external tools, like libreoffice .
example libreoffice

I use programs from all 3 groups, what method can I use that allows all of them to create a pdf with exactly the same options available (paper size, quality etc)  ?

Methods that work for group C won't work for group A.
Same with methods used in group B.

installing cups-pdf while enabling avahi will resuilt in ALL programs being able to print to cups-pdf or use a discovered printer.

Afaict I need to run a cups server to allow cups to present a cups-pdf printer to all programs.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2019-04-01 19:29:14

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [Solved]avahi vs cups

Thanks.

I ended up setting up the printers in cups -- the way I had it before.

I don't use avahi since I don't want auto-discovery for any devices/services and I don't want 2 instances of each printer showing up in my apps. Also, gtk-dialog and certain apps like firefox(which I believe use gtk-dialog) for printing don't show the printers correctly if not set up in cups -- while others which don't use gtk-dialog-- eg. Chromium, LibreOffice work fine just with avahi/auto-discovery without having any printers set up in cups.

All in all, I ended up exactly where I started. But it was still an interesting learning experience for me, since all this started only because I enabled avahi only to find my "lease-replaced" printer.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

Board footer

Powered by FluxBB