I've been setting up and administering UNIX systems in Southern California since 1985, and several current customers run SCO UNIX as their main production machines. I have long wanted to migrate them to Linux - SCO has the worst compilers on the planet - but I can't do it. It's not about "open source" or support or anything else obvious. It's the LP Spooler.
System V has a sophisticated line printer spooling system, and it supports per-printer "interface scripts" (shell scripts) that process user-provided options and construct the stream that talks directly to the device. Many of these scripts are quite sophisticated, and after 15 years of development, entire operations depend on them.
Of critical importance is the ability to pass options from the "lp" command line to the interface script, and these options are defined by the script itself. A typical System V lp spooler command line might be:
here, and "-oduplex" and "-o4up" are meaningful only to the particular script associated with the printer of interest, and some scripts take dozens of custom options as required by (say) an accounting package.
$ lp -oduplex -o4up file.txt
Linux mostly has the really crappy Berkeley LPD system, and though there are provisions for custom scripts, there aren't really any good ways to pass in user-defined scripts. There are much more full-featured printing systems (CUPS, for instance), but none of them take a System V interface script. This means that no matter what road we go down, significant re-engineering is required.
I have at least three customers that I would dearly love to convert to Linux, but this LP thing is the hangup. At some point I'll probably write a front-end that does the options processing and simply presents the final data stream to lpd, but this requires work I can't really bill for since I'm the one pushing for "open source".
Suggestions welcome.
Posted by Steve at November 06, 2002 07:35 PM | TrackBackHow does the SMB printer sharing work with Samba? Is that dependent on lpd? Being somewhat ignorant on this matter, that is where I would look first.
Posted by: Dan Isaacs on November 7, 2002 07:53 AMPrinter sharing with Samba works very well under UNIX, and I think that it can be done with lpd as well. The System V spooler is mostly "transport neutral": each printer queue has a device associated with it, and the spooler runs the per-printer interface script with the standard output connected to that device.
For network printers, we simply use /dev/null and route the output ourselves by piping to smbclient (for Samba shares) or tcpprint (for JetDirect printers). My suspicion is that "transport" is not a problem for any of the printing systems.
It's the problem of passing options required by the application that has me stuck. I know I can re-engineer this and get it supported by other systems, but it's a big effort and requires lots of testing. I found one of my medium-sized interface scripts (an HP LaserJet script in use for years), and the script supports at least these options:
These are not supported by the printer spooler - the "-o" options are entirely opaque - but by the individual interface scripts. The scripts generally just modify the (long) list of escape codes sent to the printer, and once assembled are routed to the printer by whatever transport is available.-o upper feed from upper bin
-o lower feed from lower bin
-o manfeed feed from manual tray
-o PORT80 portrait, 80 columns
-o PORT132 portrait, 132 columns
-o LAND132 landscape, 132 columns
-o LAND170 landscape, 170 columns
-o 10 use 10 chars per inch
-o 12 use 12 chars per inch
-o 17 use 17 chars per inch
-o 20 use 20 chars per inch
-o 22 use 22 chars per inch
-o pitch=XX set pitch explicitly
-o cols=XX calculate pitch from # of cols
-o lines=XX set lines per page (default=66)
-o portrait use portrait mode (default)
-o landscape use landscape mode
-o wide same as 17 pitch
-o checks proper options for check printing