LPRng-HOWTO: System Specific Notes

Next Previous Contents

## 5. System Specific Notes

The following are a set of suggestions and recommendations for specific systems.

## 5.1 Solaris 2.4, 2.5, 2.6, 2.7

The Sun Solaris operating system is derived from the System V UNIX baseline. Use the following installation procedure.

1. First, install the LPRng software and then rename all of the existing Solaris print facilities. See the Installation section for details. You should especially look out for `lp`, `lpstat`, `lpsched`, `lpadmin`, and other executables used by Solaris for print support.
2. You may need to remove the `printer` entry in the `/etc/inetd.conf` file. Make sure it is removed.
3. Reboot. Don't try to be fancy and kill off processes, use the nlsadmin command, or other insanity. This is brutal, but appears to be necessary in order to ensure that the networking support is set up correctly.
4. When the system restarts, try using `lpq` to check to see if the `lpd` server is active.

James P. Dugal `<jpd@usl.ed>` has also made the following suggestions as well.

> `

>     From: "Dugal James P." <jpd@usl.edu>
>     To: lprng@iona.com
>     Subject: Re: [LPRng] start up trouble

>     Here are some more tips for Solaris:

>     1. If /var/spool/cron/crontabs/lp exists, remove it.

>     In fact, we actually test if /etc/init.d/lp exists on any newly-installed
>     system, and if so, we issue these commands:
>             /etc/init.d/lp stop
>             /usr/sbin/pkgrm -n SUNWpsu
>             /usr/sbin/pkgrm -n SUNWscplp
>             /usr/sbin/pkgrm -n SUNWpcu
>             /usr/sbin/pkgrm -n SUNWpsr
>             /usr/sbin/pkgrm -n SUNWpcr
>             /bin/rm -f /var/spool/cron/crontabs/lp

>     Regards,
>     -- James Dugal, N5KNX           Internet: jpd@usl.edu
>     Associate Director              Ham packet: n5knx@k5arh.#lft.la.usa.noam
>     Computing Support Services      US Mail: PO Box 42770  Lafayette, LA  70504
>     University of Southwestern LA.  Tel. 318-482-6417       U.S.A.

> `

## 5.2 Solaris, Newsprint and FrameMaker

The following is a guide to using LPRng and Sun Microsystems Newsprint by Christopher Hylands, Ptolemy Project Manager of the University of California.

The Sun Newsprint printer is actually an OEM version of the Tektronix PhaserII; Sun Microsystems appears to have dropped support for Newsprint, and the recommended migration path is to buy a PostScript printer. If you want more information on using the Newsprint system, notes are available via `http://ptolemy.eecs.berkeley.edu/~cxh/lprng.html`.

Looking through the mailing list logs, it looks like everyone was having a hard time getting lprng to work with Sun's brain-dead newsprinters. I tried using GhostScript, but the fonts were, IMHO, ugly, so I spent a little time getting the newsprint fonts to work.

The key thing was to grab the file `/usr/newsprint/lpd/if` from a SunOS4.1.3 newsprint installation. If you cannot get this code, then the installation will be extremely difficult.

To install lprng on a Solaris2.x machine, you need to first stop the existing print services and install the startup scripts for LPRng. Note that if there is a local printer, you may have to also fix the permissions of the device. Typical commands are:

> `

>     chown daemon /devices/sbus@1,f8000000/SUNW,lpvi@1,300000:lpvi0

> `

We use the following simple `if` script.

> `

>     #/bin/sh
>     # extremely simple filter script
>     /bin/cat

> `

The Sparcprinters use licensed fonts from NeWSprint. To use the licensed fonts, you must have the lprng spool directory for the sparcprinter in the same location as spool directory of the brain dead Solaris lp system. If your printer is named xsp524, then this directory would be `/etc/lp/printers/xsp524`.

The printcap entry looks like:

> `

>     sp524|524:
>         :mx=0:sf:sh:sb:
>         :lp=:rm=doppler:rp=xsp524:
>         :sd=/var/spool/lpd/sp524d:
>         :lf=/var/spool/lpd/sp524d/log:
>     xsp524|Sun SPARCprinter NeWSprint printer:
>         :mx=0:sf:sb:sh:rs:
>         :lp=/dev/lpvi0:
>         :sd=/etc/lp/printers/xsp524:
>         :lf=/etc/lp/printers/xsp524/log:
>         :af=/var/spool/lpd/xsp524/acct:
>         :if=/usr/local/libexec/newsprint/if:

> `

The `/usr/local/libexec/newsprint/if` was copied from `/usr/newsprint/lpd/if` in a SunOS4.x installation of the newsprint software. Unfortunately, the newsprint engine is so brain dead that it needs many environment variables set, so it is fairly difficult to come up with a clean script to start the engine. I made the following changes to the file.

1. First, set the path in the script. You may also need to change defaults to suit your preferences:

   > `

   >     PATH=/usr/ucb:/usr/bin:/etc:/usr/etc:/opt/NeWSprint/bin:/opt/NeWSprint/np/bin:
   >     PATH=$PATH:$NPHOME/pl.$ARCH/bin:$NPHOME/np/bin; export PATH

   > `

2. You will also need a `/etc/lp/printers/printername/.params` file. If you are using the same spooler directory as the directory that the Solaris lp system uses, then the .param file should appear there. If you are using a different spooler directory, then you will need to copy the .param file from elsewhere and edit it accordingly.
3. If you are going to move a license to a new printer, you should probably save the .param file in the old printer spooler directory. Run /opt/NeWSprint/bin/fp_install and remove the license from the old printer and assign it to the new printer. You could run /opt/NeWSprint/bin/rm_np_printer and remove the printer, but that will get rid of the .param file
4. FrameMaker under Solaris2.x uses the lp command. The fix is to edit $FMHOME/fminit/FMlpr and comment out the lp line and add an lpr line

   > `

   >     sunxm.s5.sparc)
   >         lpr -P"$PRINTER" "$FILE"
   >         #lp -c -d"$PRINTER" "$FILE"

   > `

> `

>     Christopher Hylands, Ptolemy Project Manager  University of California
>     cxh@eecs.berkeley.edu                 US Mail: 558 Cory Hall #1770
>     ph: (510)643-9841 fax:(510)642-2739       Berkeley, CA 94720-1770
>     home: (510)526-4010 (if busy -4068)       (Office: 493 Cory)

> `

## 5.3 Linux

At the time of this writing (Jan 1998), the three major Linux distributions (Slackware, Red Hat and Debian) carry an older version of LPRng. Users of those systems should download the latest stable release, and install that instead of the distributed binaries.

This is mostly important for Slackware 3.2 users, as this version installs LPRng by default. Patrick Volkerding changed the default back to BSD LPR in Slackware 3.3, as many users had experienced problems because they didn't realize they weren't using the BSD software.

Debian's `dselect` utility lets you choose between all packages. Amongst these are LPRng, as well as the traditional LPR software.

You have to make sure your kernel is configured correctly. The documentation for the kernel sources in `/usr/src/linux/Documentation/` and the `Kernel-HOWTO` will help you to generate a new kernel if needed. You will need to set the following options:

- Networking support (`CONFIG_NET`)
- TCP/IP support (`CONFIG_INET`)
- If your printer is connected to a parallel port, you will also need the `Parallel Printer Support' (`CONFIG_PRINTER`). You can use this as a module if you want.
- For a serial printer, answer `Yes' when asked if you want `Support for serial devices' (`CONFIG_SERIAL`). This is also available as a module.

Once you have done this, the current releases of LPRng will install and run without problems. See the Installing the programs section for details on how to install LPRng and deactivate the existing print support.

You may need to update the printcap file and filters. See Using the Printcap Database for details.

## 5.4 AIX

This information was supplied by Dirk Nitschke, as of August 1997, and describes how to install the LPRng package on a workstation running AIX 4.1.x and possibly 3.x.x as well. Dirk would be interested in any comments or corrections.

Printing on AIX systems is different. AIX provides a general queueing facility and printing is only one way to use it. You submit a print job to a print queue using one of the commands `qprt`, `enq`. You can use the BSD or System V printing commands `lpr` or `lp`, too. The qdaemon watches all (general) queues and knows how to handle your job. A (general) queue is defined in the file `/etc/qconfig`. The format of this file is different from the `printcap` format.

OK, how to replace the AIX printing system? There is no group `daemon` on AIX. Therefore you have to change the default group for file ownership and process permissions. We decided to use the `printq` group. The user `daemon` exists on AIX but we have chosen `lpd` as the user who runs `lpd` and all filters and owns the spooling directories. You can change the values for `group` and `user` in your `lpd.conf` file or in the sources `src/common/vars.c`. This is an example for `lpd.conf`:

> `

>     # Purpose: group to run SUID ROOT programs
>     #   default group=daemon
>     group=printq
>     # Purpose: server user for SUID purposes
>     #   default user=daemon
>     user=lpd

> `

Compile and install the LPRng package. Create your `printcap`, spooling directories, accounting and logfiles and so on. Don't forget to use checkpc to make sure that all the permissions are set correctly and the necessary files are created.

Then stop all print queues defined on your workstation. Use

> `

>     # chque -q queuename -a "up = FALSE"

> `

for this (yes, blanks around `=` are needed).

If you have local printers attached to your system you will have an `lpd` running. Stop this daemon using SMIT (Print Spooling, Manage Print Server, Stop the Print Server Subsystem). Choosing `both` also removes `lpd` from `/etc/inittab`. Maybe it's faster to do this by hand:

> `

>     # stopsrc -p'pid of /usr/sbin/lpd'
>     # rmitab "lpd"

> `

Now delete all print queues (managed by qdaemon) defined on your system. You can use SMIT for this or the commands `{mk,ch,rm}que`, `{mk,ch,rm}quedev`, `{mk,ch,rm}virprt`. The SMIT fast path is `smit rmpq`.

To start the new `lpd` at system startup you have to add an entry to `/etc/inittab`:

> `

>     # mkitab "lpd:2:once:/full/path/lpd"

> `

Some work has to be done if have have a local printer attached to your workstation. You have to create a device file like `/dev/lp0`. The SMIT fast path for this is `smit mkdev`. Choose `Printer/Plotter` and then `Printer/Plotter Devices`. Now `Add a Printer/Plotter`. To create a parallel printer device select the following:

> `

>     Plotter type:              opp Other parallel printer
>     Printer/Plotter Interface: parallel
>     Parent Adapter:            ppa0 Available

> `

Now define the characteristics of the device:

> `

>     Port Number: p

> `

(`p` is for parallel). Go to the field

> `

>     Send all characters to printer UNMODIFIED   no

> `

and select `yes`! We have had a lot of trouble with `no`. This is very important! Expect erroneous output if you choose `no`. If you have already created a device file, change the characteristics! SMIT's fast path is `smit chdev`.

Finally remove all AIX printing commands like `qprt`, `lp`, `cancel`, `lpr`, `lprm`. You will find a lot of them in `/usr/bin`. Do not remove `enq` and friends if you want to use the general queueing facility.

Now you can start your new `lpd`.

## 5.5 AppleTalk Support

Netatalk is used to communicate from TCP/IP to AppleTalk printers and vice versa. The Netatalk distribution FAQ is at:

http://www.umich.edu/~rsug/netatalk

There are two issues with using netatalk. The first issue has to do with printing to LPRng-served printers from Macs. The second issue has to do with printing from LPRng to network printers that speak AppleTalk.

And alternative version of AppleTalk support is available from

ftp://ftp.u.washington.edu/pub/user-supported/asun

## 5.6 Apple to LPRng Printing

After you have installed and gotten netatalk working, you can use the following configuration file to print from a Macintosh to an LPRng printer.

> `

>     Date: Tue, 30 Sep 1997 00:04:58 -0400 (EDT)
>     From: Edan Idzerda <edan@mtu.edu>
>     To: lprng@iona.com
>     Subject: Re: [LPRng] Netatalk configuration file
>     > Somebody posted a very nice Netatalk papd.conf file
>     > that showed the setup for LPRng.  If anybody has this
>     > handy could you post it?
>     Well, *I* use:
>     Your 32 Character Printer Name:\
>             :pr=|/your/path/to/lpr -Pprintername
>             :ppd=/your/path/to/ppd/files/yourprinter.ppd
>     --
>     Edan Idzerda    <edan@mtu.edu>
>     System Administrator -- Michigan Technological University, Houghton MI USA

> `

## 5.7 LPRng to AppleTalk Printing

The netatalk package comes with a PostScript filter called `psf`. After compilation, it is in (e.g.) `netatalk-1.4b2/etc/psf` and will be installed in (e.g.) `/usr/local/atalk/etc/`. After installation, there will also be a directory `/usr/local/atalk/etc/filters` that contains `ifpap`, `ofpap`, et al. These are just symlinks to `psf`, and `psf` will do the appropriate thing based on how it was invoked. If there's a 'pap' in the name, `psf` uses AppleTalk to talk to the printer. See psf(8) for more information.

A printcap entry for a network printer looks like the following:

> `

>     dave|Dave's 32 Character Printer Name
>         :sd=/var/spool/lpd/dave
>         :if=/usr/local/atalk/etc/filters/ifpap
>         :of=/usr/local/atalk/etc/filters/ofpap
>         :lp=/var/spool/lpd/dave/null

> `

There are three caveats to using netatalk this way.

1. The first is that `psf` (i.e., the filters) needs to run as root. You can accomplish this in one of two ways. The first requires LPD to run the programs as root:

   > `

   >     # ROOT_CFLAG=-DROOT_PERMS_TO_FILTER_SECURITY_LOOPHOLE

   > `

   The filter lines then need to look like the following:

   > `

   >         :if=ROOT /usr/local/atalk/etc/filters/ifpap
   >         :of=ROOT /usr/local/atalk/etc/filters/ofpap

   > `

   The alternative is to make `psf` SETUID root. To minimize the risk, you may want to make `psf` executable only by group `daemon`. (I haven't tested the first option. I'm currently using the second option.)

2. The second caveat is that each network printer needs a `.paprc` in its spool directory. For instance, `/var/spool/dave/.paprc` looks like this:

   > `

   >     Dave's 32 Character Printer Name:LaserWriter@Your AppleTalk Zone

   > `

   See psf(8) and pap(1) for more information.

3. The third caveat concerns the lp line in the printcap entry. For a single printer, this can be `/dev/null`. If the host spools to more than one AppleTalk printer, you shouldn't use `/dev/null` for lp. You should use `mknod` to create a null device for each printer. See psf(8).

> `

>     Chad Mynhier <mynhier@cs.utk.edu>
>     Lab Engineer, CS Department
>     University of Tennessee, Knoxville

> `

## 5.8 SAMBA, SMB and LPRng

SMB is the protocol by which a lot of PC-related machines share files and printers and other information such as lists of available files and printers. Operating systems that support this natively include Windows NT, OS/2, and Linux and add on packages that achieve the same thing are available for DOS, Windows, VMS, Unix of all kinds, MVS, and more. There is no reason why Apple Macs and indeed any Web browser should not be able to speak this protocol, and current development (in which the Samba team is heavily involved) is aimed at exactly that. Alternatives to SMB include Netware, NFS, AppleTalk, Banyan Vines, Decnet etc; many of these have advantages but none are both public specifications and widely implemented in desktop machines by default.

SAMBA is a package that supports the SMB protocol and provides a simple and easy way to import and export file systems and printer facilities. The web site for SAMBA is http://www.samba.org.

The SAMBA code is very easy to configure. See the SAMBA `doc/text/Printing.txt` and related documentation for details. In the `samba.conf` file `[global]` section you specify the `print`, `lpq`, and `lprm` commands to be used, and in the `[printing]` section the location of a temporary directory to hold print jobs when they are submitted.

> `

>     [printers]
>         path = /tmp
>         guest ok = no
>         print ok = yes
>         printing = lprng
>         load printers = yes
>         printcap name = /etc/printcap
>         print command = /usr/local/bin/lpr  -P%p -r %s
>         lpq command   = /usr/local/bin/lpq  -P%p
>         lprm command  = /usr/local/bin/lprm -P%p %j
>         lppause command = lpc hold %p %j
>         lpresume command = lpc release %p %j
>         queuepause command = lpc -P%p stop
>         queueresume command = lpc -P%p start
>         #
>         # alternative to allow userid to be specified as well
>         #
>         # You will have to add the samba UID to the 'allow_user_setting'
>         #   option in the /etc/lpd.conf file.
>         # WARNING: the %U is the name the user requests.  If you have
>         # 'guest' printer use,  then you should be aware that this
>         # will allow anybody to impersonate a another user,  and they will
>         # be able to execute the various LPRng commands as that user.
>         #
>     #   print command = /usr/local/bin/lpr -U%U -P%p -r %s
>     #   lprm command  = /usr/local/bin/lprm -P%p -U%U %j
>     #   lppause command = lpc -U%U hold %p %j
>     #   lpresume command = lpc -U%U release %p %j
>     #   queuepause command = lpc -U%U -P%p stop
>     #   queueresume command = lpc -U%U -P%p start

> `

The path= value specifies a directory where the print files are temporarily stored. This must NOT be an LPRng printer spool directory, but some other directory that Samba has write permissions for.

If you plan to use SAMBA and LPRng, then you should use the old BSD format for the printcap files, i.e.- using the `\` line continuation indicator.

## 5.9 Printing to a NetBEUI Printer

You can use the SAMBA smprint script to send a print job to an SMB client.

> `

>     #!/bin/sh -x
>     # This script is an input filter for printcap printing on a unix machine. It
>     # uses the smbclient program to print the file to the specified smb-based
>     # server and service.
>     # For example you could have a printcap entry like this
>     #
>     # smb:lp=/dev/null:sd=/usr/spool/smb:sh:if=/usr/local/samba/smbprint
>     #
>     # which would create a unix printer called "smb" that will print via this
>     # script. You will need to create the spool directory /usr/spool/smb with
>     # appropriate permissions and ownerships for your system.
>     #
>     # The /usr/spool/smb/.config file should contain:
>     #   server=PC_SERVER
>     #   service=PR_SHARENAME
>     #   password="password"
>     #
>     # Set these to the server and service you wish to print to
>     # In this example I have a WfWg PC called "lapland" that has a printer
>     # exported called "printer" with no password.
>     #
>     # E.g.
>     #   server=PAULS_PC
>     #   service=CJET_371
>     #   password=""
>     # Should read the following variables set in the config file:
>     #   server, service, password
>     config_file=.config
>     eval `/bin/cat $config_file`
>     # echo "server $server, service $service" 1>&2
>     # NOTE You may wish to add the line `echo translate' if you want automatic
>     # CR/LF translation when printing.
>     (
>     #   echo translate
>         echo "print -"
>         /bin/cat
>     ) | /usr/local/bin/smbclient "\\\\$server\\$service" \
>        "$password" -U "$server" -N -P 1>&2

> `

If the above script was in `/usr/local/libexec/filters/smbprint`, the printcap entry for this printer would be:

> `

>     pauls_pc:
>       :sd=/var/spool/lpd/%P
>       # we filter the output
>       :lp=|/usr/local/libexec/filters/smbprint
>       # you can add filters if you want to do specific actions
>       :ifhp=model=hp4
>       if=/usr/local/libexec/filters/ifhp

> `

## 5.10 Printer Specific notes

This is a small collection of miscellaneous notes about printers and applications.

## 5.11 HP Deskjet

> `

>     From: jarausch@igpm.rwth-aachen.de (Helmut Jarausch)
>     Subject: Re: Using gs (GhostScript) as a filter?
>     To: lprng@iona.com
>     Cc: Rick Gaine <rgaine@nbcs.rutgers.edu>
>     Sender: majordomo-owner@iona.com
>     Reply-To: lprng@iona.com
>     >>
>     >> Hello All:
>     >>
>     >> I would like to use LPRng 3.1.4 with an HP LaserJet 4P.  I'd like to be
>     >> able to use gs to convert PostScript files so that I can print them on my
>     >> HP 4P.  Can I do this with LPRng?  If so, could someone send me a printcap
>     >> entry?  I'd appreciate it.  I am not sure how I will be connecting the
>     >> printer yet, but I am thinking either serial or network.  Probably serial
>     >> though.  Thanks for any help.

> `

This printcap works for my Deskjet:

> `

>     djps
>         :cm=Local Deskjet(GhostScript)
>         :sd=/var/spool/djps:sf:sh:mx=0
>         :lp=/dev/plp
>         :if=/usr/local/bin/LPRng/ps_to_deskjet:

> `

and this is the script /usr/local/bin/LPRng/ps_to_deskjet

> `

>     #!/bin/sh
>     nice -19 /usr/local/bin/gs -sDEVICE=cdj550 -sPAPERSIZE=a4 \
>         -sOutputFile=- -q -r300 -

> `

> `

>     Helmut Jarausch
>     Lehrstuhl f. Numerische Mathematik
>     Institute of Technology
>     RWTH Aachen
>     D 52056 Aachen, Germany

> `

## 5.12 HP LaserJet IIISiMX

> `

>     > From majordomo-owner@iona.com Mon Aug 31 11:17:26 1998
>     > To: lprng@lprng.org
>     > Subject: [LPRng] problems printing PS-level2 jobs on LjIIsi's...
>     > Date: Mon, 31 Aug 1998 15:06:22 -0400
>     > From: "John Saroglou" <johny@yorku.ca>
>     >
>     > Greetings...
>     >
>     > I'm wondering if someone got around the problem of printing
>     > Postscript(R) Level 2  jobs on Laser Jet IIIsi printers.
>     > Our printers are direct network printers talking to a
>     > print server running solaris 2.6 and lprng-3.5.1.
>     >
>     > Is there a fix (possible drivers?) for such problem?
>     >
>     > Thanks in advance.

> `

The LaserJet IIISi does not support PostScript level 2, only level 1 (really, it is called 3SiMX). The Windows (you are under Windows, right?) HP driver for 3Si/3Si MX PostScript should produce only PS level 1.

Beware: latest version of Adobe Windows PS driver produces *ONLY* PS level 2. So if you have (or receive) level 2 files, read them using GhostScript and print a screen dump :-) or as a bitmap.

You can also convert them into PDF (using either Adobe distiller or GhostScript's ps2pdf) then use acroread to print the result. Acroread can produce either level 1 or level 2 PostScript. THE definite solution!

This trouble has nothing to do with the way they are connected, it is only a driver problem. I believe that HP had once a PS level2 update, but the price was so high that buying a new printer was a better solution!

> `

>     Bertrand
>     --
>     | Bertrand DECOUTY              | mailto:Bertrand.Decouty@irisa.fr   |
>     | IRISA - INRIA (Atelier)       | PHONE : 0299847346 / 0299847100    |
>     | Campus de Beaulieu            | FAX   : +33 (0) 299842534          |
>     | F-35042 Rennes Cedex - FRANCE | http://www.irisa.fr/               |

> `

## 5.13 HP JetDirect Interface

The HPJetDirect card can be configured through the front panel or through a set of network files. Here is a summary of the methods used from UNIX systems, or when you are desperate, to configure the printer.

### Setting Up IP Networking and Address

You can set the network address from the front panel. Reset the printer, put it in offline mode. and then use the MENU, +-, SELECT keys as follows:

> `

>      MENU  -> MIO MENU (use MENU to display MIO MENU)
>      ITEM  -> CFG NETWORK=NO*
>      +     -> CFG NETWORK=YES
>      ENTER -> CFG NETWORK=YES*
>      ITEM  -> TCP/IP=OFF* (use ITEM to display TCP/IP)
>      +     -> TCP/IP=ON
>      ENTER -> TCP/IP=ON*
>      ITEM  -> CFG TCP/IP=NO* (use ITEM to display TCP/IP)
>      +     -> CFG TCP/IP=YES
>      ENTER -> CFG TCP/IP=YES*
>      ITEM  -> BOOTP=NO*
>          (Enable BOOTP if you want to - see below)
>      ITEM  -> IP BYTE 1=0*
>          This is IP address MSB byte.
>          Use +- keys to change value, and then ENTER to change
>          Use ITEM keys to get IP BYTE=2,3,4
>      ITEM  -> SM BYTE 1=255*
>           This is the subnet mask value
>          Use +- keys to change value, and then ENTER to change
>          Use ITEM keys to get IP BYTE=2,3,4
>      ITEM  -> LG BYTE 1=255*
>          This is the Syslog server (LoGger) IP address
>          Use +- keys to change value, and then ENTER to change
>          Use ITEM keys to get IP BYTE=2,3,4
>      ITEM  -> GW BYTE 1=255*
>          This is the subnet gateway (router) IP address
>          Use +- keys to change value, and then ENTER to change
>          Use ITEM keys to get IP BYTE=2,3,4
>      ITEM  -> TIMEOUT=90
>           This is the connection timeout value.  It puts a limit
>          on time between connections.  A value of 10 is reasonable.

> `

### BOOTP Information

If you have a bootp server, you can put this information in the bootptab file. To use this, you must enable the bootp option on the printer. The T144 option specifies a file to be read from the bootp server. This file is read by using the TFTP protocol, and you must have a TFTPD server enabled. Here is a sample bootptab entry.

> `

>     # Example /etc/bootptab: database for bootp server (/etc/bootpd).
>     # Blank lines and lines beginning with '#' are ignored.
>     #
>     # Legend:
>     #
>     #       first field -- hostname
>     #                       (may be full domain name)
>     #
>     #       hd -- home directory
>     #       bf -- bootfile
>     #       cs -- cookie servers
>     #       ds -- domain name servers
>     #       gw -- gateways
>     #       ha -- hardware address
>     #       ht -- hardware type
>     #       im -- impress servers
>     #       ip -- host IP address
>     #       lg -- log servers
>     #       lp -- LPR servers
>     #       ns -- IEN-116 name servers
>     #       rl -- resource location protocol servers
>     #       sm -- subnet mask
>     #       tc -- template host (points to similar host entry)
>     #       to -- time offset (seconds)
>     #       ts -- time servers
>     #
>     # Be careful about including backslashes where they're needed.  Weird (bad)
>     # things can happen when a backslash is omitted where one is intended.
>     #
>     peripheral1:
>     :hn:ht=ether:vm=rfc1048:
>     :ha=08000903212F:
>     :ip=190.40.101.22:
>     :sm=255.255.255.0:
>     :gw=190.40.101.1:
>     :lg=190.40.101.3:
>     :T144="hpnp/peripheral1.cfg":

> `

If you are using the T144 option, you will need to create the configuration file. The sample configuration file from the HP Direct distribution is included below.

> `

>     #
>     # Example HP Network Peripheral Interface configuration file
>     #
>     # Comments begin with '#' and end at the end of the line.
>     # Blank lines are ignored.  Entries cannot span lines.

>     # Name is the peripheral (or node) name.  It is displayed on the peripheral's
>     # self-test page or configuration plot, and when sysName is obtained through
>     # SNMP.  This name can be provided in the BOOTP response or can be specified
>     # in the NPI configuration file to prevent the BOOTP response from overflowing
>     # the packet.  The domain portion of the name is not necessary because the
>     # peripheral does not perform Domain Name System (DNS) searches.  Name is
>     # limited to 64 characters.

>     name: picasso

>     # Location describes the physical location of the peripheral.  This is the
>     # value used by the interface for the MIB-II sysLocation object.  The default
>     # location is undefined.  Only printable ASCII characters are allowed.
>     # Maximum length is 64 characters.

>     location: 1st floor, south wall

>     # Contact is the name of the person who administers or services the peripheral
>     # and may include how to contact this person.  It is limited to 64 characters.
>     # This is the value used by the interface for the MIB-II sysContact object.
>     # The default contact is undefined.  Only printable ASCII characters are
>     # allowed.  Maximum length is 64 characters.

>     contact: Phil, ext 1234

>     # The host access list contains the list of hosts or networks of hosts
>     # that are allowed to connect to the peripheral.  The format is
>     # "allow: netnum [mask]", where netnum is a network number or a host IP
>     # address.  Mask is an address mask of bits to apply to the network number
>     # and connecting host's IP address to verify access to the peripheral.
>     # The mask usually matches the network or subnet mask, but this is not
>     # required.  If netnum is a host IP address, the mask 255.255.255.255 can
>     # be omitted.  Up to ten access list entries are permitted.

>     # to allow all of network 10 to access the peripheral:
>     allow: 10.0.0.0  255.0.0.0

>     # to allow a single host without specifying the mask:
>     allow: 15.1.2.3

>     # Idle timeout is the time (in seconds) after which an idle
>     # print data connection is closed.  A value of zero disables
>     # the timeout mechanism.  The default timeout is 90 seconds.

>     idle-timeout: 120

>     # A community name is a password that allows SNMP access to MIB values on
>     # the network peripheral.  Community names are not highly secure; they are
>     # not encrypted across the network.  The get community name determines which
>     # SNMP GetRequests are responded to.  By default, the network peripheral
>     # responds to all GetRequests.  The get community name is limited to 32
>     # characters.
>     #
>     # For hpnpstat and hpnpadmin, the community name can be stored in
>     # /usr/lib/hpnp/hpnpsnmp.

>     get-community-name: blue

>     # The set community name is similar to the get community name.  The set
>     # community name determines which SNMP SetRequests are responded to.  In
>     # addition, SetRequests are only honored if the sending host is on the
>     # host access list.  By default, the network peripheral does not respond
>     # to any SetRequests.  The set community name is limited to 32 characters.
>     #
>     # The set community name can come from /usr/lib/hpnp/hpnpsnmp
>     # if it is the same as the get community name.  We recommend that the
>     # set community name be different from the get community name though.

>     set-community-name: yellow

>     # SNMP traps are asynchronous notifications of some event that has occurred.
>     # SNMP traps are useful only with network management software.  Traps are
>     # sent to specific hosts and include a trap community name.  Up to four
>     # hosts can be sent SNMP traps.   The trap community name is limited to
>     # 32 characters.  The default name is public.

>     trap-community-name: red

>     # The SNMP trap destination list specifies systems to which SNMP
>     # traps are sent.  Up to four IP addresses are allowed.  If no
>     # trap destinations are listed, traps are not sent.

>     trap-dest: 15.1.2.3
>     trap-dest: 15.2.3.4

>     # The SNMP authentication trap parameter enables or disables the sending
>     # of SNMP authentication traps.  Authentication traps indicate that an SNMP
>     # request was received and the community name check failed.  By default,
>     # the parameter is off.

>     authentication-trap: on

>     # The syslog-facility parameter sets the source facility identifier that the
>     # card uses when issuing syslog messages.  Other facilities, for example,
>     # include the kernel (LOG_KERN), the mail system (LOG_MAIL), and the spooling
>     # system (LOG_LPR).  The card only allows its syslog facility to be configured
>     # to one of the local user values (LOG_LOCAL0 through LOG_LOCAL7).  The
>     # selectible option strings, local0 through local7 (configured to LOG_LOCAL0
>     # through LOG_LOCAL7, respectively) are case insensitive.  The default
>     # syslog-facility for the card is LOG_LPR.

>     syslog-facility: local2

>     # This parameter allows the card to treat hosts on other subnets as if the
>     # hosts were on the card's subnet.  This parameter determines the TCP
>     # Maximum Segment Size (MSS) advertised by the card to hosts on other subnets
>     # and affects the card's initial receive-window size.  The card will use a
>     # TCP MSS of 1460 bytes for local hosts, and 536 bytes for a non-local host.
>     # The default is off, that is, the card will use the maximum packet sizes
>     # only on the card's configured subnet.
>     #
>     # The configuration utility does not allow access to this parameter.  If you
>     # want to configure it, you must manually edit the NPI configuration file
>     # and add it to the bottom of the entry for the network peripheral.

>     subnets-local: on

>     # This parameter affects how the card handles TCP connection requests from
>     # the host.  By default, the JetDirect MPS card will accept a TCP connection
>     # even if the peripheral is off-line.  If this parameter is set to "on", then
>     # the card will only accept a TCP connection when the peripheral is on-line.

>     old-idle-mode: off

> `

### Paper Tray Selection

Be careful with your paper tray selection. You should configure the printer, using the front panel switches, to select the FIRST paper tray. See your printer documentation on this. Unfortunately, different models of HP printers have different methods of handling paper trays.

## 5.14 Lexmark Printers

Some Lexmark printers do not send end of job status back unless configured to do so. Here is what is needed to force this.

> `

>     Date: Wed, 21 Jan 1998 18:25:50 -0600 (CST)
>     From: Matt White <whitem@bofh.usask.ca>
>     To: lprng@iona.com
>     Subject: Re: [LPRng] ifhp with Lexmark Optra N printer

>     On Wed, 21 Jan 1998, Simon Greaves wrote:

>     > Apologies in advance if this is way off mark, but we've been evaluating a
>     > commercial print charging package (Geomica) which works by talking to the
>     > printer in what I think is a similar way to the ifhp filters. Lexmarks are
>     > currently a big headache because they seem to fail to return the message
>     > that they have finished printing which screws things up somewhat. In our
>     > case, it is believed to be a problem with the Lexmark firmware which they
>     > are looking into.

>     There is a fix for that...it is originally from the Lexmark 4039 series,
>     but it still works on the Optra S 1650 machines that we have (and should
>     work on the rest of the optra line).  Just send this little chunk of
>     postscript to the printer once:

>     -----------snip----------
>     %! Postscript utility file to set the 4039 printer into synchronous mode
>     serverdict begin 0 exitserver
>     statusdict begin true setenginesync end
>     -----------snip----------

>     Basically, it causes the printer to wait until it is finished printing
>     before actually reporting that it is done.  I've got 3 Optra S printers
>     running with ifhp right now with no extra options (just defaults).

>     ---------------------------------------------------------------------
>     - Matt White                         whitem@arts.usask.ca           -
>     - Network Technical Support          http://arts.usask.ca/~whitem   -
>     - College of Arts & Science          University of Saskatchewan     -
>     ---------------------------------------------------------------------

> `

## 5.15 Network Base Tektronix Phaser Printers

The `ifhp` filter supports the APPsocket protocol used by Tektronix. You will need a printcap similar to the following:

> `

>     phaser:
>      :sd=/var/spool/lpd/%P
>      # need a dummy device for output
>      :lp=/dev/null
>      # You need to specify the IP address of the printer's network interface
>      #  In this example it is 10.0.0.1 - replace with the correct value
>      # The filter will actually open the connection.
>      :if=/usr/local/libexec/filters/ifhp -Tdev=10.0.0.1%9100,model=tek

> `

## 5.16 Duplex Printing

Duplex printing is when you print on both sides of a page. Some printers which do duplex printing require that you send them special commands to force this mode. This is usually done by the FILTERS. The IFHP filter makes a stab at sending the PJL or PostScript commands to the printer. Many people have reported problems doing duplex printing, so here is a check list.

1. Make sure you have enough memory for the worst case print job. Usually the printer has to rasterize both pages before it can produce an impression. It may require much more memory than you expect.
2. Check your printer manual to discover the EXACT form of the `enter duplex mode` command and make sure that either the command is part of the job (PJL language at the start of the job, postscript header, etc), or that the filter generates the correct form.

   Note there is a PostScript Printer Description file (PPD) for most printers that support PostScript, and they even have the PJL and PostScript code for this in the PPD file.

3. It has been observed that even with what would apparently be sufficient memory, that many duplex jobs print 'oddly', that they are not aligned on the same side in the same way, etc etc. This may not be the fault of the software, but of the support for duplex operation.
4. Read the IFHP documentation, and create a configuration section in the `ifhp.conf` file for your printer.

I know this is painful, but until there is a uniform way to get the correct commands extracted from either PPD or some other database then this appears to be the only way to do it.

> Patrick Powell

## 5.17 Test Version and Portability Testing

The LPRng code has the ability to run as non-setuid software, and to use the non-default TCP/IP ports for communication. This facility allows a Test Version to be run in parallel with the normal LPRng software.

To simplify testing and portability issues, a simple test version of the spool queues and jobs has been supplied with the LPRng distribution. These queues can be placed in a suitable location (`/tmp` is common) and the LPRng software tested.

The test version of the software will use the `LPD_CONF` environment variable to specify the location of the configuration file. It will read this configuration file on startup and use the values to override the normal defaults. Since a user could maliciously set up their own configuration files with values that could compromise system security, it is strongly recommended that the test version is not made SETUID root. In fact, the LPRng code will chatter messages when the LPD_CONF ability is enabled and it is run as root.

### Compiling the Test Version

Edit `src/Makefile`, and uncomment the indicated line. Then run `make` to regenerate the distribution.

> `

>     #### ****** TESTING AND SECURITY LOOPHOLE ******************************
>     # Define GETENV to allow the LPD_CONFIG environment
>     #  variable to be used as the name of a configuration file.  In non-testing
>     #  systems,  this is a security loophole.
>     #CF := $(CF) -DGETENV

> `

### Setting Up The Test Version Spool Queues

The LPRng `TESTSUPPORT` directory contains a set of shell scripts and files that need to be installed in the appropriate directory. The following steps are used.

1. First, you need to set up your `HOST` environment variable to the fully qualified domain name of your host and your `USER` environment variable to your user name. This is done in order to get values to put into the Test Version configuration files.
2. In the `TESTSUPPORT` directory, edit the `Makefile`, and specify the location of the `Test Version` spool queues. The default location is `/tmp`; since on most systems these files are deleted or are available to everybody, a more secure location should most likely be used. DO NOT USE THE RAW TESTFILE DIRECTORY. These files need to be copied and placed in another directory.
3. The `LPD_CONF` environment variable should be set to the location of the installed `lpd.conf` file.
4. In the `TESTSUPPORT` directory, run `make`. This will copy and install the necessary files.

Example:

> `

>       CSH:
>         setenv HOST {fully qualified domain name};
>         setenv USER `whoami`
>         setenv LPD_CONF /tmp/LPD/lpd.conf
>         set path=( /tmp/LPD $path )
>         unsetenv PRINTER
>        Example:
>           setenv HOST astart1.astart.com
>           setenv USER papowell
>           setenv LPD_CONF /tmp/LPD/lpd.conf
>           set path=( /tmp/LPD $path )
>           unsetenv PRINTER
>       Bourne Shell:
>         HOST={fully qualified domain name}; export HOST;
>         USER='whoami'; export USER
>         LPD_CONF=/tmp/LPD/lpd.conf.$HOST; export LPD_CONF
>         PATH=/tmp/LPD:$PATH; export PATH
>         PRINTER=; export PRINTER
>        Example:
>           HOST=astart1.astart.com; export HOST
>           USER=papowell; export USER
>           LPD_CONF=/tmp/LPD/lpd.conf.$HOST; export LPD_CONF
>           PATH=/tmp/LPD:$PATH; export PATH
>           PRINTER=; export PRINTER
>       cd TESTSUPPORT
>       make

> `

### Running the Test Version Software

Set your current directory to the location of the compiled `Test Version` executables. Execute the various executables using `./cmd`, or set `.` as the first entry in the PATH . If it is not the first entry, then the standard system executables will be used.

1. Run `./checkpc`. this will print out the various values for the spool queues in the `Test Version` setup. If the `t1`, `t2`,... spool queues are not displayed, make sure that the LPD_CONF environment variable is set correctly and that you are using the `Test Version` executable.
2. Run `./checkpc -f`. This will fix up the (deliberately introduced) problems in the spool queues.
3. Next, run `./lpd -F` in one window, and then run `./lpq -a` in another window. This will check that the server is working.
4. You can now amuse yourself by sending jobs, setting up permissions checking, and other chores.
5. When everything appears to be working correctly, you can then remove the `Test Version` flag from the `src/Makefile`, recompile, and install the LPRng software.

Next Previous Contents