LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 06-07-2004, 12:11 PM   #1
element
Member
 
Registered: Jan 2003
Distribution: Debian
Posts: 106

Rep: Reputation: 15
Undeletable printer in CUPS and printing problem


I've been messing with CUPS and gnome-cups-manager and I've added a wrong networkprinter but I can"t delete the printer. Very weird.
/etc/cups/printers.conf doesn't have the printer listed but yet, it's shown in gnome-cups-manager and the webadmin page for CUPS (localhost:631).

I've even deleted /etc/cups/ manually, didn't change a thing.
One strange thing I've noticed is that the printer is in /var/run/cups/printcap but that files gets automattically generated by /etc/cups/printers.conf and there is no trace of this printer (I even deleted the conf file).

It's a ghost printer I tell you! Deleting from localhost:631 doesn't work either.
There it turns up at "printername on soapbox" and when I press the delete button cups tries to go to http://soapbox:631 which doesn't exist and therefor cups is unable to delete that printer.

If I delete the printer from gnome-cups-manager it works but the printer automatically returns when I run gnome-cups-manager again.
I've also tried deleting it from oopadmin but the delete button was greyed out. Strangest thing I've encountered yet! I really don't have a clue what else I can do.

When I push the delete button in cups in my browser, I get following error:
Quote:
Gateway Timeout
The following error occurred:
A DNS lookup error occurred because the request timed out during the lookup. (DNS_TIMEOUT)
Please contact the administrator.
The URI is http://soapbox:631/admin/?op=delete-...=colourprinter


When I set Browsing to off in my cupsd.conf, the printer disappears.
I also can't print to local printers anymore.
Help, please.

Last edited by element; 06-07-2004 at 12:12 PM.
 
Old 06-07-2004, 01:19 PM   #2
-X-
Member
 
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

Rep: Reputation: 30
What's in /etc/printcap ?
 
Old 06-07-2004, 01:31 PM   #3
element
Member
 
Registered: Jan 2003
Distribution: Debian
Posts: 106

Original Poster
Rep: Reputation: 15
The printer shows up in printcap, but printcap is in /var/run/cups/printcap

I've already deleted the entire file, but the printer comes back. It is not in /etc/cups/printers.conf however.
 
Old 06-07-2004, 06:00 PM   #4
-X-
Member
 
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

Rep: Reputation: 30
Well, as root, just
# grep "nameofprinter" /etc/* /var/* /home/*
Something should show up.

? The printer you want to use, do others print to it or, are you the first to print to it? Just wondering if you have it setup right on the server. If not, get back with me and I'll set you through it.
 
Old 06-08-2004, 11:58 AM   #5
element
Member
 
Registered: Jan 2003
Distribution: Debian
Posts: 106

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by -X-
Well, as root, just
# grep "nameofprinter" /etc/* /var/* /home/*
Something should show up.

? The printer you want to use, do others print to it or, are you the first to print to it? Just wondering if you have it setup right on the server. If not, get back with me and I'll set you through it.
Nothing came up and I only 1 computer prints to it on the network. When I turn browsing off in cupsd.conf, the printer dissappears, so I'm guessing the printer gets "pushed" to the client.
The thing is, I can't print to it from the server. It's an USB printer.

Code:
Description: Eprinter
Location: usb:/dev/usb/lp0
Printer State: idle, accepting jobs.
Device URI: usb:/dev/usb/lp0
The printjobs get aborted or cancelled when I try to print to it.
 
Old 06-08-2004, 01:16 PM   #6
element
Member
 
Registered: Jan 2003
Distribution: Debian
Posts: 106

Original Poster
Rep: Reputation: 15
Hmmm... I got the printer on the server working again.
On the client I get this error: "Unable to get printer status (client-error-forbidden)!"
When I try to print to the printer on the server.
 
Old 06-08-2004, 01:28 PM   #7
Biased turkey
Member
 
Registered: Jan 2002
Location: Canada
Distribution: redhat7.2
Posts: 169

Rep: Reputation: 30
DNS lookup error ??
Did you configure /etc/hosts on both client and server so that they can associate the proper IP adress on your local network to the right host name ?

If for example, you have 2 computers on your network:
1 named "server" with ( for example ) an Ip adress of 192.168.0.1 and
1 named "client" with ( for example ) an Ip adress of 192.168.0.2

the /etc/hosts on "server" should looks like:
127.0.0.1 localhost server
192.168.0.2 client

and on "client" /etc/hosts should looks like:

127.0.0.1 localhost client
192.168.0.1 server
 
Old 06-08-2004, 02:51 PM   #8
element
Member
 
Registered: Jan 2003
Distribution: Debian
Posts: 106

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Biased turkey
DNS lookup error ??
Did you configure /etc/hosts on both client and server so that they can associate the proper IP adress on your local network to the right host name ?

If for example, you have 2 computers on your network:
1 named "server" with ( for example ) an Ip adress of 192.168.0.1 and
1 named "client" with ( for example ) an Ip adress of 192.168.0.2

the /etc/hosts on "server" should looks like:
127.0.0.1 localhost server
192.168.0.2 client

and on "client" /etc/hosts should looks like:

127.0.0.1 localhost client
192.168.0.1 server
Yes, I can ping from client to server and server to client using the hostnames. So, this is set up correctly.
 
Old 06-08-2004, 05:29 PM   #9
-X-
Member
 
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

Rep: Reputation: 30
Unless you have denied outside clients or special deny setup, you shouldn't need to hosts.allow. Make sure your firewall is open for printing.

>>> Server side <<<
The only thing you need to change on the server in cupsd.conf is to allow outside clients access;
<Location />
Encryption IfRequested
Satisfy All
Order deny,allow
Deny From All
#Allow From 127.0.0.1 <---------------- I just commented this out.
Allow From All <---------------- Add this line. Very common problem.
</Location>

Then restart the cupsd service to register all of this.

>>> Client side <<<
>>> KDE printer config app setup the following <<<
My Slackware /etc/printcap for server corvette, printer hp940c. I always put the server name as part of the printer. Mustang is my wireless laptop.
# This file was automatically generated by cupsd(8) from the
# /etc/cups/printers.conf file. All changes to this file
# will be lost.
corvette-hp940c|corvette-hp940c:rm=mustang:rp=corvette-hp940c:

My /etc/cups printers.conf.
# Printer configuration file for CUPS v1.1.19
# Written by cupsd on Sun Jun 6 07:20:32 2004
<DefaultPrinter corvette-hp940c>
Info HP DeskJet 940C, hpijs
Location server
DeviceURI ipp://corvette:631/printers/hp940c
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</Printer>

My /etc/cups/client.conf
ServerName corvette.office.org

I was going to use localhost:631 to setup the printer on the client, but saw the KDE printer config app and thought, 'what the heck, lets see how this works.' So after allowing "All" to the server cupsd, I just used the KDE print config app. Just selected the remote cups, it found the printer, I selected, and it worked perfect. It also setup /etc/cups/interfaces/corvette-hp940c.ppd

Not sure about gnome. Keep posting, should be able to get it running. Also, your results would be helpful to others.

Last edited by -X-; 06-08-2004 at 05:39 PM.
 
Old 06-08-2004, 08:56 PM   #10
Biased turkey
Member
 
Registered: Jan 2002
Location: Canada
Distribution: redhat7.2
Posts: 169

Rep: Reputation: 30
Maybe we should start from scratch, because it's not clear to me if you can access the printer from the server.
1) disconnect your network
2) from Gnome on the server ( I use KDE ) delete any available printer.
3) point your browser as root at http://localhost:631
4) follow the procedure to create a new printer

try printing from the server. It's not even worth trying to print from the client if you can't even print from the server.

If it works, reconnect your network, desable any firewall on the client and server and edit the cupsd.conf.
I added the following lines:
in the security options:
<Location />
Order Deny,Allow
Deny From All
Allow From 127.0.0.1
# specify the client IP
Allow From 192.168.0.2
</Location>

just before the end of the file, add the Browsing options:

#
# End of "$Id: cupsd.conf.in,v 1.13 2003/04/10 20:14:04 mike Exp $".
#
Browsing On
BrowseProtocols cups
BrowseAddress 192.168.0.2
BrowseInterval 60

Don't be discouradged, it took me 2 weeks ( and going through the 100 + pages of the cups software administrator manual ) before having things working.

After that, the client should automatically ( I mean it, nothing to do on the client side ).

P.S. If you want I can email you my complete cupsd.conf
 
Old 06-09-2004, 04:00 AM   #11
-X-
Member
 
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

Rep: Reputation: 30
The single biggest problem with cups is the "Allow from 127.0.0.1" has to be changed to open up the cups sever printer to clients. For what I do I use "All". You're right BT about printing from the server first. After that and changing cupsd.conf shouldn't be a problem. For completeness, I don't have any of the Browser..... options set.
 
Old 06-09-2004, 08:43 AM   #12
Biased turkey
Member
 
Registered: Jan 2002
Location: Canada
Distribution: redhat7.2
Posts: 169

Rep: Reputation: 30
Quote:
The single biggest problem with cups is the "Allow from 127.0.0.1" has to be changed to open up the cups sever printer to clients
You do not have to "change" anything. The 1st line
Allow From 127.0.0.1
Is required so the server has to detect itself so to speak when it has a printer connected to itself.
If you have no network, just 1 system with a printer connected to it you need that line.
The same is true for /etc/hosts. If you have just 1 system and no network at all you still require the line
127.0.0.1 localhost localhost.localdomain ( or somethong like that )

Then if you have a local network with 1 server and 1 client you have to add a 2nd line in cupsd.conf with the client Ip adress to allow the client to print .

and you have to add the 3rd line
BrowseAddress 192.168.0.2 ( 192.169.0.2 being the client adress )
to let the client know that a printer is available on the server.
 
Old 06-09-2004, 02:12 PM   #13
element
Member
 
Registered: Jan 2003
Distribution: Debian
Posts: 106

Original Poster
Rep: Reputation: 15
Thanks a lot for the help guys, I've been messing with cupsd.conf and it works! :-)

One other problem though, on the client there's also a parallel printer connected. The printer gets autodetected by gnome-cups-manager and I can set it up with no problems, BUT when I want to print to it, the printer remains idle. No printjobs.
Any ideas what could be wrong? As previous, it used to work before this whole mess with my network printer.
 
Old 06-09-2004, 03:49 PM   #14
-X-
Member
 
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

Rep: Reputation: 30
Biased Turkey; not sure what you're getting at, but Allow From All, allows everthing, even local host. I know about localhost, but we are talking about client/server printing. Yes, for only local printing, just leave the cupsd.conf as it is. You can change how you wish, add in each client, or just make it simple for the entire office and Allow From All. My office setup works fine with only the Allow From All change, no browse. I know, I use it every day. Go and re-read my post. The point is the cups server has to be opened up. How you do that is up to the individule.
 
Old 06-10-2004, 08:44 AM   #15
Biased turkey
Member
 
Registered: Jan 2002
Location: Canada
Distribution: redhat7.2
Posts: 169

Rep: Reputation: 30
Quote:
Biased Turkey; not sure what you're getting at, but Allow From All, allows everthing, even local host
... and Allow from ALL means any hacker with any IP too.
I prefer to do it the other way: restrict to all then allow only a few selected one.
Of course if you are behind a firewall ( I have a dedicated rig running Firestarter ) allowing everyone is less risky
Better to be safe than sorry
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cups problem simcox1 Slackware 7 08-06-2005 01:06 PM
CUPS problem.... nemesi Slackware 7 04-13-2005 02:01 AM
Printing Problem (cups / cups-lpd) daleman Linux - Software 3 04-08-2005 08:01 AM
CUPS Problem kesara Linux - Software 0 01-19-2005 08:27 AM
Cups problem monkeymartin Slackware 9 04-04-2003 10:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration