Network Printing

Paperback
from $0.00

Author: Matthew Gast

ISBN-10: 0596000383

ISBN-13: 9780596000387

Category: Input - Output Equipment / Peripherals

On today's networks it's common to have users running Windows, Apple, Novell, and many versions of Unix. Each operating system has its own printing facility and there is little or nothing in common between them—there is no single system for print spooling. Yet all users want to be able to print, and most of the time they have to share the same printers. The network administrator has to solve this problem as efficiently as possible.\ O'Reilly's Network Printing shows network administrators a...

Search in google:

This guide shows how to set up a network printing architecture that supports all kinds of clients using Linux machines as print servers. It covers the standard Unix print servers on BSD and System V, LPRng, Samba printing services, and using LDAP as a configuration repository for printers.

Chapter 5: The Next Generation Berkeley Spooler: LPRng\ In this chapter: \ Compiling and Installing LPRng\ Configuring LPRng\ More Fun with Filters \ Accounting \ In spite of our great fondness for the Berkeley spooler, we must admit that its age clearly shows--the stock Berkeley spooler has been in use longer than many of its users have been working with computers. Recent developments have led to one potential successor: LPRng. LPRng began life as a PLP, a reimplementation of the Berkeley spooler free of the AT&T Unix license. In the early 1990s at San Diego State University in California, Patrick Powell redesigned and rewrote the PLP code base to build a print server package that could stand up to the rigors of an academic environment.1 Due to the number of changes that were made, the package was renamed LPRng in honor of its venerable ancestor.\ LPRng supports the LPD protocol as described in RFC 1179, but adds several nifty features. System V command emulation enables system administrators to replace System V spoolers with Berkeley spoolers while retaining compatibility with System V print commands. Several configuration file options make it easier to manage large sites or improve scalability.\ Perhaps the main strength of LPRng, though, is that it can be used to provide a unified interface to the print spooler on several different operating systems. For administrators who are more familiar with the Berkeley spooler, it offers the opportunity to replace System V spoolers with Berkeley spoolers, but such an ambitious project should not be taken lightly.\ Compiling and Installing LPRng\ The first step in using any software package distributed in source form is compilation and installation. Several modern Linux distributions have, however, adopted LPRng as the standard print spooler. Compiling Your Own Binaries\ On other operating systems, especially those descended from System V, building from source is required. LPRng is freely available in source form under the GNU General Public License from ftp://ftp.astart.com/pub/LPRng. The latest stable distribution will be stored as LPRng-stable.tgz. Documentation is distributed from the same site in the file LPRng_DOC-latest.tgz. As this chapter was written, the latest version of LPRng was 3.6.12.2 Unpacking the source\ The source is distributed as a compressed tar file. Uncompress and unpack it with tar and gzip, as shown here:\ \ \ bastet:~/lprng$ \ gunzip LPRng-stable.tgz \ bastet:~/lprng$ \ tar -xf LPRng-stable.tar \ LPRng-3.6.12/ \ LPRng-3.6.12/src/ \ . . .etc. . .\ \ \ Configuring for your system \ One of our favorite trends in free software for Unix systems is the use of the GNU autoconfiguration package. Software developers include a script that runs many small test programs to determine what library calls are available and where other software is installed. GNU autoconf reduces configuration to running the . /configure script in the top-level source directory. You will see a large number of tests. Here is the start of the procedure on a Sun running Solaris 7:\ \ \ bastet:~/lprng$ \ cd LPRng-3.6.12 \ bastet:~/lprng/LPRng-3.6.12$ \ ./configure \ creating cache ./config.cache \ checking host system type... sparc-sun-solaris2.7 \ checking target system type... sparc-sun-solaris2.7 \ checking build system type... sparc-sun-solaris2.7 \ checking for mawk... no \ checking for gawk... no \ checking for nawk... nawk \ checking for perl... /usr/bin/perl \ . . . other tests skipped . . .\ \ \ By default, LPRng will be installed in /usr/local, but the target can be set by supplying the -bindir option to the configure script, or by editing the Makefile after running the configure script. Compiling the code\ The next step is to run make to build the software. Minor confusion exists because GNU make and Berkeley make are slightly different.\ With GNU make, run make clean all. For BSD make, specify the BSD Makefile instead by using the -f option on the command line: make -f Makefile.bsd clean all. Here is the beginning of the procedure for Solaris 7:53\ \ \ bastet:~/lprng/LPRng-3.6.12$ \ gmake clean all \ gmake MAKETARGET=clean src man po \ gmake[1]: Entering directory `/export/home/gast/LPRng-3.6.12' \ gmake -C src clean \ gmake[2]: Entering directory `/export/home/gast/LPRng-3.6.12/src' \ rm -f *.o *.core *.a ? core lpc lpd lpq lpr lprm lpf lpraccnt pclbanner psbanner checkpc lp lpstat lpbanner monitor ../lpd.conf\ \ sserver sclient \ gmake[2]: Leaving directory `/export/home/gast/LPRng-3.6.12/src' \ gmake -C man clean \ gmake[2]: Entering directory `/export/home/gast/LPRng-3.6.12/man' \ gmake[2]: Nothing to be done for `clean'. \ gmake[2]: Leaving directory `/export/home/gast/LPRng-3.6.12/man' \ gmake -C po clean \ gmake[2]: Entering directory `/export/home/gast/LPRng-3.6.12/po' \ gmake[2]: Nothing to be done for `clean'. \ gmake[2]: Leaving directory `/export/home/gast/LPRng-3.6.12/po' \ gmake[1]: Leaving directory `/export/home/gast/LPRng-3.6.12' \ gmake -C src all \ gmake[1]: Entering directory `/export/home/gast/LPRng-3.6.12/src' \ gcc -g -O2 -g -Wall -DHAVE_CONFIG_H -DLOCALEDIR=\\"/usr/local/share/locale\\" -DLPD_CONF_PATH=\\"/usr/local/\ \ etc/lpd.conf\\" -DLPD_PERMS_PATH=\\"/usr/local/etc/lpd.perms\\" -DPRINTCAP_PATH=\\"/usr/local/etc/printcap\\" -DLPD_\ \ PRINTCAP_PATH=\\"/usr/local/etc/lpd_printcap\\" -DFORCE_LOCALHOST=\\"1\\" -DREQUIRE_CONFIGFILES=\\"1\\" -I..\ \ -I./include -c -o lpc.o ./common/lpc.c \ . . . lots of other stuff skipped. . . \ \ \ Installation \ As root, run make again to install the binaries to the location specified in the Makefile. If your system uses a BSD derived version of make, use Makefile.bsd :\ \ \ bastet:~/lprng/LPRng-3.6.12$ \ su - \ Password: \ Sun Microsystems Inc. SunOS 5.7 Generic October 1998 \ # \ gmake install \ gmake MAKETARGET=install src man po \ gmake[1]: Entering directory `/export/home/gast/LPRng-3.6.12' \ gmake -C src install \ gmake[2]: Entering directory `/export/home/gast/LPRng-3.6.12/src' \ echo "SETUID_ROOT IS SUID_ROOT_PERMS, PERMS 04755 -o root"; \ SETUID_ROOT IS SUID_ROOT_PERMS, PERMS 04755 -o root \ for i in /usr/local/bin /usr/local/sbin /usr/local/sbin /usr/local/libexec/filters; do \\ \ if [ ! -d $i ] ; then ./mkinstalldirs $i ; fi; \\ \ done; \ mkdir /usr/local/sbin \ mkdir /usr/local/libexec/filters \ .././install-sh -c -s -m 04755 -o root lpq /usr/local/bin \ .././install-sh -c -s -m 04755 -o root lprm /usr/local/bin \ .././install-sh -c -s -m 04755 -o root lpr /usr/local/bin \ .././install-sh -c -s -m 04755 -o root lpstat /usr/local/bin \ .././install-sh -c -s -m 04755 -o root lpc /usr/local/sbin \ . . . more skipped . . .\ \ \ Installation ends with the installation of skeleton lpd.perms and lpd.conf files in /usr/local/etc. Replacing the Existing Spooler\ When replacing an existing spooler, begin by removing your old spooler software. Kill the old daemon \ The spooler daemon on BSD systems is lpd:\ \ \ # \ kill `ps -aux \| grep lpd \| grep -v grep \| awk '{print $2}'`\ \ \ System V uses the lpsched daemon, and requires slightly different flags to ps:\ \ \ # \ kill `ps -ef \| grep lpsched \| grep -v grep \| awk '{print $2}'`\ \ \ CLASS="HeadC">Replace the vendor-provided printing programs with the LPRng programs \ First, check your system's man pages to find the name of the programs that make up your print system. To search the disk for the lpr program, use the find command:\ \ \ # \ find / -type file -name lpr -print\ \ \ After running the find command, rename the existing program lpr, and then link lpr to the LPRng lpr :\ \ \ # \ mv /usr/bin/lpr /usr/bin/lpr.orig \ # \ ln -s /usr/local/bin/lpr /usr/bin/lpr\ \ \ Modify system startup scripts \ System startup scripts launch the print spooler daemon on boot. On BSD systems, look for the command that starts lpd in /etc/rc and replace it with a line that runs the LPRng lpd instead. Alternatively, remove that line entirely and run the LPRng lpd in /etc/rc.local.\ On System V, print services are frequently started at run level 3. Look for the script that starts lpsched and delete it (or at least rename it). You also need to track down and delete the S and K links to this script, which are probably in /etc/init.d/rc3.d. We'll replace this with a script that starts the LPRng lpd. The very basic script in Example 5-1 provides a jumping off point for further customization. For example, some administrators first check that the System V daemons are stopped before starting LPRng daemons....

PrefaceixI.The Basics: Unix Queuing11.Introduction, Architecture, and History3Today's Networking Swamp4The Book in a Nutshell5File Service: the Other Half of the LAN Server10A Brief History of Printing and Publishing112.Printer Languages22PostScript23PCL27GDI303.Exploring the Spooler31The Berkeley Spooler: lpr and lpd31System V Release 4 Printing: lp46BSD to System V Translator for System Administrators57Microsoft TCP/IP Printing584.Extending the Berkeley Spooler with Print Filters63Remote Printers63Print Filters64Magic Filters705.The Next Generation Berkeley Spooler: LPRng73Compiling and Installing LPRng74Configuring LPRng79More Fun with Filters86Accounting88II.Front-End Interfaces to Unix Queues916.Connecting Windows to Unix Servers: Let's Samba93Introduction to the Server Message Block Protocol (SMB)93Compiling and Installing Samba95Configuring Samba for Print Service99Troubleshooting1107.Connecting Macintosh Networks to Unix Servers120The AppleTalk Protocol Suite120Compiling and Installing netatalk121Configuring netatalk126Configuring Macintosh Clients131Troubleshooting netatalk1378.Connecting NetWare Networks to Linux Servers141IPX and the NetWare Protocol Suite141Compiling and Installing ncpfs142Configuring Your NetWare Server144Looking at the NetWare Network from Linux148Queue Drainage with the pserver Daemon149III.Administration1519.Using SNMP to Manage Networked Printers153A Simple Introduction to SNMP153Public MIBs160SNMP Tools16110.Using Boot Servers for Basic Printer Configuration165Front Panel Configuration166Telnet167BOOTP170BOOTP's Partner in Crime: TFTP174DHCP175Configuring Printers for Dynamic Booting17811.Centralized Configuration with LDAP183What Is a Directory?183A Short Introduction to LDAP184OpenLDAP187Practical LDAP Printer Management19212.Accounting, Security, and Performance224Accounting224Security232Performance Monitoring and Tuning236Epilogue238IV.Appendixes239A.Printcap Reference241B.SNMP MIB Objects for Managing Printers253Index269