Discussion:
[Samba] Re: Linux, Samba, and the Lexmark z53
Joel Hammer
2003-12-01 18:32:28 UTC
Permalink
I made some comments. Maybe the solution is easy.
##PRINTTOOL3## LOCAL
lexmarkz53:\ <---THIS AND LP BELOW SEEM TO BE DUPLICATES.
:sd=/var/spool/lpd/lexmarkz53:\
:mx#0:\
:sh:\
:lp=/dev/lp0:\
##PRINTTOOL3## LOCAL
z53-outfiles:\ <----THIS IS THE RAW SPOOL YOU'LL WANT YOUR WINDOWS CLIENTS TO USE
:sd=/var/spool/lpd/z53-outfiles:\
:mx#0:\
:sh:\
##PRINTTOOL3## LOCAL
lp:\
:sd=/var/spool/lpd/lp:\
:mx#0:\
:sh:\
:lp=/dev/lp0:\
# It should not be necessary to spell out the print system type unless
# bsd, sysv, plp, lprng, aix, hpux, qnx
printing = lprng <--WHICH IS IT? DO YOU HAVE LPRNG INSTALLED?
; printing = bsd
[lex]
comment = Raw Printer for Z53
path = /tmp
create mask = 0700
guest ok = Yes
hosts allow = 192.168.
printable = Yes
printing = lprng
print command = echo "Tried to print %s" > /tmp/junk.%s
# print command = /usr/bin/lpr -Plp %s; rm %s <---THIS IS IT, I THINK SEE NOTE BELOW
lpq command = /usr/bin/lpq -Plp > lprm command = /usr/bin/lprm -Plp %j
lppause command = /usr/bin/lpc hold lp %j
lpresume command = /usr/bin/lpc release lp %j
printer name = lp
printer driver = Lexmark Z53 Series ColorFine
printer driver location = \\VALOR\public\Adrian\Drivers Etc\lxkz53
share modes = No
****Note: IF you use lex as the printer for your windows clients, you are
sending the jobs to a queue which will try to reformat them again. The
lexmark filter assumes all input is either postscript, pdf, or plain text,
as you recall from the article I sent you.
So, lex is putting those "garbage files" (actually, they should be the
binary files for your printer if your windows clients are properly
configured) through enscript. Not a good thing.
So, I would:
Test my theory. cat one of those garbage files in /tmp/junk to /dev/lp0. It should print
OK. (might) I haven't tried this myself.
To solve the problem, either change lp to z53-outfiles OR select a
postscript driver on your windows side (HP laserjetthree plus or whatever
works for me.)
Other games to play would be to use a postscript driver on your windows
side, and then see if you can read them with gv after they land in /tmp.
BTW, I tried to store my lexmark drivers on the server, but every time I
downloaded the drivers it damaged some system windows file and windows
wouldn't boot after that.
Joel
Joel Hammer
2003-12-01 18:32:28 UTC
Permalink
Actually, never having used bsd or cups, I wouldn't really know.
If you have checkpc and it works, you likely have lprng. RedHat
7.1 used lprng.
Since printing goes for two lines and stops, you may fine something of
interest in the status files in your print queue.
Have you tried just cat'ing the file in the /tmp spool to lp0?
The type of printing software you have on linux won't affect the cat'ing
experiment.
Joel
Joel Hammer
2003-12-01 18:32:28 UTC
Permalink
Some comments, in no particular order:
You are going to have to start reading the logs to see what is going on.
I would remove valid users from your printer definition.
Make sure security=share in the global section.
I would use the real name of the print queue in place of %p.
The first issue to solve is why you are not getting the files transferred
from you windows clients to the /tmp spool directory. To that end, I would
delete the rm %s from the printer command. Make sure there is a real guest
account. I use ftp.
The logs may help. (/var/log/messages, /var/log/samba,
/usr/local/samba/var/, and the status files in your printer queue.
Under this setup the printer icon in WinXP actually has the word "ready" written under it, which was never there before... but printing a test page yields only the result described earlier.
NOTE: lpc is in /usr/sbin.
Joel
Warning - permissions of '/var/spool/lpd/lexmarkz53' are 0777, not 0700
So if having checkpc implies having lprng, then that's me. Also if Redhat 7.1 uses it, it is at least reasonbable to suspect that RH 7.2 does as well.
[lex]
printing = lprng
printer = z53-outfiles
printer name = z53-outfiles
comment = Raw Printer for Z53
path = /tmp
create mask = 0700
guest ok = yes
hosts allow = 192.168.
valid users = smbuser
printable = yes
; print command = echo "Tried to print %s" > /tmp/junk.%s
print command = /usr/bin/lpr -P %p %s; rm %s
lpq command = /usr/bin/lpq -P %p
lprm command = /usr/bin/lprm -P %p %j
lppause command = /usr/bin/lpc hold %p %j
lpresume command = /usr/bin/lpc release %p %j
printer driver = Lexmark Z53 Series ColorFine
; printer driver location = \\VALOR\public\Adrian\Drivers Etc\lxkz53
share modes = No
Now, I am not sure what the difference between "printer" and "printer name" is, but I set them both to the queue you suggested "z53-outfiles", and changed the explicit references to "lp" to the meta "%p" which my reading suggests interpolates either "printer" or "printer name", but I do not know which (so I made them the same).
Under this setup the printer icon in WinXP actually has the word "ready" written under it, which was never there before... but printing a test page yields only the result described earlier.
Also it should be mentioned that any attempt to print from any other WinXP application gives an "Invalid HANDLE error", which results in no print attempted.
So at the moment, my issues is how to get WinXP to thing the print was successful, which I would think is at least correlated with getting the smbpm.XXXXX file to appear in /tmp, and maybe even printed... but for now, I can not even get the garbage files that I was seeing a few weeks ago (then under some strange configuration involving BSD and other things lost in the annals of history now).
Thanks again for all of your help,
-Adrian
If you have checkpc and it works, you likely have lprng. RedHat
7.1 used lprng.
Since printing goes for two lines and stops, you may fine something of
interest in the status files in your print queue.
Have you tried just cat'ing the file in the /tmp spool to lp0?
The type of printing software you have on linux won't affect the cat'ing
experiment.
Joel
---------------------------------
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
Joel Hammer
2003-12-01 18:32:29 UTC
Permalink
SO, the situation is, as I understand it:
You are using XP as a client.
You have successfully installed the lexmark drivers on the XP client.
When you print from the XP client, you get no error messages.
The file size in the "spool" directory is zero after you print from XP.

Comments:
Let's define two terms, just for our own use.
I think the term "spool directory" is unclear. Let's call the "spool"
directory the place where samba stores the print file received from the
XP client, before samba invokes lpr to print it. When lpr is invoked, the
file is transferred to the "queue" directory specified in /etc/printcap. I
use /tmp as my "spool" directory because everyone can write to it but only
the user can remove his own files. And, if things are going properly,
the tmp directory is periodically cleaned out for you, usually during
boot up. All these things are good. These are the permissions of my
/tmp directory.
drwxrwxrwt 43 root root 14336 May 12 08:18 tmp

Now, it it a BAD idea to use the queue directory (specified in
/etc/printcap) for your spool directory. If you set your permissions with
checkpc -f (which you should do), very likely the samba user will not be
able to write to that directory, and the file transfer will fail. SO,
I would put your spool directory someplace anyone can write to, like
/tmp, and try to print again from XP. You might make a special /SPOOL
directory with chmod 777 just to make this debugging easier. Leave out
the rm command from your print command and it would help to use
print command = echo "Tried to print %s at `date` >> /tmp/junklog

Don't forget to upate your path command in your printer share, either.
You did follow my suggest to use the actual name of the printer instead of
%p ?

Please do the things I suggest you do and tell me the exact results.

Then, try printing.

As an further note, I think your smb.conf file is the original file with the
distro and you just modified it. For debugging, you might consider a very
stripped now version of this file. Who knows what evil is lurking elsewhere
in your smb.conf file.

You do run testparm after you modify smb.conf?

Joel
Hi,
Let me try to address the things you suggest in order...
[2002/05/11 07:28:23, 0] rpc_server/srv_spoolss_nt.c:_spoolss_fcpn(4663)
_spoolss_fcpn: Invalid handle (OTHER)
[2002/05/11 07:28:23, 0] rpc_server/srv_spoolss_nt.c:close_printer_handle(257)
close_printer_handle: Invalid handle (OTHER)
These messages are correlated with starting smbd though, and not with the printing. Why they appear in the file "harmony.log" is completely beyond me though... as starting the smbd daemon seems to have nothing in particular to do with the client "harmony" (perhaps this is because "harmony" has the printer "installed" and so there is some communication at startup time?) The log for smbd itself "log.smbd" is not written to. The last log you mentioned was in /usr/local/samba/var. I do not have a /usr/local/samba directory. Can you think of where else the information might be which you thought I might find there?
I have deleted those "rm" statements. This now allows me to see the print files accumulate in the spool directory, but they still are size 0. The last thing is your mentioning the impression that I had successfully printed something. Looking back on what I wrote, I was terribly unclear. The "same thing" I was referring back to was in fact "nothing". What I meant by that passage was that I got the same message from WinXP when it failed.
I am not sure about the "real" guest account. This smbuser is what is used in the "samba faq" and is what I use on the same machine for file sharing which works great. It is also what I used back when I was using the cannon400s. This does however raise the issue that one or the other of the programs called under the smbuser id might not have permission to do something they need to do. For example the spool directory was perm 700, which was not allowing me to write the temp files to it. Thinking on it now, is it possible that since the stuff like "status" in the spool directory is perm 700 and owned by root (actually lp) that this is causing some headache when samba tries to update those files? --- wait... lemmie check --- ... doing experiment....
... nope. Set all those perms to 666, and still no visible improvement. Ok... setting them back.
But this seems to me a clue yes? Even the queue status file is not being written to? What could this mean?
Thanks again and again for all of your help... are you at work? Don't you ever get to go home?
_adrian
You are going to have to start reading the logs to see what is going on.
I would remove valid users from your printer definition.
Make sure security=share in the global section.
I would use the real name of the print queue in place of %p.
The first issue to solve is why you are not getting the files transferred
from you windows clients to the /tmp spool directory. To that end, I would
delete the rm %s from the printer command. Make sure there is a real guest
account. I use ftp.
The logs may help. (/var/log/messages, /var/log/samba,
/usr/local/samba/var/, and the status files in your printer queue.
Under this setup the printer icon in WinXP actually has the word "ready" written under it, which was never there before... but printing a test page yields only the result described earlier.
NOTE: lpc is in /usr/sbin.
Joel
Warning - permissions of '/var/spool/lpd/lexmarkz53' are 0777, not 0700
So if having checkpc implies having lprng, then that's me. Also if Redhat 7.1 uses it, it is at least reasonbable to suspect that RH 7.2 does as well.
[lex]
printing = lprng
printer = z53-outfiles
printer name = z53-outfiles
comment = Raw Printer for Z53
path = /tmp
create mask = 0700
guest ok = yes
hosts allow = 192.168.
valid users = smbuser
printable = yes
; print command = echo "Tried to print %s" > /tmp/junk.%s
print command = /usr/bin/lpr -P %p %s; rm %s
lpq command = /usr/bin/lpq -P %p
lprm command = /usr/bin/lprm -P %p %j
lppause command = /usr/bin/lpc hold %p %j
lpresume command = /usr/bin/lpc release %p %j
printer driver = Lexmark Z53 Series ColorFine
; printer driver location = \\VALOR\public\Adrian\Drivers Etc\lxkz53
share modes = No
Now, I am not sure what the difference between "printer" and "printer name" is, but I set them both to the queue you suggested "z53-outfiles", and changed the explicit references to "lp" to the meta "%p" which my reading suggests interpolates either "printer" or "printer name", but I do not know which (so I made them the same).
Under this setup the printer icon in WinXP actually has the word "ready" written under it, which was never there before... but printing a test page yields only the result described earlier.
Also it should be mentioned that any attempt to print from any other WinXP application gives an "Invalid HANDLE error", which results in no print attempted.
So at the moment, my issues is how to get WinXP to thing the print was successful, which I would think is at least correlated with getting the smbpm.XXXXX file to appear in /tmp, and maybe even printed... but for now, I can not even get the garbage files that I was seeing a few weeks ago (then under some strange configuration involving BSD and other things lost in the annals of history now).
Thanks again for all of your help,
-Adrian
Joel Hammer wrote: Actually, never having used bsd or cups, I wouldn't really know.
If you have checkpc and it works, you likely have lprng. RedHat
7.1 used lprng.
Since printing goes for two lines and stops, you may fine something of
interest in the status files in your print queue.
Have you tried just cat'ing the file in the /tmp spool to lp0?
The type of printing software you have on linux won't affect the cat'ing
experiment.
Joel
---------------------------------
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
---------------------------------
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
Joel Hammer
2003-12-01 18:32:29 UTC
Permalink
This post might be inappropriate. Click to display it.
Joel Hammer
2003-12-01 18:32:29 UTC
Permalink
It always feels good when the pain stops.

But, I am still concerned about permissions on your queue directory. Here
are mine:
drwx--S--- 2 daemon lp 1024 Nov 25 00:07 Win4LinZ53
These are set by checkpc -f

I would now try to run the lexmark setup program as root from your linux
box,
lexmarkz53

This will be a surprise to people used to lousy support for printers
in linux.

I have found no bad effects in color printing with the linux box being
the print server. BUT, I have not tried photographic quality color
printing. This requies two way communication with the priner, I THINK, and
thus is impossible if the printer hangs off the linux box and you are
printing from XP.

Just think, you are now qualified to help other people set up printing on a
samba server!

Joel
Doh, I am becomming confused.
lexmarkz53:\
:sd=/var/spool/lpd/lexmarkz53:\
:mx#0:\
:sh:\
:lp=/dev/lp0:\
Which looks like it will do the trick (the file z53.sh is the converter from ps to z53-speak yes? I recall this from the file you sent me a while ago...)
However!
I changed the smb.conf file to point at this printer queue: and it works. Yay! I can print out of my printer from my XP machine.
So maybe I should just chuck the lexmark driver on the XP side? Looks like PS is the way to go. You said you came to a similar conclusion in such a setup? Did you have any problems with the color quality of the resulting printout?
So life is good, and things work...
Thus maybe I should be sending your mother some flowers on your behalf?
Thanks so much for all of your time on this... I realize this was a pain, but I learned a lot for doing it.
-Adrian
Does the lexmark work attached to the XP machine?
OK. Your problems on the window side appears cleared up. I had a similar
problem with the drivers for windows and the lexmark, and I am using the
laserjet driver right now to print from an XP machine.
Lexmark supplies a linux driver, so get that, install it, if you haven't
already, and you should be getting close to home. The lexmark driver takes a
postscript file and converts it into a format its printer understands. You
will also have a control program with it that allows to you graphically
control the printer settings from linux and also see how much ink is left in
the printer.
I am not clear what you mean by permissions are set to 700 on the queue.
The queue is supposed to be /tmp, which has very different permissions, and
the permission in the queue directory (/var/spool/lpd/printers) is quite
different, too. Do you mean the create mask in your share definition?
Joel
Hi there. Ok, a lot happened last night, so let me respond to your suggestions here, and then tell you what new things I have leadned.
First off, there _were_ problems on the XP side. XP said it couldn't print a test page if I tried to do that, or if I tried to print from an application it said that there was an "invalid handle" without ever describing what that meant.
This whole spool/queue business was totally unclear to me, so first of all thanks for clearing me up on that. I went through and implemented your suggestions, the spool is /tmp again, and the queue is back to permissions=700. Failed print attempts from WinXP now result in files of size zero appearing in /tmp.
I had not heard of testparm. Cool. Wish I had known about that earlier... :( Live and learn. I don't know how I made it even this far without it.
Similarly checkpc, also very cool. Also thanks.
Then I created a chopped down smb.conf file, and away I went.
The net result was that nothing really changed in the final situation. I had length zero files in /tmp.
But then, I had a realization.
The line "printer driver = Lexmark Z53 Series ColorFine" appears in my smb.conf file. I assumed that this was indicating that WinXP should load this driver automatically. But just to see what happened, I commented this line out. (This line appeared in a post you made to some printing related news group about six months ago on the very topic of Samba and Lexmark z53). I was right, now WinXP could not autoload the driver. So I had to "select the driver from a list", and when I did I got the error message "Could not complete, can not comunicate with printer, printer is either disconnected from the server or turned off". Wow I thought, why didn't it give me this message when it was autoloading? So it occured to me that the driver was _NOT_ being successfully loaded before, though no message to this effect was being generated.
So to further test my hypothesis, I went and loaded a different driver, the HP Laserjet III+ driver you mentioned a few mails ago. That driver _did_ load, and then when I printed VIOLA! there was a non zero sized file in my /tmp directory! And it was in postscript! Yay. So now all I gotta do is print it...
Downloading the latest Lexmark z53 driver from Lexmark did not seem to solve the problem, though I was warned that the driver was not "digitally signed" for compatability with WinXP. So maybe this was the core issue?
The down side is that nothing came out of my printer anyhow. Since at the time of the experiment I was printing to the raw print printer in my /etc/printcap file, shouldn't I have gotten reams of ASCII (postscript) out of my printer?
I have included my current smb.conf file (stripped down as you suggested). What should I be doing next? Should I just stick with this postscript driver for the printer?
Cheers!
and thanks thanks thanks
-Adrian
I had changed %p to the queue name everywhere.
You are using XP as a client.
You have successfully installed the lexmark drivers on the XP client.
When you print from the XP client, you get no error messages.
The file size in the "spool" directory is zero after you print from XP.
Let's define two terms, just for our own use.
I think the term "spool directory" is unclear. Let's call the "spool"
directory the place where samba stores the print file received from the
XP client, before samba invokes lpr to print it. When lpr is invoked, the
file is transferred to the "queue" directory specified in /etc/printcap. I
use /tmp as my "spool" directory because everyone can write to it but only
the user can remove his own files. And, if things are going properly,
the tmp directory is periodically cleaned out for you, usually during
boot up. All these things are good. These are the permissions of my
/tmp directory.
drwxrwxrwt 43 root root 14336 May 12 08:18 tmp
Now, it it a BAD idea to use the queue directory (specified in
/etc/printcap) for your spool directory. If you set your permissions with
checkpc -f (which you should do), very likely the samba user will not be
able to write to that directory, and the file transfer will fail. SO,
I would put your spool directory someplace anyone can write to, like
/tmp, and try to print again from XP. You might make a special /SPOOL
directory with chmod 777 just to make this debugging easier. Leave out
the rm command from your print command and it would help to use
print command = echo "Tried to print %s at `date` >> /tmp/junklog
Don't forget to upate your path command in your printer share, either.
You did follow my suggest to use the actual name of the printer instead of
%p ?
Please do the things I suggest you do and tell me the exact results.
Then, try printing.
As an further note, I think your smb.conf file is the original file with the
distro and you just modified it. For debugging, you might consider a very
stripped now version of this file. Who knows what evil is lurking elsewhere
in your smb.conf file.
You do run testparm after you modify smb.conf?
Joel
Hi,
Let me try to address the things you suggest in order...
[2002/05/11 07:28:23, 0] rpc_server/srv_spoolss_nt.c:_spoolss_fcpn(4663)
_spoolss_fcpn: Invalid handle (OTHER)
[2002/05/11 07:28:23, 0] rpc_server/srv_spoolss_nt.c:close_printer_handle(257)
close_printer_handle: Invalid handle (OTHER)
These messages are correlated with starting smbd though, and not with the printing. Why they appear in the file "harmony.log" is completely beyond me though... as starting the smbd daemon seems to have nothing in particular to do with the client "harmony" (perhaps this is because "harmony" has the printer "installed" and so there is some communication at startup time?) The log for smbd itself "log.smbd" is not written to. The last log you mentioned was in /usr/local/samba/var. I do not have a /usr/local/samba directory. Can you think of where else the information might be which you thought I might find there?
I have deleted those "rm" statements. This now allows me to see the print files accumulate in the spool directory, but they still are size 0. The last thing is your mentioning the impression that I had successfully printed something. Looking back on what I wrote, I was terribly unclear. The "same thing" I was referring back to was in fact "nothing". What I meant by that passage was that I got the same message from WinXP when it failed.
I am not sure about the "real" guest account. This smbuser is what is used in the "samba faq" and is what I use on the same machine for file sharing which works great. It is also what I used back when I was using the cannon400s. This does however raise the issue that one or the other of the programs called under the smbuser id might not have permission to do something they need to do. For example the spool directory was perm 700, which was not allowing me to write the temp files to it. Thinking on it now, is it possible that since the stuff like "status" in the spool directory is perm 700 and owned by root (actually lp) that this is causing some headache when samba tries to update those files? --- wait... lemmie check --- ... doing experiment....
... nope. Set all those perms to 666, and still no visible improvement. Ok... setting them back.
But this seems to me a clue yes? Even the queue status file is not being written to? What could this mean?
Thanks again and again for all of your help... are you at work? Don't you ever get to go home?
_adrian
You are going to have to start reading the logs to see what is going on.
I would remove valid users from your printer definition.
Make sure security=share in the global section.
I would use the real name of the print queue in place of %p.
The first issue to solve is why you are not getting the files transferred
from you windows clients to the /tmp spool directory. To that end, I would
delete the rm %s from the printer command. Make sure there is a real guest
account. I use ftp.
The logs may help. (/var/log/messages, /var/log/samba,
/usr/local/samba/var/, and the status files in your printer queue.
Under this setup the printer icon in WinXP actually has the word "ready" written under it, which was never there before... but printing a test page yields only the result described earlier.
NOTE: lpc is in /usr/sbin.
Joel
Warning - permissions of '/var/spool/lpd/lexmarkz53' are 0777, not 0700
So if having checkpc implies having lprng, then that's me. Also if Redhat 7.1 uses it, it is at least reasonbable to suspect that RH 7.2 does as well.
[lex]
printing = lprng
printer = z53-outfiles
printer name = z53-outfiles
comment = Raw Printer for Z53
path = /tmp
create mask = 0700
guest ok = yes
hosts allow = 192.168.
valid users = smbuser
printable = yes
; print command = echo "Tried to print %s" > /tmp/junk.%s
print command = /usr/bin/lpr -P %p %s; rm %s
lpq command = /usr/bin/lpq -P %p
lprm command = /usr/bin/lprm -P %p %j
lppause command = /usr/bin/lpc hold %p %j
lpresume command = /usr/bin/lpc release %p %j
printer driver = Lexmark Z53 Series ColorFine
; printer driver location = \\VALOR\public\Adrian\Drivers Etc\lxkz53
share modes = No
Now, I am not sure what the difference between "printer" and "printer name" is, but I set them both to the queue you suggested "z53-outfiles", and changed the explicit references to "lp" to the meta "%p" which my reading suggests interpolates either "printer" or "printer name", but I do not know which (so I made them the same).
Under this setup the printer icon in WinXP actually has the word "ready" written under it, which was never there before... but printing a test page yields only the result described earlier.
Also it should be mentioned that any attempt to print from any other WinXP application gives an "Invalid HANDLE error", which results in no print attempted.
So at the moment, my issues is how to get WinXP to thing the print was successful, which I would think is at least correlated with getting the smbpm.XXXXX file to appear in /tmp, and maybe even printed... but for now, I can not even get the garbage files that I was seeing a few weeks ago (then under some strange configuration involving BSD and other things lost in the annals of history now).
Thanks again for all of your help,
-Adrian
Joel Hammer wrote: Actually, never having used bsd or cups, I wouldn't really know.
If you have checkpc and it works, you likely have lprng. RedHat
7.1 used lprng.
Since printing goes for two lines and stops, you may fine something of
interest in the status files in your print queue.
Have you tried just cat'ing the file in the /tmp spool to lp0?
The type of printing software you have on linux won't affect the cat'ing
experiment.
Joel
---------------------------------
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
---------------------------------
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
---------------------------------
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
Content-Description: smb.conf
workgroup = HOME
server string = Samba Server
printcap name = /etc/printcap
load printers = yes
printing = lprng
guest account = smbuser
log file = /var/log/samba/%m.log
security = share
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
[public]
comment = Public Stuff
path = /pub
public = yes
writable = yes
printable = no
[cdrom]
comment = CDROM Drive
path = /mnt/cdrom
public = yes
writable = no
printable = no
[lex]
printer name = z53-outfiles
comment = Raw Printer for Z53
printing = lprng
printer = z53-outfiles
path = /tmp
create mask = 0700
guest ok = yes
; hosts allow = 192.168.
; valid users = smbuser
printable = yes
; print command = echo "Tried to print %s" > /tmp/junk.%s
; print command = /usr/bin/lpr -P z53-outfiles %s; rm %s
print command = /usr/bin/lpr -P z53-outfiles %s
lpq command = /usr/bin/lpq -P z53-outfiles
lprm command = /usr/bin/lprm -P z53-outfiles %j
lppause command = /usr/sbin/lpc hold z53-outfiles %j
lpresume command = /usr/sbin/lpc release z53-outfiles %j
; printer driver = Lexmark Z53 Series ColorFine
; printer driver location = \\VALOR\public\Adrian\Drivers Etc\lxkz53
share modes = No
---------------------------------
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
Joel Hammer
2003-12-01 18:32:29 UTC
Permalink
Well, very happy to see it all work out for you.

I spent several weeks getting this thing to work the first time. I had the
lexmark drivers working ok from a window98 box but they wouldn't work from
an XP box or from windows98 running over win4lin (drivers wouldn't load in
either case). That was where the laserjet idea came from. Somebody suggested
that particular driver (on a mailing list) and things have worked fine ever
since.

Joel
Ok, so I set the sticky bit for the queue directory. Did not seem to make any difference... but you never know. I did run the lexmark printer program, and it really was exciting. It is like they care. Cool. In fact I noticed that if I set the printing to max resolution (2400dpi) I get clean perfect printing from everywhere... so it's actually the opposite of what you suggested. Hmm. Anyhow, if I print in "standard" mode (600dpi) then direct prints from the samba/printer-server are much cleaner than those from the WinXP machine (and the Win98 machine which I have not until now mentioned... that was a snap once the WinXP machine was working... my lady's laptop).
As for helping others... I am not sure about that... you never know though. Maybe someone will have just the exact question, and there I will be with the answer.
Thanks again so much for all of your patient help. You are truly a kind person.
-Adrian
But, I am still concerned about permissions on your queue directory. Here
drwx--S--- 2 daemon lp 1024 Nov 25 00:07 Win4LinZ53
These are set by checkpc -f
I would now try to run the lexmark setup program as root from your linux
box,
lexmarkz53
This will be a surprise to people used to lousy support for printers
in linux.
I have found no bad effects in color printing with the linux box being
the print server. BUT, I have not tried photographic quality color
printing. This requies two way communication with the priner, I THINK, and
thus is impossible if the printer hangs off the linux box and you are
printing from XP.
Just think, you are now qualified to help other people set up printing on a
samba server!
Joel
Doh, I am becomming confused.
lexmarkz53:\
:sd=/var/spool/lpd/lexmarkz53:\
:mx#0:\
:sh:\
:lp=/dev/lp0:\
Which looks like it will do the trick (the file z53.sh is the converter from ps to z53-speak yes? I recall this from the file you sent me a while ago...)
However!
I changed the smb.conf file to point at this printer queue: and it works. Yay! I can print out of my printer from my XP machine.
So maybe I should just chuck the lexmark driver on the XP side? Looks like PS is the way to go. You said you came to a similar conclusion in such a setup? Did you have any problems with the color quality of the resulting printout?
So life is good, and things work...
Thus maybe I should be sending your mother some flowers on your behalf?
Thanks so much for all of your time on this... I realize this was a pain, but I learned a lot for doing it.
-Adrian
Joel Hammer wrote: Hmmm...
Does the lexmark work attached to the XP machine?
OK. Your problems on the window side appears cleared up. I had a similar
problem with the drivers for windows and the lexmark, and I am using the
laserjet driver right now to print from an XP machine.
Lexmark supplies a linux driver, so get that, install it, if you haven't
already, and you should be getting close to home. The lexmark driver takes a
postscript file and converts it into a format its printer understands. You
will also have a control program with it that allows to you graphically
control the printer settings from linux and also see how much ink is left in
the printer.
I am not clear what you mean by permissions are set to 700 on the queue.
The queue is supposed to be /tmp, which has very different permissions, and
the permission in the queue directory (/var/spool/lpd/printers) is quite
different, too. Do you mean the create mask in your share definition?
Joel
Hi there. Ok, a lot happened last night, so let me respond to your suggestions here, and then tell you what new things I have leadned.
First off, there _were_ problems on the XP side. XP said it couldn't print a test page if I tried to do that, or if I tried to print from an application it said that there was an "invalid handle" without ever describing what that meant.
This whole spool/queue business was totally unclear to me, so first of all thanks for clearing me up on that. I went through and implemented your suggestions, the spool is /tmp again, and the queue is back to permissions=700. Failed print attempts from WinXP now result in files of size zero appearing in /tmp.
I had not heard of testparm. Cool. Wish I had known about that earlier... :( Live and learn. I don't know how I made it even this far without it.
Similarly checkpc, also very cool. Also thanks.
Then I created a chopped down smb.conf file, and away I went.
The net result was that nothing really changed in the final situation. I had length zero files in /tmp.
But then, I had a realization.
The line "printer driver = Lexmark Z53 Series ColorFine" appears in my smb.conf file. I assumed that this was indicating that WinXP should load this driver automatically. But just to see what happened, I commented this line out. (This line appeared in a post you made to some printing related news group about six months ago on the very topic of Samba and Lexmark z53). I was right, now WinXP could not autoload the driver. So I had to "select the driver from a list", and when I did I got the error message "Could not complete, can not comunicate with printer, printer is either disconnected from the server or turned off". Wow I thought, why didn't it give me this message when it was autoloading? So it occured to me that the driver was _NOT_ being successfully loaded before, though no message to this effect was being generated.
So to further test my hypothesis, I went and loaded a different driver, the HP Laserjet III+ driver you mentioned a few mails ago. That driver _did_ load, and then when I printed VIOLA! there was a non zero sized file in my /tmp directory! And it was in postscript! Yay. So now all I gotta do is print it...
Downloading the latest Lexmark z53 driver from Lexmark did not seem to solve the problem, though I was warned that the driver was not "digitally signed" for compatability with WinXP. So maybe this was the core issue?
The down side is that nothing came out of my printer anyhow. Since at the time of the experiment I was printing to the raw print printer in my /etc/printcap file, shouldn't I have gotten reams of ASCII (postscript) out of my printer?
I have included my current smb.conf file (stripped down as you suggested). What should I be doing next? Should I just stick with this postscript driver for the printer?
Cheers!
and thanks thanks thanks
-Adrian
I had changed %p to the queue name everywhere.
You are using XP as a client.
You have successfully installed the lexmark drivers on the XP client.
When you print from the XP client, you get no error messages.
The file size in the "spool" directory is zero after you print from XP.
Let's define two terms, just for our own use.
I think the term "spool directory" is unclear. Let's call the "spool"
directory the place where samba stores the print file received from the
XP client, before samba invokes lpr to print it. When lpr is invoked, the
file is transferred to the "queue" directory specified in /etc/printcap. I
use /tmp as my "spool" directory because everyone can write to it but only
the user can remove his own files. And, if things are going properly,
the tmp directory is periodically cleaned out for you, usually during
boot up. All these things are good. These are the permissions of my
/tmp directory.
drwxrwxrwt 43 root root 14336 May 12 08:18 tmp
Now, it it a BAD idea to use the queue directory (specified in
/etc/printcap) for your spool directory. If you set your permissions with
checkpc -f (which you should do), very likely the samba user will not be
able to write to that directory, and the file transfer will fail. SO,
I would put your spool directory someplace anyone can write to, like
/tmp, and try to print again from XP. You might make a special /SPOOL
directory with chmod 777 just to make this debugging easier. Leave out
the rm command from your print command and it would help to use
print command = echo "Tried to print %s at `date` >> /tmp/junklog
Don't forget to upate your path command in your printer share, either.
You did follow my suggest to use the actual name of the printer instead of
%p ?
Please do the things I suggest you do and tell me the exact results.
Then, try printing.
As an further note, I think your smb.conf file is the original file with the
distro and you just modified it. For debugging, you might consider a very
stripped now version of this file. Who knows what evil is lurking elsewhere
in your smb.conf file.
You do run testparm after you modify smb.conf?
Joel
Hi,
Let me try to address the things you suggest in order...
[2002/05/11 07:28:23, 0] rpc_server/srv_spoolss_nt.c:_spoolss_fcpn(4663)
_spoolss_fcpn: Invalid handle (OTHER)
[2002/05/11 07:28:23, 0] rpc_server/srv_spoolss_nt.c:close_printer_handle(257)
close_printer_handle: Invalid handle (OTHER)
These messages are correlated with starting smbd though, and not with the printing. Why they appear in the file "harmony.log" is completely beyond me though... as starting the smbd daemon seems to have nothing in particular to do with the client "harmony" (perhaps this is because "harmony" has the printer "installed" and so there is some communication at startup time?) The log for smbd itself "log.smbd" is not written to. The last log you mentioned was in /usr/local/samba/var. I do not have a /usr/local/samba directory. Can you think of where else the information might be which you thought I might find there?
I have deleted those "rm" statements. This now allows me to see the print files accumulate in the spool directory, but they still are size 0. The last thing is your mentioning the impression that I had successfully printed something. Looking back on what I wrote, I was terribly unclear. The "same thing" I was referring back to was in fact "nothing". What I meant by that passage was that I got the same message from WinXP when it failed.
I am not sure about the "real" guest account. This smbuser is what is used in the "samba faq" and is what I use on the same machine for file sharing which works great. It is also what I used back when I was using the cannon400s. This does however raise the issue that one or the other of the programs called under the smbuser id might not have permission to do something they need to do. For example the spool directory was perm 700, which was not allowing me to write the temp files to it. Thinking on it now, is it possible that since the stuff like "status" in the spool directory is perm 700 and owned by root (actually lp) that this is causing some headache when samba tries to update those files? --- wait... lemmie check --- ... doing experiment....
... nope. Set all those perms to 666, and still no visible improvement. Ok... setting them back.
But this seems to me a clue yes? Even the queue status file is not being written to? What could this mean?
Thanks again and again for all of your help... are you at work? Don't you ever get to go home?
_adrian
You are going to have to start reading the logs to see what is going on.
I would remove valid users from your printer definition.
Make sure security=share in the global section.
I would use the real name of the print queue in place of %p.
The first issue to solve is why you are not getting the files transferred
from you windows clients to the /tmp spool directory. To that end, I would
delete the rm %s from the printer command. Make sure there is a real guest
account. I use ftp.
The logs may help. (/var/log/messages, /var/log/samba,
/usr/local/samba/var/, and the status files in your printer queue.
Under this setup the printer icon in WinXP actually has the word "ready" written under it, which was never there before... but printing a test page yields only the result described earlier.
NOTE: lpc is in /usr/sbin.
Joel
Warning - permissions of '/var/spool/lpd/lexmarkz53' are 0777, not 0700
So if having checkpc implies having lprng, then that's me. Also if Redhat 7.1 uses it, it is at least reasonbable to suspect that RH 7.2 does as well.
[lex]
printing = lprng
printer = z53-outfiles
printer name = z53-outfiles
comment = Raw Printer for Z53
path = /tmp
create mask = 0700
guest ok = yes
hosts allow = 192.168.
valid users = smbuser
printable = yes
; print command = echo "Tried to print %s" > /tmp/junk.%s
print command = /usr/bin/lpr -P %p %s; rm %s
lpq command = /usr/bin/lpq -P %p
lprm command = /usr/bin/lprm -P %p %j
lppause command = /usr/bin/lpc hold %p %j
lpresume command = /usr/bin/lpc release %p %j
printer driver = Lexmark Z53 Series ColorFine
; printer driver location = \\VALOR\public\Adrian\Drivers Etc\lxkz53
share modes = No
Now, I am not sure what the difference between "printer" and "printer name" is, but I set them both to the queue you suggested "z53-outfiles", and changed the explicit references to "lp" to the meta "%p" which my reading suggests interpolates either "printer" or "printer name", but I do not know which (so I made them the same).
Under this setup the printer icon in WinXP actually has the word "ready" written under it, which was never there before... but printing a test page yields only the result described earlier.
Also it should be mentioned that any attempt to print from any other WinXP application gives an "Invalid HANDLE error", which results in no print attempted.
So at the moment, my issues is how to get WinXP to thing the print was successful, which I would think is at least correlated with getting the smbpm.XXXXX file to appear in /tmp, and maybe even printed... but for now, I can not even get the garbage files that I was seeing a few weeks ago (then under some strange configuration involving BSD and other things lost in the annals of history now).
Thanks again for all of your help,
-Adrian
Joel Hammer wrote: Actually, never having used bsd or cups, I wouldn't really know.
If you have checkpc and it works, you likely have lprng. RedHat
7.1 used lprng.
Since printing goes for two lines and stops, you may fine something of
interest in the status files in your print queue.
Have you tried just cat'ing the file in the /tmp spool to lp0?
The type of printing software you have on linux won't affect the cat'ing
experiment.
Joel
---------------------------------
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
---------------------------------
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
---------------------------------
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
Content-Description: smb.conf
workgroup = HOME
server string = Samba Server
printcap name = /etc/printcap
load printers = yes
printing = lprng
guest account = smbuser
log file = /var/log/samba/%m.log
security = share
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
[public]
comment = Public Stuff
path = /pub
public = yes
writable = yes
printable = no
[cdrom]
comment = CDROM Drive
path = /mnt/cdrom
public = yes
writable = no
printable = no
[lex]
printer name = z53-outfiles
comment = Raw Printer for Z53
printing = lprng
printer = z53-outfiles
path = /tmp
create mask = 0700
guest ok = yes
; hosts allow = 192.168.
; valid users = smbuser
printable = yes
; print command = echo "Tried to print %s" > /tmp/junk.%s
; print command = /usr/bin/lpr -P z53-outfiles %s; rm %s
print command = /usr/bin/lpr -P z53-outfiles %s
lpq command = /usr/bin/lpq -P z53-outfiles
lprm command = /usr/bin/lprm -P z53-outfiles %j
lppause command = /usr/sbin/lpc hold z53-outfiles %j
lpresume command = /usr/sbin/lpc release z53-outfiles %j
; printer driver = Lexmark Z53 Series ColorFine
; printer driver location = \\VALOR\public\Adrian\Drivers Etc\lxkz53
share modes = No
---------------------------------
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
---------------------------------
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
Loading...