LP-Magic is an enhancement for the Solaris print service, consisting of file type recognizers, filters, interface scripts, network drivers, configuration scripts, and a log summary script.
For more information about LP-Magic, see the following topics.
We are a university with about 20,000 users on our central Solaris system. We have about 80 printers, all either directly on the network or connected to Axis, HP, and Intel print servers. I recently converted our print spooler from a BSD (lpd) system to the Solaris print service (lpsched). I hope that other similar sites can benefit from our experience in this successful conversion. We are running Solaris 8 on the central print server.
One limitation of lp/lpsched is that it requires the user to specify the type of file to be printed with `lp -T'. Most of our users have no idea what type of file they are printing, so this doesn't work very well, resulting in lots of discarded output. My solution was a recognizer that determines the file type and selects the appropriate filter automatically. I realize that lpsched does this to some extent, but it's undocumented and not configurable. I've also added support for more network drivers to the interface scripts, and written scripts to simplify the task of defining printers.
Both the BSD and System V print spoolers have a great deal of history, having originated with their respective versions of Unix. They differ in how printers are defined, the extent to which they can be configured for different printer types, and the variety of options that can be specified with the print commands.
The BSD spooler relies on the /etc/printcap file for printer definitions. Filters can be specified to translate print files prior to printing, although they have some frustrating limitations to programming. For example, generating the banner page in an input filter is quite awkward. The print command, lpr, permits only a small number of fixed options that affect the format of the printed output. The BSD spooler has a well-defined network protocol for forwarding print jobs and queries between spooler hosts.
The System V spooler uses the `lpadmin' command to define printers, keeping the information in private files. It invokes an interface program, generally a shell script, as the final step in sending output to each printer. The interface script is responsible for print options, the banner page, multiple copies, and any initialization that the printer may require. The Solaris version also supports two types of filters to translate print files. The print command, lp, will accept arbitrary options that can affect the output format. This spooler is generally more oriented to the needs of a large system with many shared printers, than to one with individual desktop printers.
Beginning with Solaris 2.6, the printing commands, lp and lpr, became client programs, independant of the spooler, and communicating with the print server over the network. Printers are defined to the clients in the /etc/printers.conf file, or in NIS or NIS+. The network protocol used is the same as the BSD spooler. This is good for compatibility, but has some limitations. If both client and server are Solaris machines, protocol extensions can be enabled to allow the full features of the client to be used. Incoming BSD print requests or queries are handled by in.lpd, which runs from inetd.conf. This service can be filtered with tcp-wrappers to limit hosts that can connect to it.
The `lpadmin' command now attempts to set both client and server definitions, if it determines this to be necessary. However, it's quite possible for printer names and other information to be different between client and server. For example, the client will handle printer names longer than 14 characters, whereas the server will not. On machines that only act as client hosts, it's only necessary to define printers in the /etc/printers.conf file.
For each printer output type, currently limited to `postscript', `pcl', and `epson', a filter is defined by a filter description file. Each filter is specified to accept any printer input type, and to produce the required output type. Filters are simply shell scripts that examine the input data to determine the file type, and then invoke a second filter to do the appropriate translation of the data. If the filter encounters a file type for which it has no second filter, it prints a brief error message on the printer. It uses the `file' command to determine the input type, with an enhanced magic file. Enhancing the filter to handle additional files types is quite easy.
Two interface scripts are provided: ps-interface for PostScript printers and netstandard for ASCII printers. These scripts are used instead of Sun's netstandard script to process the print request and send the output to the printer. The ps-interface script adds options for single-sided and double-sided printing on PostScript printers, and generates a PostScript banner page. Both interface scripts use the `protocol' option to select network drivers for many additional kinds of printers or print server boxes. These drivers do the network communication required to transmit the print data to the printer. Some drivers are supplied, but others must be obtained from the equipment vendor. These are often included as part of the Solaris printing software supplied by the vendor, and even if the software itself is primitive, the driver itself can be used.
The current release of lp-magic is version 1.5. Source is available as a compressed tar file.
If you have added support for additional printer types, filters, or network drivers to lp-magic, please send the details to Gary Mills at the University of Manitoba.
Please send bug reports to Gary Mills at the University of Manitoba.