I had an unrelated pdf problem where the printer itself was complaining about instructions being sent to it.

The solution was to check the "print as image" box in the adobe acrobat print dialogue.

I know this is completely unrelated but sometimes it is nice for a random suggestion work and not ever have to care why than have to learn the core of a topic just to comprehend such a one-off problem.

Benji-Boy: I am not exactly sure what you are trying to do. Print from a Linux client to a Linux (print)server? Print from a Linux client to a Windows (print)server? What do you mean by "network print server"? One of those small devices with an ethernet and a parallel port?

If it's Linux --> Linux printing you don't need Samba, only working CUPS installations on both machines. The server needs to be configured correctly (see the how-to), the client doesn't really need any special attention. You would simply print by using lpr -Pprintername

If it's Linux --> Windows printing then I am sorry, but I am not very familiar with that and as you can see I didn't cover it in the guide.

Ditto for the third possibility with the network print server device.

If none of these is the case please explain your setup and your environment.

Anyway, make sure your DNS entries are correct or your /etc/hosts files on the printer server and on the client contain at least these lines:
127.0.0.1 localhost
AA.BB.CC.DD local_machine_name_________________Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom.

Daff: Sorry I put the goal in the subject line but I should have been more clear.

I know you didn't cover it in the guide but hey, I know you're a clever guy so i had a stab at asking on this thread.

Thanks for you help.

This guide worked beautifully for printers that are physically attached to the machine operating as the printserver listenining for connections on port 631.

However my goall in short is:
To run a CUPS server on my linux box which listens for local jobs (essentially printing open office docs and pdf files etc) then prints the postscript file to a remote windows print queue (via samba backend) located on a LAN hosted by a machine called 'printserv' which controlls a HP LaserJet 4300 called hp228 (among other printers).

So according to your suggestion I'll add MY_CLIENT_MACHINE_IP and Client_machine_name on the second line.

Additional info:
I can select and configure the printer by scanning the network using KDE Printer Manager and the online admin. So CUPS CAN _find_ the printer. I can go through the wizard but, no test page print results.
According to the local CUPS Job manager the system aborts the jobs both as a regular user and root. (which makes perfect sense if it can't resolve the printer address.)

I'll try putting the IP of the printserver and the printserv name in /etc/hosts too.

I think you have solved at least part of the problem. I'll let you know monday after i have along chat with sys admin about host resolution.

Thanks heaps Daff.

Benji-Boy_________________How can one learn if one does not try?
Failure is temporary.
[>=We are what we choose to do=<]

Okay, I finally got this working. Our winxp (the fiance is loathe to give up windows, sigh) laptop now can print to the printer hooked up to the desktop using the autodownloaded cups drivers. However, whenever I try to go to the printer properties page under windows, I get an ugly error box instead.

Code:

Function address 0xa90450e caused a protection fault. (exception code 0xc0000005) Some or all property page(s) may not be displayed.

Some googleing turned up this post in a news group. Apparently the ppd might be at fault, but my error message does not match this person's while the general symptoms do. Any advice on solving this one?

I don't know if somebody has found a better solution for this problem, but here is what I did to solve it :

In order for a printer to be truly usable by a Windows NT/2K/XP client, it must possess:

* a valid Device Mode generated by the driver for the printer (defining things like paper size, orientation and duplex settings), and
* a complete set of PrinterDriverData generated by the driver.

If either one of these is incomplete, the clients can produce less than optimal output at best. In the worst cases, unreadable garbage or nothing at all comes from the printer or they only harvest error messages when attempting to print. Samba stores the named values and all printing related info in its internal TDB database files (ntprinters.tdb, ntdrivers.tdb, printing.tdb and ntforms.tdb).

What do these two words stand for? Basically, the Device Mode and the set of Printer Driver Data is a collection of settings for all print queue properties, initialized in a sensible way. Device Modes and PrinterDriverData should initially be set on the print server (that is here: the Samba host) to healthy values so that the clients can start to use them immediately. How do we set these initial healthy values? This can be achieved by accessing the drivers remotely from an NT (or 2k/XP) client, as is discussed in the next paragraphs.

Be aware, that a valid Device Mode can only be initiated by a "printer admin", or root (the reason should be obvious). Device Modes can only correctly be set by executing the printer driver program itself. Since Samba can not execute this Win32 platform driver code, it sets this field initially to NULL (which is not a valid setting for clients to use). Fortunately, most drivers generate themselves the PrinterDriverData that is needed, when they are uploaded to the [print$] share with the help of the APW or rpcclient.

The generation and setting of a first valid Device Mode however requires some "tickling" from a client, to set it on the Samba server. The easiest means of doing so is to simply change the page orientation on the server's printer. This "executes" enough of the printer driver program on the client for the desired effect to happen, and feeds back the new DeviceMode to our Sanba server. You can use the native Windows NT/2K/XP printer properties page from a Window client for this:

* Browse the "Network Neighbourhood"
* Find the Samba server
* Open the Samba server's "Printers and Faxes" folder
* Highlight the shared printer in question
* Right-click the printer (You may already be here, if you followed the last section's description)
* At the low end of the context menu select "Properties...." (if the menu still offers the "Connect..." entry further above, you need to click that one first to achieve the driver installation as shown in the last section)
* Go to the "Advanced" tab; click on "Printing Defaults..."
* Change the "Portrait" page setting to "Landscape" (and back)
* (Oh, and make sure to apply changes between swapping the page orientation to cause the change to actually take effect...).
* While you're at it, you may optionally also want to set the desired printing defaults here, which then apply to all future client driver installations on the remaining from now on.

This procedure has executed the printer driver program on the client platform and fed back the correct Device Mode to Samba, which now stored it in its TDB files. (Once the driver is installed on the client, you can follow the analogous steps by accessing the *local* "Printers" folder too if you are a Samba printer admin user.) From now on printing should work as expected.

Samba also includes a service level parameter name default devmode for generating a default Device Mode for a printer. Some driver will function fine with Samba's default set of properties. Others may crash the client's spooler service. So use this parameter with caution. It is always better to have the client generate a valid device mode for the printer and store it on the server for you.

The error comes from the bad settings in samba with some printer models. What I did to solve this problem :

1 - Added one of my windows users as printer admin and in the write list of print$ share
2 - Commented the print$ share in smb.conf
3 - Connected to the printer and installing the clients drivers (not the ones from the samba server)
4 - Uncommented the print$ share and restarted samba
5 - Opened the default settings, changed the paper to landscape and saved
6 - uninstalled the printer on the windows client and reconnected with the samba drivers

I can now open the printer properties with any windows clients._________________Linux 2.6.11 i686 gentoo
Mozilla Firefox v1.0.3
KDE v3.4.0

[global]
# Replace MYWORKGROUPNAME with your workgroup/domain
workgroup = WORKGROUP
# Of course this has no REAL purpose other than letting
# everyone know its not Windows!
# %v prints the version of Samba we are using.
server string = Samba Server %v
# We are going to use cups, so we are going to put it in here ;-)
printcap name = cups
printing = cups
load printers = yes
# We want a log file and we do not want it to get bigger than 50kb.
log file = /var/log/samba/log.%m
max log size = 50
# We are going to set some options for our interfaces...
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
# This is a good idea, what we are doing is binding the
# samba server to our local network.
# For example, if eth0 is our local network device
interfaces = lo eth0
bind interfaces only = yes
# Now we are going to specify who we allow, we are afterall
# very security conscience, since this configuration does
# not use passwords!
hosts allow = 127.0.0.1 10.10.10.
hosts deny = 0.0.0.0/0
# Other options for this are USER, DOMAIN, ADS, and SERVER
# The default is user
security = share
# No passwords, so we're going to use a guest account!
guest account = samba
guest ok = yes
# We now will implement the on access virus scanner.
# NOTE: By putting this in our [Global] section, we enable
# scanning of ALL shares, you could optionally move
# these to a specific share and only scan it.

# Now we'll setup a printer to share, while the name is arbitrary
# it should be consistent throughout Samba and CUPS!
[HP840C]
comment = HP DeskJet 840C Network Printer
printable = yes
path = /var/spool/samba
public = yes
guest ok = yes
# Modify this to "username,root" if you don't want root to
# be the only printer admin)
printer admin = root

# We create a new share that we can read/write to from anywhere
# This is kind of like a public temp share, anyone can do what
# they want here.
[public]
comment = Public Files
browseable = yes
public = yes
create mode = 0766
guest ok = yes
path = /home/dcorujo/share

for our windows print server we use a program called papercut which gives the students printing accounts with a certain ammount of money they get to print with. they can top it up and things like that. i was wondering if anyone would know of a similar program for linux?

What i dont understand is why is it trying to use foomatic (PID 24131). I haven't got it emerged on my system.

Maybe you should emerge it, see what happens?

CUPS likes Foomatic, it is a very universal filter script. It should be present I think, especially if you use a PPD from linuxprinting.org or anything other than gimp-print or the example drivers from CUPS. Plus it doesn't hurt, it helps!_________________Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom.

Did you follow the Howto to the letter (or implemented it at least somehow accuratly?)

Seems to me that there's something wrong with either your Samba setup or some mismatches on the system itself. Do you have DNS set up correctly or do yor have sane entries in /etc/hosts? Hostname correct? Does Samba acutally work? Can you browse shares and copy files around from the Windows client? Can you do a smbclient -U% -L keg? If so, can you do a smbclient -U ANY_SAMBA_USER \\\\keg\\ANY_SHARE_NAME? Does CUPS work?

Please post the output of testparm as well as hostname, your /etc/hosts and have a look at the troubleshooting tips by Kurt Pfeifle.

That's all I can think of for now, you did not provide much information to work with _________________Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom.

Hello. Sorry about the lack of info. Any more kind of info you need just tell me (and the way to obtain it would be welcome too, hehe).

I followed your How to almost religiously, hehe.
Well,

Code:

mbclient -U% -L keg

and

Code:

smbclient -U ANY_SAMBA_USER \\\\keg\\ANY_SHARE_NAME

where both succefull, whereas I could look at what were my share names, and I could navigate through them. Cups is working fine at every program I tried... mozilla-thuderbird, openoffice, acroread, etc.
Samba also works, disk-sharing wise.

This really sucks...I have definately spent too much time already on this damn stuff :(

The problem:
I want to enable several W2K and XP clients to print on the network, using a Gentoo Server (Samba and CUPS).
I want to make use of the download drivers functionality so that I don't have to manually install the printers everytime another clueless laptop owner needs to use one of the network printers.

What I have done so far:
Read this HOWTO and several others.
Installed Samba, Foomatic, CUPS and the CUPS drivers for Windows (cups-samba).
Set up my printers in CUPS and configured Samba to print via CUPS and to offer the printer download share (created print$ and ran cupsaddsmb).

What works:
I can print locally from the server and I can also print from the Windows clients using IPP.
Also, the clients can print via Samba if I do *not* use the driver download functionality, but instead install the usual Windows drivers locally.
The printers are listed correctly in network neighbourhood. When I try to use the driver download funcionality, Windows seems to download the drivers correctly - it does not complain about missing drivers, installs the printer, and the driver files do appear in the appropriate directories on the Windows machine.

The problem occurs as soon as I try to print from an application:
As soon as I try to print from W2K with the drivers downloaded from Samba, I get a bunch of typically unhelpful Micro$oft error messages (something like 'function address 0x-this-or-that caused a protection error, property pages may not be displayed...'). There is no sign of any connection in any of the server's logfiles, so the print process seems to crash before even any connection to Samba is made.
Interesting: When I print via right-click on printer, properties, print test page, anything works just fine! But I cannot print from e.g. Notepad. The problem seems to occur when Windows tries to display certain printer properties.

I have not yet tried wether the same problem occurs on XP clients, maybe it is limited to W2K.
For me, this seems to bet not a Samba/CUPS configuration problem, but a problem with the CUPS drivers from the cups-samba package.

2 questions:
Is anyone else experiencing this trouble?
Can someone give me detailed instructions on how to use the Adobe drivers? I downloaded them, but after installing them on a Windows machine, I cannot find the files that I am supposed to copy over to the server according to the cupsaddsmb manpage :(

Then try cupsaddsmb again, it should give different output now, or there might be some deeper, more serious flaws

mold: The problem you are experiencing indeed seems to be a known bug in the cups-samba drivers. If you read through this thread you'll notice some people reporting the same unhelpful error message only they DO seem to be able to print via Notepad, Acrobat, etc. See here for some details.

Note so self: I need to add a remark about that property box to the guide. I also need a 48-hour-day.

Please see the workaround by matbouch (thanks!), a few post above. I haven't tested it myself though.

And just a blind shot by me: maybe your problem is because several different printer drivers are installed and they conflict somehow with each other? Try deleting all the installed printer drivers (and printers) and connect again (this is always a good idea in Windows).

I think this is done by opening Start -> Settings -> Printers and right-clicking anywhere on the white background, chosing "Server properties". I am not sure, it's now been a while since I've used Windows to print. Theoretically you should be able to print although you wouldn't be able to select any extra options and properties.

HTH..._________________Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom.

Thx daff, I will try some of the things that were mentioned.
And sorry for not reading the thread well enough. I have put far too many hours into trying to get this thing to work... I am somewhat exhausted by the samba/cups/windows combination at the moment ;)

mold: Very understandable Windows networking is a nightmare...let's hope for the CUPS guys to resolve the problem.

newbie_gentoo: I am running out of ideas...have you added root to the Samba passwort database by issuing smbpasswd -a root? Don't forget it's the passwort you gave there cupsaddsmb is expecting.

Try also setting netbios name = keg in smb.conf. Leave security = user though. You should also set your workgroup = to something other than just WORKGROUP (no real reason, but it's better ).

That's all I can think of at the moment, sorry._________________Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom.

This is almost getting funny. I just found out that I in fact *can* print from Firefox, OOo, etc - but not from Notepad. It seems that for some reason Notepad tries to open the printer configuration before printing and that is why it crashes, while other applications do not. I think I should just get the Adobe drivers. Can someone who uses them give me a hint on where to find the correct files?

This is almost getting funny. I just found out that I in fact *can* print from Firefox, OOo, etc - but not from Notepad. It seems that for some reason Notepad tries to open the printer configuration before printing and that is why it crashes, while other applications do not. I think I should just get the Adobe drivers. Can someone who uses them give me a hint on where to find the correct files?

Really interesting

Well the Adobe drivers are infact intended for local installation on each client, but I managed to find the correct files after extraction of the archive (seems like years ago).

I have no Windows machine at hand now but you should try downloading and extracting the archive from Adobe (found here) and then use the search function on Windows to locate the files. According to the cupsaddsmb man page they are called ADOBEPS5.DLL, ADOBEPSU.DLL and ADOBEPSU.HLP. See the man page for details on installation/copying (the files need to be all uppercase).

HTH_________________Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom.

oh boy... same thing... I'm giving up. I'm planning on building a gentoo gateway, and it looks like it is rapidly candidating itself to be a printer server. I hope I can get it working there, hehe. Thanks for all the help, you've been great!

Just wanted to say I installed Gentoo on my main desktop machine at home (which ran FreeBSD for years) two days ago and just now I used my guide to set up Samba and CUPS. I did not ran into a single problem whatsoever!

So the guide should be still accurate and working! Just follow every step carefully and it should work!

I have working DNS setup at home, two entries in /etc/hosts, one for localhost, one for my machine (although the second entry isn't really necessary since a DNS is running). security = user in smb.conf's [global] section, workgroup = ARDA, passdb backend = tdbsam, added users using pdbedit (am going to update the guide for that) and that was it._________________Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom.

I got the printer working with cups (locally) and tried now to connect the printer with Windows NT4. I'm getting the error, that the driver (on the Samba Server) could not be installed.
I'm using the cups driver. All commands in your Howto worked.
Here are my config files:

Hm. You have a section for your printer in your smb.conf? A [toshtest] if I am not mistaken?

What I find interesting is that your CUPS driver files lack the "suffix" `5', i.e. they are named cups.dll, cupsdrvr.dll, ... and not cups5.dll, cupsdrvr5.dll, etc. Did you use the correct CUPS drivers from the CUPS web site (to be downloaded here)?

If not then get them, delete the contents of /var/lib/samba/printers, install them via the cups-install.sh script, make sure the directory /var/lib/samba/printers you specified is readable by all and writeable by root and any printer admin user and run cupsaddsmb again. I updated the guide so it shows a correct sample-output of the command.

What kind of printer to you have? Is it not locally connected (I am referring to the entry DeviceURI socket://184.1.52.26:9100 in printers.conf)?

That's the ideas I have for now, hope it helps!_________________Instead of asking why a piece of software is using 1970s technology,
start asking why software is ignoring 30 years of accumulated wisdom.