[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cups/cups-browsed: only advertise online network printers



On Sun 26 Jul 2015 at 17:54:50 +0200, Tuxo Holic wrote:

> On Sat 25 Jul 2015 at 11:30:30 +0100, Brian wrote:
> 
> > Please stop cups-browsed on the client and post the output of 'lpstat -t'.
> 
> systemctl stop cups-browsed.service
> 
> systemctl status cups-browsed.service
> ● cups-browsed.service - Make remote CUPS printers available locally
>    Loaded: loaded (/lib/systemd/system/cups-browsed.service; enabled)
>    Active: inactive (dead) since Son 2015-07-26 17:27:01 CEST; 1s ago
>   Process: 22426 ExecStart=/usr/sbin/cups-browsed (code=exited, status=0/SUCCESS)
>  Main PID: 22426 (code=exited, status=0/SUCCESS)
> 
> Jul 26 17:27:01 systemd[1]: Stopped Make remote CUPS printers available locally.
> 
> LANG=C lpstat -t
> scheduler is running
> no system default destination

Your problem (please correct me if I have not understood what you said)
is that applications, Iceweasel, Evince etc, still see HP_LaserJet_1020
after the server is closed down.

This would be possible if you had set HP_LaserJet_1020 as the system
default destination. cups-browsed removes all discovered printers from
the client if they disappear (which they do when the server shuts down),
except for the one which is marked as the default on the client.

This was my first thought. It turns out that first thoughts are not
always fruitful. You have no default destination. Back to the drawing
board!

> lpstat: No destinations added.
> lpstat: No destinations added.
> lpstat: No destinations added.
> lpstat: No destinations added.

cups sees no printers. Not surprising because cups-browsed is awol
(absent without leave) and has nothing to tell it.

Do your applications still see HP_LaserJet_1020 after doing this?
 
> systemctl start cups-browsed.service
> 
> LANG=C lpstat -t
> scheduler is running
> no system default destination
> device for HP-LaserJet-1020: ipp://Server1:631/printers/HP_LaserJet_1020
> HP-LaserJet-1020 accepting requests since Sun 26 Jul 2015 05:27:42 PM CEST
> printer HP-LaserJet-1020 is idle.  enabled since Sun 26 Jul 2015 05:27:42 PM CEST

cups-browsed has returned. It communicates with cups about some IPP
(CUPS) packets it is has received.

> So basically with the browsed.service stopped the broadcasts are ignored?

More or less. To repeat: the main purpose of my question was to discover
whether you had a default print queue set up. You don't.

> Let me give you the client's /etc/cups/cups-browsed.conf as well:
> 
> grep -v ^& /etc/cups/cups-browsed.conf 
> 
> BrowseRemoteProtocols cups

You are only accepting the IPP (CUPS) protocol to discover printers on
the network. No problem, but if you have avahi-daemon running it is
wasting its time.

> BrowseProtocols cups

A repeat of the previous directive for discovering printers. Unless you
have printers connected to the client it does nothing. Probably not a
problem.

> BrowseAllow 192.168.1.1
> BrowseAllow Server1
> BrowsePoll Server1:631

Into unknown territory! What's wrong with the defaults? Your server is
advertising; the default 'BrowseRemoteProtocols dnssd cups' on the
clientworks well, What need is there for these?

> AutoShutdown On

You have a reason for this? One which stands up to scrutiny?

> Now, this is interesting:
> 
> After I played around with the client's cups-browsed service the printer status on the server1 webinterface changed:
> 
> Before:
> HP LaserJet 1020 HP LaserJet 1020 Foomatic/foo2zjs-z1 (recommended) Idle - "Waiting for jobs"

That looks ok.

> After:
> HP LaserJet 1020 HP LaserJet 1020 Foomatic/foo2zjs-z1 (recommended) Idle - "Waiting for printer to become available."

That looks ominous.

> And the printer page on the server1 webinterface does always mention:
> HP_LaserJet_1020 (Idle, Accepting Jobs, Not Shared)
>
> Any thought's on the matter?

What versions of cups are running on the clients?

> Please CC me with your reply, I forgot to mention I'm no longer subscribed to the list.

It would be as well to repeat this in other posts. Memories are fallible.


Reply to: