LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Struggling with Samba CUPS win printer issue (https://www.linuxquestions.org/questions/linux-newbie-8/struggling-with-samba-cups-win-printer-issue-193970/)

VBAHole22 06-15-2004 08:25 PM

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?

mascdman 06-16-2004 12:03 AM

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

--mascdman

VBAHole22 06-16-2004 07:51 AM

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.

mascdman 06-16-2004 08:08 AM

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

--mascdman

VBAHole22 06-16-2004 08:24 AM

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.


:scratch:

andrewdodsworth 06-16-2004 04:15 PM

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

VBAHole22 06-16-2004 07:08 PM

That is the third or fourth 'correct' format that I have seen.

The CUPS site claims it is :

smb:://username:password@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??

VBAHole22 06-16-2004 07:11 PM

When I try cupsd as root I get:

cupsd: Child exited with status 98!

That doesn't sound good

mascdman 06-16-2004 11:18 PM

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

andrewdodsworth 06-17-2004 01:52 AM

Quote:

Originally posted by VBAHole22
That is the third or fourth 'correct' format that I have seen.

The CUPS site claims it is :

smb:://username:password@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://user:pass@workgroup/server/sharename
smb://user:pass@server/sharename

The one that worked for me - and it works with any username is smb://user:pass@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.

VBAHole22 06-17-2004 07:51 AM

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

mascdman 06-17-2004 09:21 PM

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

VBAHole22 06-18-2004 06:01 PM

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.

mascdman 06-18-2004 08:47 PM

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


All times are GMT -5. The time now is 07:24 PM.