LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-15-2004, 08:25 PM   #1
VBAHole22
Member
 
Registered: May 2004
Location: Virginia
Distribution: Red Hat 9
Posts: 36

Rep: Reputation: 15
Struggling with Samba CUPS win printer issue


I am trying to get a windoze printer shared to my rh9 through samba.

Samba is working fine and I can see the data shares I have in XP.

Can't get a printer online though.

I have tried CUPS through localhost:631

For device I use windows printer via samba

Then for device URI i am using:
smb//:winuser:winpass@winboxname/sambaworkgroupname

For make I choose HP

When I try to print a test page I get

Connection refused when attempting to contact linuxbox.domain.com:631

What am I doing wrong here?
 
Old 06-16-2004, 12:03 AM   #2
mascdman
Member
 
Registered: Jun 2004
Location: Canada
Distribution: Ubuntu 6.06 LTS
Posts: 152

Rep: Reputation: 30
Just guessing here, but is the CUPS server running? Try running cupsd as root and then printing the test page again.

--mascdman
 
Old 06-16-2004, 07:51 AM   #3
VBAHole22
Member
 
Registered: May 2004
Location: Virginia
Distribution: Red Hat 9
Posts: 36

Original Poster
Rep: Reputation: 15
I'll give that a shot tonight. After I wrote the post I realized that httpd was not even running. Don't know if that makes a difference either.

Can I just circumvent CUPS and edit the smb.conf file to get the printer on that way? If your suggestions doesn't work.
 
Old 06-16-2004, 08:08 AM   #4
mascdman
Member
 
Registered: Jun 2004
Location: Canada
Distribution: Ubuntu 6.06 LTS
Posts: 152

Rep: Reputation: 30
Not sure -- I've never tried to setup network printing... I probably should, though...

--mascdman
 
Old 06-16-2004, 08:24 AM   #5
VBAHole22
Member
 
Registered: May 2004
Location: Virginia
Distribution: Red Hat 9
Posts: 36

Original Poster
Rep: Reputation: 15
I don't have much choice. My HpOfficeJet is USB and my rh9 box doesn't have a usb card so I have to send the printer through Windoze box.

I have it set up in windoze and it is shared.

It's just that the CUPS interface sort of leaves you hanging when it comes to smb printer setup. It's nice to have, don't get me wrong, but it's not very helpful when something you enter isn't just right.

I have a samba book that describes setting up the win printer through the config file so I may just try that.

Also I have lines in my smb.conf that read:

# if you want to automatically load your printer list rather
# than setting them up individually then you'll need this
printcap name = /etc/printcap
load printers = yes

# It should not be necessary to spell out the print system type unless
# yours is non-standard. Currently supported print systems include:
# bsd, sysv, plp, lprng, aix, hpux, qnx, cups
printing = cups


I may need to mess with these but I'm unsure.


 
Old 06-16-2004, 04:15 PM   #6
andrewdodsworth
Member
 
Registered: Oct 2003
Location: United Kingdom
Distribution: SuSE 10.0 - 11.4
Posts: 347

Rep: Reputation: 30
Re: Struggling with Samba CUPS win printer issue

Quote:
Originally posted by VBAHole22


I have tried CUPS through localhost:631

For device I use windows printer via samba

Then for device URI i am using:
smb//:winuser:winpass@winboxname/sambaworkgroupname

For make I choose HP

The correct smb format is:

smb//:winuser:winpass@winboxname/printersharename
 
Old 06-16-2004, 07:08 PM   #7
VBAHole22
Member
 
Registered: May 2004
Location: Virginia
Distribution: Red Hat 9
Posts: 36

Original Poster
Rep: Reputation: 15
That is the third or fourth 'correct' format that I have seen.

The CUPS site claims it is :

smb:://usernameassword@workgroup/computername/printername


Guess I better try em all.

I'm concerned that the error message relates to my domain and port rather than something else. Almost like CUPS can't communicate with something through http??
 
Old 06-16-2004, 07:11 PM   #8
VBAHole22
Member
 
Registered: May 2004
Location: Virginia
Distribution: Red Hat 9
Posts: 36

Original Poster
Rep: Reputation: 15
When I try cupsd as root I get:

cupsd: Child exited with status 98!

That doesn't sound good
 
Old 06-16-2004, 11:18 PM   #9
mascdman
Member
 
Registered: Jun 2004
Location: Canada
Distribution: Ubuntu 6.06 LTS
Posts: 152

Rep: Reputation: 30
Another process is using the port that cupsd listens to (default 631)

Run netstat -anp | grep :631 as root. At the end of the line will be pid/process_name. If it's one of the rpc daemons, run /etc/init.d/nfs stop to kill it then try cupsd again.

--mascdman
 
Old 06-17-2004, 01:52 AM   #10
andrewdodsworth
Member
 
Registered: Oct 2003
Location: United Kingdom
Distribution: SuSE 10.0 - 11.4
Posts: 347

Rep: Reputation: 30
Quote:
Originally posted by VBAHole22
That is the third or fourth 'correct' format that I have seen.

The CUPS site claims it is :

smb:://usernameassword@workgroup/computername/printername


Guess I better try em all.

I'm concerned that the error message relates to my domain and port rather than something else. Almost like CUPS can't communicate with something through http??
My CUPS documentation only gives four variants - in fact only really 2 because 2 are without usernames and the other 2 with. The formats they give are :

smb://workgroup/server/sharename
smb://server/sharename
smb://userass@workgroup/server/sharename
smb://userass@server/sharename

The one that worked for me - and it works with any username is smb://userass@server/sharename.

From your post you said you were using:

smb://winuser:winpass@winboxname/sambaworkgroupname

which isn't in the list - hence my 'correction'.

I'm running Samba 2.2.28a by the way.
 
Old 06-17-2004, 07:51 AM   #11
VBAHole22
Member
 
Registered: May 2004
Location: Virginia
Distribution: Red Hat 9
Posts: 36

Original Poster
Rep: Reputation: 15
Thanks folks. I'll have to give those suggestions a try.

I'm fairly certain I need to get CUPS up and running before I test any configurations.

Must be that port collision that is causing the error message.

I'm gonna try the netstat tonight and see if that is the issue.

If so, I guess I need to change the order things start in because I think it would be nfs (whatever that is). I read that it picks a port at random among available ones and it must be picking my cups port before cups can.

Keep you posted. And thanks again
 
Old 06-17-2004, 09:21 PM   #12
mascdman
Member
 
Registered: Jun 2004
Location: Canada
Distribution: Ubuntu 6.06 LTS
Posts: 152

Rep: Reputation: 30
Okay, I spent a few hours this morning and I can now print from my Mandrake machine to a shared printer on my Windows 2000 machine. For some reason I'm apparently not running a windows name server (nmb is running, though...). You can run
Code:
smbclient -I <ip-address> -L <printer_computer_name> -U <user>
to see if you can view the shares available on your windows computer. For me, I have
Code:
[mascdman@odin samba][ :( 1 ]# smbclient -I 192.168.3.100 -L WIN2K -U guest         
Password: 
        Sharename      Type      Comment
        ---------      ----      -------
        SamsungQ       Printer   Samsung QL-5100A PCL
...snip...
Using webmin, I added the printer under Hardware -> Printer Administration -> Add a new printer using
Code:
   Name                      Printer
   Default Printer           yes
   Description               Remote Windows printer
   Remote Windows Server     192.168.3.100
   Printer                   SamsungQ
   User                      guest
   Password                  *************
   Workgroup                 FAMILY
Originally I used None for the printer driver, but this changed later (it's not a PostScript printer). I saved the configuration and try printing a test page -- Nothing happened. I could see my switch's LEDs blinking, so I opened ethereal and to watch the connection. In the middle of it all I noticed this:
Code:
No. Time      Source         Destination    Protocol  Info
7   0.012526  192.168.2.201  192.168.3.100  SMB       Session Setup AndX Request, User: anonymous
8   0.023284  192.168.3.100  192.168.2.201  SMB       Session Setup AndX Response
9   0.023638  192.168.2.201  192.168.2.100  SMB       Tree Connect AndX Request, Path: \\192.168.3.100\SAMSUNGQ
10  0.024462  192.168.3.100  192.168.2.201  SMB       Tree Connect AndX Response, Error: STATUS_ACCESS_DENIED
Why was it trying to connect as anonymous? Looking in /etc/cups/printers.conf I had
Code:
# Printer configuration file for CUPS v1.1.20
# Written by cupsd on Thu 17 Jun 2004 11:38:02 AM PDT
<DefaultPrinter Printer>
Info Mom's Printer
DeviceURI smb://FAMILY/192.168.3.100/SamsungQ
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</Printer>
Webmin didn't save the username and password I entered. I changed the DeviceURI to read
Code:
DeviceURI smb://guest:my_password_in_plaintext@FAMILY/192.168.3.100/SamsungQ
restarted cups, and tried printing another test page -- the printer printed raw PS commands. Well, at least it's printing something :P. After a lot of reading, I figured out I needed a CUPS driver and PPD file. My cups logs error messages to /var/log/cups/error_log but they weren't very helpful until I changed LogLevel = debug in /etc/cups/cupsd.conf. Google pointed me to LinuxPrinting.org which said that my printer could use the hpijs PPD. So I downloaded hpijs.ppd, placed it in /usr/share/cups/model and ran
Code:
[root@odin model][ :) ]# gzip hpijs.ppd
[root@odin model][ :) ]# lpadmin -pPrinter -P hpijs.ppd.gz
[root@odin model][ :) ]# ls /etc/cups/ppd
Printer.ppd
So the PPD was installed successfully. Next I had to install the hpijs server, which I found in printer-filters-1.0-133mdk. I tried another test page and this time it came out perfectly.

Hopefully this helps you or anyone else trying to get this to work.

--mascdman
 
Old 06-18-2004, 06:01 PM   #13
VBAHole22
Member
 
Registered: May 2004
Location: Virginia
Distribution: Red Hat 9
Posts: 36

Original Poster
Rep: Reputation: 15
I tried the netstat grep suggestion and the only results were 2 cups entries:
tcp 0 0 127.0.0.1:631 1203/cupsd
udp 0 0 0.0.0.0:631 1203/cupsd

But I still keep getting that child error

I'm clueless. I don't think there is any use going on with the smb printer setup if cups isn't even working for me.

But that is where I'm at now.
 
Old 06-18-2004, 08:47 PM   #14
mascdman
Member
 
Registered: Jun 2004
Location: Canada
Distribution: Ubuntu 6.06 LTS
Posts: 152

Rep: Reputation: 30
No, that's good: the netstat output shows cupsd is running. Now we just need to make sure that cups is configured properly and that it can access the printer. Do you have a /etc/cups/printers.conf file?

--mascdman
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Help printer from a samba shared printer from linux (using cups) epod69 Linux - Networking 3 12-04-2005 10:44 PM
cant print to win xp - attached HP3650 via samba/cups palmercabel Linux - Networking 7 07-31-2005 10:51 AM
samba + cups win xp brasuca Linux - Networking 5 05-28-2004 06:44 AM
printing from win 98 client to samba printer on red hat linux with cups shashi_lq Linux - Networking 0 12-10-2003 01:04 AM
Samba and Cups Printer Issue. gsmonk Linux - Networking 1 08-18-2003 03:01 PM


All times are GMT -5. The time now is 02:37 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration