User GuideP 501/502

Linux

Adding the IP address and host name to the /etc/hosts file

The following line is added to the /etc/hosts file. The IP address and printer host name which you previously entered in the installation script will be used:

192.168.15.16 nphost # Network Printer

  • 192.168.15.16 is the IP address, nphost is the host name, from # to the end of the line is the comment.

Note

  • The /etc/hosts file contains a list of the IP addresses and host names of all hosts communicating on the network. Each entry is delimited with a space or a tab, and each line is separated with a return.

  • If you do not use NIS or DNS, you must manually enter the IP address and host name of each workstation using the network printer in the /etc/hosts file.

Adding an entry to the /etc/printcap file

The following entry is added to the /etc/printcap file, which is the configuration for printing with the lpr command. In order to use the lpr command to print, you need to edit the /etc/hosts file, add an entry for the network printer to the /etc/printcap file and create a spool directory:

##PRINTTOOL3## REMOTE

np|Network Printer:\

:rm=nphost:\

:rp=option:\

:sd=/var/spool/lpd/npd:\

:lf=/var/log/npd-errs:\

:sh:\

:mx#0:

Note

  • The /etc/printcap file is used to register the name and attributes of a printer. You must make an entry for the network printer in the /etc/printcap file of all workstations using the network printer.

  • You must make an entry for each printer option when using the same printer.

  • Each entry is separated with colons into several fields. The syntax is to begin each entry with a colon, followed by the entry, and then end with a colon, a back slash, and then a return.

  • The first line of the field is the name of the printer. You use this name when logging on to a network printer from a workstation. You can define several different names by separating each name with the "|" character.

  • The second and following lines contain the printer's attributes. Attributes are represented by two-character names referred to as capabilities. For details about capabilities, see the following table:

  • Capability

    Explanation

    Value required for the network printer.

    rm

    Host name of the printer.

    The host name that was registered with the /etc/hosts file.

    rp

    Optional specification.

    "lp" will be assigned, if the option is not used.

    Select options for printing. For details about available options, see Specifying the Device Option.

    sd

    Path name of the spool directory.

    Path name of the spool directory that is to be created.

    lf

    Path name of the log file.

    Path name of the log file.

    For example /var/log/lpd-errs.

    mx

    Maximum file size which the directory can copy. When set to 0, the size is unlimited. If nothing is entered, the size is set to 1024 k.

    None, or something suitable.

Making the spool directory

Create a spool directory under /var/spool/lpd. The name of the spool directory should be the name of the printer followed by a "d".

Note

  • The spool directory is used to control data used for print jobs. For example, when a print job is created, a temporary copy of the data used is created in the spool directory. All workstations accessing the network printer need to have a spool directory for the network printer.

  • A spool directory should be made for every network printer entry listed in the /etc/printcap file.

  • The spool directory should normally be made under /var/spool/lpd and the name should match that listed under the sd capability in /etc/printcap.

  • Change the owner and group of the directory to root and lp. The following examples show how to make a /var/spool/lpd/npd spool directory:

  • # cd /var/spool/lpd

  • # mkdir npd

  • # chown root npd

  • # chgrp lp npd

Making the log file

Error messages are logged to a file created in the /var/log directory. The log file name is the printer name followed by "d-errs".

Note

  • The log file is used for logging errors or warning messages by the UNIX workstation.

  • The log file should be made for every network printer entry listed in the /etc/printcap file.

  • The log file should normally be made under /var/log directory and the name should match that listed under the lf capability in /etc/printcap. Change the owner and group of the log file to root and lp. The following examples show how to make a /var/log/npd-errs file:

  • # cd /var/log

  • # touch npd-errs

  • # chown root npd-errs

  • # chgrp lp npd-errs