Discussion:
Printing from Samba
(too old to reply)
piesse
2008-01-24 12:23:17 UTC
Permalink
I am experimenting with samba connecting my ECs box with a M$XP and a
500G Western Digital MyBook (wrong purchase: stay away if you can).

The instructions on http://svn.netlabs.org/samba were a bit inaccurate:
they don't tell you that you are expected to create a couple of
directories under %ETC%/samba (named "pid", "private" and possibly
"lock") and rhey talk about a smb.conf file that doesn't exist in the
latest distributions: you must build it from scratch (which is not
difficult).
Also, downloading and using the useraddpm.exe utility was the only way I
could really manage users.
However, at the end they work!

So far, I was able to setup disk connections, but I am not able to print
on my eCS-connected laserjet from the XP box.

This is what I did:
1)Add the printer to smb.conf using the sscc program.
It generated the following entry in smb.conf:
[LASERJE1]
comment = HP LaserJet 2200
path = /var/spool/LASERJE1
valid users = foo, bar
read only = No
create mask = 0700
guest ok = Yes
printable = Yes
printing = os2
print command = \smbprint.exe "%s" "%p" "%J" "%c" "%z"
lpq command = lpq.exe -s %i -p %p
lprm command = lprm.exe -s %i -p %p %j
printer name = LASERJE1



(I hadded the "valid users" line manually)

2) started nmbd and smbd

3)Found it in "network resources" on the XP box and used it to create a
new printer there using the PCL5 drive that used to work for the same
printer when I was using NETBEUI.


However, when I try to print from there I get an error.

Furthermore, I see that smbd periodically prints the following error:

connect() failed, errno = 10061.
connect() failed, errno = 10061.
Unable to connect to 10.2.1.3.
connect() failed, errno = 10061.
connect() failed, errno = 10061.
Unable to connect to 10.2.1.3.
...

Where 10.2.1.3 is the IP of the computer where the printer resides (and
where smbd itself is running!)
The message doesn't shows up if I remove the [LASERRJ1] section from
smb.conf, so must be related to it.


Is there something that I did wrong?
Maybe lpd should be running?
Or I need a printcap file in %ETC%?
Or I should check that the "path = /var/spool/LASERJE1" actually
represent the current os/2 spooler of the printer (it doesn't, I just
accepted what sscc suggested)

Or what else?

thanks,
Piersante
Rich Walsh
2008-01-24 18:42:43 UTC
Permalink
Post by piesse
they don't tell you that you are expected to create a couple of
directories under %ETC%/samba (named "pid", "private" and possibly
"lock") and rhey talk about a smb.conf file that doesn't exist
Really! I'm about 2/3 of the way through writing a comprehensive how-to
so others won't have to suffer through the same learning experience we
did. I've also got a package of files you can drop into %ETC% which will
give you all the missing files & directories (including the smb.conf man
page in html format). It should be ready "real soon now"...
Post by piesse
So far, I was able to setup disk connections, but I am not able to
print on my eCS-connected laserjet from the XP box. [...]
Is there something that I did wrong?
Based on some of Paul S's comments, I'm not sure that it's capable
of printing, even when setup properly.
Post by piesse
Maybe lpd should be running?
Probably (but don't quote me on this).
Post by piesse
Or I need a printcap file in %ETC%?
The smb.conf that normally comes with the distro describes how to create
one - it's really simple. Find your printers & copy the names of each
icon into a file named "printcap", one per line. You can give each printer
multiple names by separating them with a pipe ('|') character. E.g.

LASERJE1|HP LaserJet 2200|Office Printer
EPSONC40UX|Inkjet

(The docs aren't clear on whether spaces are permitted - if not, change
them to underscores.)
Post by piesse
Or I should check that the "path = /var/spool/LASERJE1" actually
represent the current os/2 spooler of the printer (it doesn't, I just
accepted what sscc suggested)
I may be out of my depth here, but I don't think so. The directory is
just someplace that Samba can place a file that something on the OS/2
side will notice & act upon. Of course, it would help if that directory
actually exists :-) Under [printers], I have "path = F:/temp".
Post by piesse
Or what else?
When in doubt, run 'testparm.exe'. It will examine smb.conf and tell
you about any errors. E.g., it kept saying that printing was disabled
until I created 'printcap'.
--
== == almost usable email address: Rich AT E-vertise.Com == ==
___________________________________________________________________
|
| New! DragText v3.9 with NLS support
Rich Walsh | A Distinctly Different Desktop Enhancement
Ft Myers, FL | http://e-vertise.com/dragtext/
___________________________________________________________________
piesse
2008-01-24 21:10:00 UTC
Permalink
Post by Rich Walsh
The smb.conf that normally comes with the distro describes how to create
one - it's really simple. Find your printers & copy the names of each
icon into a file named "printcap", one per line. You can give each printer
multiple names by separating them with a pipe ('|') character. E.g.
LASERJE1|HP LaserJet 2200|Office Printer
EPSONC40UX|Inkjet
In which distro is that smb.conf? (it is not in the last one or in the
previous warpin installer)

And in which /etc directory must the printcap file be? there are so
many: %etc%, %unixroot%/etc, %etc%/samba ...

thanks,
Piersante
Herwig Bauernfeind
2008-01-25 16:05:37 UTC
Permalink
Post by piesse
Post by Rich Walsh
The smb.conf that normally comes with the distro describes how to create
one - it's really simple. Find your printers & copy the names of each
icon into a file named "printcap", one per line. You can give each printer
multiple names by separating them with a pipe ('|') character. E.g.
LASERJE1|HP LaserJet 2200|Office Printer
EPSONC40UX|Inkjet
In which distro is that smb.conf? (it is not in the last one or in the
previous warpin installer)
It comes with the .zip packages.

The installer creates its own default smb.conf.
Post by piesse
And in which /etc directory must the printcap file be? there are so
many: %etc%, %unixroot%/etc, %etc%/samba ...
Although you don't really need it, it should be in %unixroot%/etc

Kind regards,
Herwig
piesse
2008-01-25 08:53:05 UTC
Permalink
Post by Rich Walsh
Post by piesse
Maybe lpd should be running?
Probably (but don't quote me on this).
hum.. thinking beter, it would make no sense: lpd should work also
without samba!
Post by Rich Walsh
When in doubt, run 'testparm.exe'. It will examine smb.conf and tell
you about any errors. E.g., it kept saying that printing was disabled
until I created 'printcap'.
Textparms gives no errors here with or without printcap. But samba
doesn't print yet :-(

cheers,
Piersante
Herwig Bauernfeind
2008-01-25 16:02:28 UTC
Permalink
Post by Rich Walsh
Post by piesse
they don't tell you that you are expected to create a couple of
directories under %ETC%/samba (named "pid", "private" and possibly
"lock") and rhey talk about a smb.conf file that doesn't exist
The WPI installer creates these (at least the latest one, previous ones
had issues).
Post by Rich Walsh
Really! I'm about 2/3 of the way through writing a comprehensive how-to
so others won't have to suffer through the same learning experience we
did. I've also got a package of files you can drop into %ETC% which will
give you all the missing files & directories (including the smb.conf man
page in html format). It should be ready "real soon now"...
Post by piesse
So far, I was able to setup disk connections, but I am not able to
print on my eCS-connected laserjet from the XP box. [...]
Is there something that I did wrong?
You hit one bug in SSCC.EXE
Post by Rich Walsh
Based on some of Paul S's comments, I'm not sure that it's capable
of printing, even when setup properly.
Sure it can print. You can either use smbprint.exe from my homepage as a
print command or in case you dislike that and your Samba build is a
3.0.27a or a 3.0.28, set printing = os2 in the [global] section and
printing via lpr will be the preconfigured print command.
Post by Rich Walsh
Post by piesse
Maybe lpd should be running?
If printing via lpr is planned, yes. If smbprint should be used, no.
Post by Rich Walsh
Post by piesse
Or I need a printcap file in %ETC%?
You can do with a printcap file, however if you create one, it should be
in %UNIXROOT%\etc (which is not necessarily the same as %ETC% unless
your %UNIXROOT% point to x:\MPTN (where x: is your bootdrive).
Post by Rich Walsh
Post by piesse
Or I should check that the "path = /var/spool/LASERJE1" actually
represent the current os/2 spooler of the printer (it doesn't, I just
accepted what sscc suggested)
SSCC (which is my baby) has a bug (it has more than one :-) and forgets
to prepend the Samba path here, so if you have installed Samba in
D:\Samba your above path should be D:/Samba/var/spool/LASERJE1
Post by Rich Walsh
When in doubt, run 'testparm.exe'. It will examine smb.conf and tell
you about any errors. E.g., it kept saying that printing was disabled
until I created 'printcap'.
Running testparm.exe is generally a good idea, however does not
guarantee it will work on OS/2: Best example is your above path:
It is a perfectly valid Unix path, thus testparm will not complain.
However it will not work on OS/2.

Kind regards,
Herwig
piesse
2008-01-28 09:56:25 UTC
Permalink
Post by Herwig Bauernfeind
Sure it can print. You can either use smbprint.exe from my homepage as a
print command or in case you dislike that and your Samba build is a
3.0.27a or a 3.0.28, set printing = os2 in the [global] section and
printing via lpr will be the preconfigured print command.
I don't see why I should dislike it, but I am using 3.0.28.
So I must use lpr/lpd?

I did all the o6ther changes, but still cannot print (windows complains
that a StartDocPrinter call is not issued) and smbd continues to show
the same errors (cannot conect).
I have bot "guest" and "pcguest" users without a password. I don't know
how to check if they are set properly.

thanks,
Piersante
Herwig Bauernfeind
2008-01-28 14:38:28 UTC
Permalink
Piersante,
Post by piesse
Post by Herwig Bauernfeind
Sure it can print. You can either use smbprint.exe from my homepage as
a print command or in case you dislike that and your Samba build is a
3.0.27a or a 3.0.28, set printing = os2 in the [global] section and
printing via lpr will be the preconfigured print command.
I don't see why I should dislike it, but I am using 3.0.28.
Well, smbprint.exe is a quick and dirty program written by me. That
might be a reason :-)

Honestly, I did test only smaller print jobs (~20 pages) and it worked.
If very big print jobs should be printed, lpr might be the better solution.
Post by piesse
So I must use lpr/lpd?
No (but you could).
Post by piesse
I did all the o6ther changes, but still cannot print (windows complains
that a StartDocPrinter call is not issued) and smbd continues to show
the same errors (cannot conect).
I have bot "guest" and "pcguest" users without a password. I don't know
how to check if they are set properly.
if you run "net user" from the commandline, provide your password, it
should be in the list of displayed users.

If you want, mail me your smb.conf, and I'll check if I see anything
wrong in there. Remove .DESPAM from my address to get my email address.

Kind regards,
Herwig

Herwig Bauernfeind
2008-01-25 16:40:37 UTC
Permalink
Post by piesse
1)Add the printer to smb.conf using the sscc program.
[LASERJE1]
comment = HP LaserJet 2200
path = /var/spool/LASERJE1
Should be:
path = x:\samba/var/spool/LASERJE1
Post by piesse
valid users = foo, bar
I'd remove the above line until everything works...
Post by piesse
read only = No
create mask = 0700
guest ok = Yes
printable = Yes
printing = os2
print command = \smbprint.exe "%s" "%p" "%J" "%c" "%z"
Should be:
print command = x:\samba\smbprint.exe "%s" "%p" "%J" "%c" "%z"
Post by piesse
lpq command = lpq.exe -s %i -p %p
lprm command = lprm.exe -s %i -p %p %j
These 2 lines are ok, but currently do not work, Samba limitation at the
moment.
Post by piesse
printer name = LASERJE1
I fixed this bug and uploaded a new sscc.exe to my page at
http://members.aon.at/herwig.bauernfeind/samba/index.html
Post by piesse
(I added the "valid users" line manually)
I would not do that before everything works smoothly.
Post by piesse
2) started nmbd and smbd
3)Found it in "network resources" on the XP box and used it to create a
new printer there using the PCL5 drive that used to work for the same
printer when I was using NETBEUI.
However, when I try to print from there I get an error.
connect() failed, errno = 10061.
connect() failed, errno = 10061.
Unable to connect to 10.2.1.3.
connect() failed, errno = 10061.
connect() failed, errno = 10061.
Unable to connect to 10.2.1.3.
...
It appears to me the guest user is not setup properly.

Printing requires to setup the guest user properly. The latest installer
does that properly, earlier ones had issues there...

Kind regards,
Herwig
Loading...