Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] CUPS: am i stupid or what...
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
shimitar
Apprentice
Apprentice


Joined: 23 Nov 2003
Posts: 274
Location: Italy, Torino

PostPosted: Wed Sep 23, 2015 7:56 pm    Post subject: [SOLVED] CUPS: am i stupid or what... Reply with quote

I have a server, a headless box, with an USB printer attached to it. It uses the HPLIP driver and works great with CUPS, if i print from the server.

I am trying to export it on the network, so i can print from other computer at home... with no luck.

The printer is supposedly to be shared (shared = yes in the configuration file) but still from the cups web page, it always says "hp (Idle, Accepting Jobs, Not Shared)" (hp is the name of the printer).

From another computer, still Gentoo, i cannot see any printer from the server.

This is my cups:
Code:

emerge -vp cups
 * Last emerge --sync was dom 12 lug 2015 16:05:01 .

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] net-print/cups-2.0.3::gentoo  USE="X acl dbus pam ssl threads usb zeroconf -debug -java -kerberos -lprng-compat -python (-selinux) -static-libs -systemd -xinetd" ABI_X86="(64) -32 (-x32)" LINGUAS="it -ca -cs -de -es -fr -ja -pt_BR -ru" PYTHON_TARGETS="python2_7" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

 * IMPORTANT: 16 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.


This is my cupsd.conf:
Code:

LogLevel debug
PageLogFormat
# Allow remote access
Port 631
Listen /run/cups/cups.sock
Browsing On
#BrowseLocalProtocols
BrowseProtocols

DefaultAuthType Basic
WebInterface Yes
<Location />
  # Allow remote access...
  Order allow,deny
  Allow from all
</Location>
<Location /admin>
  Allow from all
</Location>
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Allow from all
</Location>
<Policy default>
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    Order deny,allow
  </Limit>
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
<Policy authenticated>
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    AuthType Default
    Order deny,allow
  </Limit>
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Cancel-Job CUPS-Authenticate-Job>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
BrowseWebIF Yes


This is my printers.conf:
Code:

# Printer configuration file for CUPS v2.0.3
# Written by cupsd on 2015-09-23 19:19
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
<Printer hp>
UUID urn:uuid:ca824b1e-e921-3709-7831-e3a595773e2a
Info
Location Studio
MakeModel HP Photosmart c4400 Series, hpcups 3.14.10
DeviceURI hp:/usb/Photosmart_C4400_series?serial=TH96GH51V505BN
State Idle
StateTime 1443035937
Type 36892
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy stop-printer
</Printer>


This is netstat:
Code:

netstat -tlnp | grep 631
tcp        0      0 0.0.0.0:631             0.0.0.0:*               LISTEN      4368/cupsd         
tcp6       0      0 :::631                  :::*                    LISTEN      4368/cupsd         


To me, everything seems fine. But from any client on the same network, i cannot see the printer!

What am i doing wrong here?

than you in advance!
_________________
Willy Gardiol
willy@gardiol.org


Last edited by shimitar on Thu Sep 24, 2015 7:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
ian.au
Guru
Guru


Joined: 07 Apr 2011
Posts: 434
Location: Australia

PostPosted: Thu Sep 24, 2015 7:42 am    Post subject: Reply with quote

You haven't specifically allowed access to your local network; this is covered in https://wiki.gentoo.org/wiki/Printing#Remote_Printer_Access and is pretty straightforward, you need to change your
Code:
<Location />
  # Allow remote access...
  Order allow,deny
  Allow from all
</Location>

to something like
Code:
 <Location />
  # Allow remote access...
  Order allow,deny
  Allow localhost
  Allow 192.168.2.*
</Location>
adjusted for your local subnet

Than add your subnet after the line
Code:
BrowseWebIF Yes
in your cupsd.conf to get the printer status broadcasting, and you should be good to go.
Code:
BrowseAddress 192.168.2.*:631


Edit: And ensure any users that need to print are in the lp or lpadmin group as appropriate.

I think that should be it, it's been a long time since I set cups up, but the wiki guide is pretty comprehensive.
Back to top
View user's profile Send private message
shimitar
Apprentice
Apprentice


Joined: 23 Nov 2003
Posts: 274
Location: Italy, Torino

PostPosted: Thu Sep 24, 2015 10:42 am    Post subject: Reply with quote

I will try. What is confusing is that in the config file row names are different than the guide... and i used to configure cups 1.5 and it was also different... a bit messy overall.
_________________
Willy Gardiol
willy@gardiol.org
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Thu Sep 24, 2015 11:09 am    Post subject: Re: CUPS: am i stupid or what... Reply with quote

shimitar wrote:
I have a server, a headless box, with an USB printer attached to it. It uses the HPLIP driver and works great with CUPS, if i print from the server.

Did you check if that printer is a networked (LAN or WLAN) one? In that case you could connect it to your network directly without the need of a print server.
Back to top
View user's profile Send private message
shimitar
Apprentice
Apprentice


Joined: 23 Nov 2003
Posts: 274
Location: Italy, Torino

PostPosted: Thu Sep 24, 2015 7:51 pm    Post subject: Reply with quote

Somehow i fixed it, almost.

I uninstalled CUPS on both the server and the client, deleted the /etc/cups folders, reinstalled cups, reconfigured following the wiki howto.

Now it works, but still my server printer does not get broadcasted on the network to add it on a client i need to manually specify the full path. I remember some time ago it was automatically found without having to write the URI....
_________________
Willy Gardiol
willy@gardiol.org
Back to top
View user's profile Send private message
kite14
Apprentice
Apprentice


Joined: 07 Nov 2006
Posts: 199
Location: Pordenone/Italy

PostPosted: Fri Sep 25, 2015 6:25 pm    Post subject: Reply with quote

shimitar wrote:
... I remember some time ago it was automatically found without having to write the URI....

I'm not a CUPS expert, I'm running just a local printer on my desktop box, but probably this behaviour has something to do with this:
Quote:
2013-06-30-cups16
Title Printer browsing in net-print/cups-1.6
Author Andreas K. Huettel <dilfridge@gentoo.org>
Posted 2013-06-30
Revision 1

net-print/cups-1.6 no longer supports automatic remote printers or
implicit classes via the CUPS, LDAP, or SLP protocols, i.e. "network
browsing".

The browsing functionality can be restored by running cups-browsed
from net-print/cups-filters as a separate daemon (just add its init
script to your default runlevel). By default cups-browsed uses the
net-print/cups-1.5 browse protocol, but it can also utilize zeroconf
(if the zeroconf use flag is set). See /etc/cups/cups-browsed.conf
for configuration.

Of course, directly specifying the location of your printers in
the cups interface works as well.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum