Samba and printer problem between Windows XP and SuSE 9.0
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Samba and printer problem between Windows XP and SuSE 9.0
After struggling with my Samba setup, my last task was to get my Windows XP workstation printing to my Linux workstation's printer.
Got this done after some time consuming learning. I wanted to post this info to hopefully reduce the next person's cycles. There's one "trick" I did that really helped out... So:
1) I had the basic Samba services running. I could see my shares, but printing just went into a hole. No complaints, just no output.
2) Turned on debugging. This required depicting both the log file "area" and the log level. At first, I didn't understand this could be done via the 'smb.conf' file located in /etc/samba. So, I hacked my 'rc' script and added it. After some debugging/reading, I FINALLY realized you can do this in the [global] section:
From this, I could now see the "conversation" that occurred when I tried printing. The give away was the following line from the log file associated with my workstation:
lpr -r -Phpdeskjet722c samba_4593932 (gave return of 1)
I couldn't see the result of the 'lpr' command, and just wasn't sure what was going on...But, I know a non-zero return signifies badness. So, here I got a detour, and used an old unix trick to "see" my problem.
My strategy was to run 'lpr' directly from the command line on the file that Windows passed over. I should then be able to see the problem.
THE DETOUR
I figured I had to alter the printer command, and I suspected my windows workstation was passing along info a print file that was already processed - meaning I needed to allow "raw" pass-through. What I didn't know was the "global" area's print directives do NOT extend to a specific printer. So, even though my [global] section said:
[global]
print command = lpr -P%p -l %s
which says, "use 'lpr', use -P(printer) denoted by %p, raw pass-thru (the -l) on file %s". This print command SHOULD have left the file around when it was done (default Samba setups use the -r flag, which says remove it when finished).
My printer section said:
[hpdesk722C]
comment = HEWLETT-PACKARD DESKJET 720C
path = /var/tmp
read only = No
create mask = 0600
guest ok = Yes
printable = Yes
printer name = hpdesk722C
oplocks = No
and since there was NOT a 'print command =', it used something other than my [global] section... /-:
THE TRICK
Linux like all *ixs will not remove a file if there are any other references to it. My plan wasn't working - I wanted to check whatever was being sent over. So, what I did was navigate to my printer's path directory (the 'path = /var/tmp') and waited for a file to show up. They all start with "s*", so the second I hit the "Print Test Page" from Windows, on my Linux box I entered:
ln s* xx
I linked file 's*' to file 'xx'. Now, I had a copy of the file that Windows was sending over. Sure enough, when I tried printing directly as Samba was, the queue complained:
# lpr -Phpdesk722C xx
lpr: unable to print file: client-error-document-format-not-supported
This meant that the file was already processed, and did not require filtering with the lp subsystem. So, when I did:
# lpr -l -Phpdesk722C xx
it printed just fine. So, dove back into my 'smb.conf' file. Looked it over and guessed that my hpdesk722C entry needed it's own printer command:
[hpdesk722C]
comment = HEWLETT-PACKARD DESKJET 720C
path = /var/tmp
read only = No
create mask = 0600
guest ok = Yes
printable = Yes
printer name = hpdesk722C
print command = lpr -r -P%p -l %s
oplocks = No
Man I was soo excited until the very end!
I have exactly the same symptoms (but I could not see where the lpr command is printed in the log file after bumping the log level to 3.)
1) I am getting the same error in my log file ( Unable to print file to hack-client-error-document-format-not-supported)
2) I was able to capture the file in my spool directory
3) I was able to print it as you suggested from the command line (printed fine.)
BUT but when I made the changes to my smb.conf, I still get the same error in my log :-(
This system had been working fine and something happened and it stopped. Unfortunately I didn't make a copy of the smb.conf before I started monkeying with it.
My file shares are not listed here because they are working fine.
Here is my (current) smb.conf (without the shares):
[global]
log file = /var/log/samba/%m.log
log level = 3
load printers = yes
printing = cups
printcap = cups
I also noticed that I got the following error when I ran with oplocks set:
Invalid combination of parameters for service hack. Level II oplocks can only be set if oplocks are also set.
Last edited by jordanthompson; 05-12-2005 at 09:28 PM.
Many thanks for your info, but I found a little problem.
First of all I have followed the muddy steel suggestion; the system is working correctly. BUT After 1 day of working the system present again the same problem.
Here the actual configuration (shares are not indicate) of my smb.conf file:
[global]
log file = /var/log/samba/samba.%m
max log size = 50
ldap ssl = No
restrict anonymous = no
socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192
domain master = no
wins support = true
dns proxy = no
server string = Samba Server
max protocol = NT
read only = no
workgroup = BEP
server signing = Auto
os level = 64
[Deskjet9300]
comment = HP Deskjet 9300 A3
path = /var/tmp
read only = no
create mask = 0600
guest ok = yes
printable = yes
printer name = Deskjet9300
print command = lpr -r -P%p -l %s
oplocks = no
As you can see I'm working with an HP printer.
If I try to print any file (not only the test page) form local the print is executed correctly
If I send the test page to print from remote (Windows) the system work correctly and print the test without any problems.
If I try to send any kind of printing form various Windows application the samba log file replies
[2005/06/28 17:26:26, 1] smbd/service.c:make_connection_snum(648)
massimof (192.168.1.101) signed connect to service Deskjet9300 initially as user m.fioravanti (uid=501, gid=100) (pid 2134)
[2005/06/28 17:26:29, 0] printing/print_cups.c:cups_job_submit(765)
Unable to print file to Deskjet9300 - client-error-document-format-not-supported
[2005/06/28 17:26:35, 1] smbd/service.c:close_cnum(836)
massimof (192.168.1.101) closed connection to service Deskjet9300
I can confirm that the proposed solution from muddy steel work for 1 day.
I can also confirm that I have not modified any part of configuration files since from yesterday after successful test with the new smb. conf file
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.