Operating System - Linux
1756602 Members
3489 Online
108848 Solutions
New Discussion юеВ

Re: samba cups printing difficulty

 
roopa
Occasional Advisor

samba cups printing difficulty

Hi,
I am new to linux. I had cups configured and working fine until i started
running samba. After that i am not able to get any printouts. The
http://localhost:631 is working and this interface shows the job as
pending for ever. The printer state seem to be idle and accepting jobs.
But the printouts never came out. I checked the error log and tried to
make sense from it. I couldn't figure out anything even after changing the
loglevel to debug.
This is tail part of my error log


[26/Aug/2003:21:08:59 -0700] [Job 13] PageWidth = 612.0, PageLength =
792.0
D [26/Aug/2003:21:08:59 -0700] [Job 13] 0 %%Trailer
D [26/Aug/2003:21:08:59 -0700] [Job 13] Saw Trailer!
D [26/Aug/2003:21:08:59 -0700] [Job 13] Saw EOF!
D [26/Aug/2003:21:08:59 -0700] UpdateJob: job 13, file 0 is complete.
D [26/Aug/2003:21:08:59 -0700] StopJob: id = 13, force = 0
D [26/Aug/2003:21:08:59 -0700] StopJob: printer state is 3


Later i found that the printcap generated by cupsd.conf seems incomplete.
It has only the printer names. It does not have any other details. Could
this be the problem ?

Please help me out. I have been stuck in this for nearly a week now !!!

Velu.
14 REPLIES 14
Stuart Browne
Honored Contributor

Re: samba cups printing difficulty

Ok a few dumb questions.

After configuring samba, could you no longer send jobs from the command line using the 'lp' commands?

What are the printer settings you've used in your 'smb.conf'?

Now, as for the printcap comment, no. They are fine. As Cups doesn't *USE* a printcap, the incomplete values are valid. It's only there to provide a list of printers to older software which relies upon the /etc/printcap for the list of valid printers.

Depending on your configuration of Samba depends on which subsystem it will try to use to get the printer list, and hwo to send jobs to a printer.
One long-haired git at your service...
roopa
Occasional Advisor

Re: samba cups printing difficulty

Hi,

First of all, Thanks a lot for your reply.

>Ok a few dumb questions.

>After configuring samba, could you no longer >send jobs from the command line using the 'lp' >commands?

I can send jobs from command line. But the problem is, the jobs sent are pending for ever. It never seem to reach the printer. I can see the files spooled in /var/spool/samba. But none are printed.


>What are the printer settings you've used in >your 'smb.conf'?

[printers]
path = /var/spool/samba
writable = no
guest ok = yes
printable = Yes
browseable = No
printer admin = root, velu

[L2]
path = /var/spool/samba
printable = Yes
printer name = L2
oplocks = No

[Herberger]
path = /var/spool/samba
printable = Yes
printer name = Herberger
oplocks = No

These are my printer settings in smb.conf


Please let me know. Thanks

Velu.
Stuart Browne
Honored Contributor

Re: samba cups printing difficulty

Ok, can send jobs from the command line. Good.

This means that the printing sub-systems are working fine.

What is not working is the Samba configuration.

Lets have a look at that then.

> [printers]
> path = /var/spool/samba
> writable = no
> guest ok = yes
> printable = Yes
> browseable = No
> printer admin = root, velu
> [L2]
> path = /var/spool/samba
> printable = Yes
> printer name = L2
> oplocks = No
> [Herberger]
> path = /var/spool/samba
> printable = Yes
> printer name = Herberger
> oplocks = No

What you've not said are the GLOBAL printing settings, for instance the one called:

printing =

From memory, it defaults to 'LPRNG' style of printing. Try forcing this to 'CUPS' (as listed in 'man smb.conf'), restarting samba, and see if that fixes it.

If not, try forcing the 'lpq command' to be the same sort of command as you use on the command line.

Some more things to look at for you ;)
One long-haired git at your service...
roopa
Occasional Advisor

Re: samba cups printing difficulty

oops... I am sorry i forgot to paste the global section of my smb.conf

[global]
workgroup = SIMPHOENIX
encrypt passwords = Yes
log level = 1
max log size = 1000
wins support = Yes
hosts allow = localhost.localdomain
hosts deny = ALL
printing = cups
printcap name = cups


This is what i have in the global section.
It didn't work for this configuration.
Thanks once again
Velu.


Stuart Browne
Honored Contributor

Re: samba cups printing difficulty

Ok then, set the global 'print command =' setting to be an 'lp' command that prints jobs, using %s as the file name, and %p as the queue name. Somthing similar to this:

print command = lp -c -d%p -oraw %s && rm %s

This is what I use on a SCO OpenServer system, so you'll want to alter it slightly to suit Linux.

You'll not need the '-c' (as both Linux printing subsystems copy the job by default).
One long-haired git at your service...
Stuart Browne
Honored Contributor

Re: samba cups printing difficulty

Oops, forgot to mention. The '-oraw' is there 'cause the Windows Printing subsystem has already formatted the job, so it just needs to be spat out of the Linux queues, not processed further.
One long-haired git at your service...
roopa
Occasional Advisor

Re: samba cups printing difficulty

Hi,
I tried giving the print command. It is still not working. I tried looking in the error log of cups. I have given a snap shot of the error log where there might be a problem. Please have a look at the place where it says "No such file or directory" "/usr/lib/cups/backend///129.219.73.160"
This is what it is looking for. Is this the problem. I am not sure what it is looking for. Please let me know.

Thanks a lot for your immediate reply.
Velu.



print_job: requesting-user-name = 'root'
I [27/Aug/2003:22:44:17 -0700] Job 14 queued on 'L2' by 'root'.
D [27/Aug/2003:22:44:17 -0700] Job 14 hold_until = 0
D [27/Aug/2003:22:44:17 -0700] StartJob(14, 0x8092e98)
D [27/Aug/2003:22:44:17 -0700] StartJob() id = 14, file = 0/1
D [27/Aug/2003:22:44:17 -0700] job-sheets=none,none
D [27/Aug/2003:22:44:17 -0700] banner_page = 0
D [27/Aug/2003:22:44:17 -0700] StartJob: argv = "L2","14","root","column","1","","/var/spool/samba/d00014-001"
D [27/Aug/2003:22:44:17 -0700] StartJob: envp = "PATH=/usr/lib/cups/filter:/bin:/usr/bin","SOFTWARE=CUPS/1.1","USER=root","CHARSET=iso-8859-1","LANG=en_US","","PPD=/etc/cups/ppd/L2.ppd","CUPS_SERVERROOT=/etc/cups","RIP_MAX_CACHE=8m","TMPDIR=/var/spool/cups/tmp","CONTENT_TYPE=application/vnd.cups-raw","DEVICE_URI=//129.219.73.160","PRINTER=L2","CUPS_DATADIR=/usr/share/cups","CUPS_FONTPATH=/usr/share/cups/fonts","","",""
D [27/Aug/2003:22:44:17 -0700] StartJob: statusfds = 7, 8
D [27/Aug/2003:22:44:17 -0700] StartJob: filterfds[1] = 9, -1
D [27/Aug/2003:22:44:17 -0700] StartJob: backend = "/usr/lib/cups/backend///129.219.73.160"
D [27/Aug/2003:22:44:17 -0700] StartJob: filterfds[0] = -1, 10
D [27/Aug/2003:22:44:17 -0700] start_process("/usr/lib/cups/backend///129.219.73.160", 0xbfff06f0, 0xbffefba0, 9, 10, 8)
E [27/Aug/2003:22:44:17 -0700] PID 20820 stopped with status 22!
I [27/Aug/2003:22:44:17 -0700] Started backend /usr/lib/cups/backend///129.219.73.160 (PID -20820) for job 14.
D [27/Aug/2003:22:44:17 -0700] ProcessIPPRequest: 6 status_code=0
D [27/Aug/2003:22:44:17 -0700] [Job 14] /usr/lib/cups/backend///129.219.73.160: No such file or directory
Stuart Browne
Honored Contributor

Re: samba cups printing difficulty

Judging by those lines, I'd assume it requires that directory. What does the /usr/lib/cups/backend/ directory contain? Restart cups, and check that directory again, still no joy?

I would assume that sending a job from the command line would fail as well if this was a core directory.

All samba is doing is launching a print-job command-line when one comes in, the same as if you typed 'lp -d '.

Have you tried doing the standard 'lp' comamnd and looking at the logs to see if a normal job works/fails/spits out errors?
One long-haired git at your service...
roopa
Occasional Advisor

Re: samba cups printing difficulty

Judging by those lines, I'd assume it requires that directory. What does the /usr/lib/cups/backend/ directory contain? Restart cups, and check that directory again, still no joy?

[simphoenix@localhost simphoenix]$ cd /usr/lib/cups/backend/
[simphoenix@localhost backend]$ ls
canon http lpd parallel scsi smb usb
epson ipp ncp ptal serial socket
[simphoenix@localhost backend]$

This is what it contains.




I would assume that sending a job from the command line would fail as well if this was a core directory.

So far all the print job i gave are from command line using lp command.

All samba is doing is launching a print-job command-line when one comes in, the same as if you typed 'lp -d '.

Have you tried doing the standard 'lp' comamnd and looking at the logs to see if a normal job works/fails/spits out errors?

I am sorry. I dont understand what you mean by standard lp command. Please be more specific.

Thanks a lot
Velu.