UNIX Printing

The following sections describe configuration and printing for various UNIX systems.


Configuring the hosts File

An entry in the hosts file provides the name to IP address mapping which allows the use of the printer name rather than the IP address. If your network uses DNS for name resolution, then you may not need to edit the hosts file.

Use the following procedure to add the IB-21E name and IP address entry to the /etc/hosts file.

  1. Login as root.

# login root

  1. Add the IB-2x IP address and host name to the /etc/hosts file using an editor such as vi.

    The following example shows entries in a hosts file for two servers and a printer with IP address 192.168.10.100 and host name sales3800ptr.

192.168.10.98 sales1 #Sales Server 1
192.168.10.99 sales2 #Sales Server 2
192.168.10.100 sales3800ptr #Kyocera Mita FS-3800 Printer

  1. Using the ping command, confirm the name resolution.

# ping sales3800ptr

If there is no response, try pinging the IP address to verify the network connection. If the IP address can be pinged but not the name, then there is a problem with the name resolution configuration.


Solaris 2.6 Setup

The commands and paths listed in the following procedures may vary slightly depending upon the OS version. 

Configuring the Print System

  1. Login as root.

  2. # login root

  3. Add the print server name.

  4. The following example uses sales3800ptr as the print server name and sales3800q as the print queue name:

    # lpadmin -p sales3800q -m netstandard -o protocol=bsd -o dest=sales3800ptr:lp -v /dev/null

  5. Enable the printer queue.

  6. #/usr/sbin/accept sales3800q
    #/usr/bin/enable sales3800q

Printing, Canceling a Print Job, and Checking Queue Status

The commands for these functions are explained in the Printing, Canceling a Job, and Checking Status section.

Controlling the Banner Page

A banner page is printed by default. If a banner page is not desired, add "-0 nobanner" when printing, e.g.:

    # lp -d sales3800q -0 nobanner file name
    or
    # lpadmin -p sales3800q -o nobanner

The banner page default may also be changed by editing the interface file in /etc/lp/interfaces. Open the interface file using an editor such as vi and change "nobanner=no" to "nobanner=yes".

# vi /etc/lp/interfaces/sales3800q


Solaris 2.3x - 2.5x Setup

This section explains how to setup printing in Solaris 2.5x and earlier versions. The instructions below are for Solaris 2.4. The commands and paths listed in the following procedures may vary slightly depending upon the OS version. 

A Remote Printer cannot be configured in OpenWindows using the Admintool. It should be setup using the following procedure:

Configuring the Print System

  1. Login as root.

# login root

  1. Stop the print scheduler.

# /usr/sbin/lpshut

  1. Add the print server.

The following example uses sales3800ptr as the print server name:

# w/usr/sbin/lpsystem -RO -t bsd sales3800ptr

  1. Create the print queue.

The following example uses sales3800q as the print queue name:

#/usr/sbin/lpadmin -p sales3800q -s sales3800ptr!lp

If you use csh, use "\!".

  1. Start the print scheduler.
#/usr/bin/sh /etc/init.d/lp start

  1. Enable the print queue.
#/usr/sbin/accept sales3800q
#/usr/bin/enable sales3800q

Printing, Canceling a Print Job, and Checking Queue Status

The commands for these functions are explained in the Printing, Canceling a Job, and Checking Status section.


HP-UX 9.x and 10.x Setup

The instructions below are for HP-UX 9.03. The commands and paths listed in the following procedures may vary slightly depending upon the OS version. 

Setting up the Remote Spooler

  1. Login as root.

# login root

  1. Disable the print spooler.

#/usr/lib/lpshut

  1. Add the following line to the /etc/inetd.conf file.

printer stream tcp nowait root /usr/lib/rlpdaemon-i

  1. Restart inetd.

#/etc/inetd -c

Configuring the Print Queue

  1. Create the print queue. 

The following example uses sales3800ptr as the print server name and sales3800q as the print queue name: 

#/usr/lib/lpadmin -psales3800q -mrmodel -ormsales3800ptr -orplp -ocmrcmodel -osmrsmodel -ob3 -v/dev/null

  1. Enable the print queue.

#/usr/lib/accept sales3800q
#/usr/bin/enable sales3800q

  1. Start the print scheduler.

#/usr/lib/lpsched

Printing, Canceling a Print Job, and Checking Queue Status

The commands for these functions are explained in the Printing, Canceling a Job, and Checking Status section.


IBM AIX 4.x.x Setup

The instructions below are for AIX 4.1.5. The commands and paths listed in the following procedures may vary slightly depending upon the OS version. 

Configuring the Print System

  1. Login as root.

# login root

  1. Add the print server. 

Following is an example using sales3800ptr as the print server name:

# ruser -a -p sales3800ptr

  1. Start remote printer daemon.

# startsrc -s lpd
# mkitab 'lpd:2:once:startsrc -s lpd'

Creating the Print Queue

  1. Execute smit and select "Add Print Queues".

#smit mkrque

  1. From the list, select "remote" (printer connected to remote host).

  1. Select "Standard processing from the list."

  1. Setup the following items on the "Add a Standard Remote Print Queue" screen. (For items other than the ones below, modify as necessary according to your environment.)

The following example uses sales3800ptr as the print server name (IB-2x host name) and sales3800q as the print queue name:

Item Entry
Name of QUEUE to add sales3800q
HOSTNAME of remote server sales3800ptr
Name of QUEUE on remote server lp  
TYPE of print spooler on remote server BSD
DESCRIPTION of printer on remote server [comments]


Printing, Canceling a Print Job, and Checking Queue Status

The commands for these functions are explained in the Printing, Canceling a Job, and Checking Status section.


BSD UNIX Setup

The instructions below are for SunOS 4.1.3. The commands and paths listed in the following procedures may vary slightly depending upon the OS version. 

Configuring the Print System

  1. Login as root.

# login root

  1. Register the IB-2x in the /etc/printcap file. 

The following example uses sales3800ptr as the print server name and sales3800q as the print queue name (spool directory). The etc/printcap file entries are followed by explanations of the parameters in italics: 

sales3800ptr:\ 
Print server name

:lp=:rm=sales3800ptr:rp=lp:\ 
lp= print device; this is blank when a remote printer is specified.
rm= remote printer host name as entered in the
/etc/hosts file.
rp= remote printer; use the IB-2x logical port name of
lp

:sd=/usr/spool/sales3800q:\
sd= spool directory and path

:lf=/usr/spool/sales3800q/sales3800q_errs: 
lf= error log file and path

  1. Create the Error Log File and Spool Directory as specified in the etc/printcap file. 

The following example uses sales3800q as the spool directory and sales3800q_errs as the error log file name. 

# mkdir /usr/spool/sales3800q
creates the spool directory

# touch /usr/spool/sales3800q/sales3800q_errs
creates the error log file

# chown -R daemon /usr/spool/sales3800q
changes the owner to daemon

# chgrp -R daemon /usr/spool/sales3800q
changes the group to daemon

  1. Check the lpd (printer demon) function.

# ps aux | grep lpd

If lpd is not functioning, use the following command when logged in as root.

# /usr/lib/lpd&

  1. Validate the new print queue.

# lpc restart sales3800q

Printing

To send a print file to the queue defined above, enter:

# lpr -P sales3800q file name

Canceling a Print Job

To cancel a print job currently in the queue, enter:

# lprm -P sales3800q job id

Checking the Queue Status

To check the queue status, enter:

# lpq -P sales3800q        (Short format)
or
# lpq -l -P sales3800q    
(Long format)

The status results may not be correctly displayed depending on the UNIX version.


Printing, Canceling a Job, and Checking Status

The commands for these functions are common to all the versions of UNIX covered in this manual except BSD UNIX. The BSD UNIX section covers these topics separately.

Printing

The lp command is used for printing. For details on lp command options, please refer to your UNIX manual. The following example prints the specified file name to the queue named sales3800q.

# lp -d sales3800q file name

Canceling a Print Job

A print job may be canceled with the cancel command. The following example cancels the specified job id from the queue named sales3800q.

# cancel sales3800q -job id

Note that cancel may not work properly depending on the UNIX version and the cancel timing.

Checking Queue Status

The lpstat command allows checking the queue status. The following example checks the status of the queue named sales3800q.

# lpstat -p sales3800q


ftp (File Transfer Protocol) Printing

This section explains printing via ftp. For additional details on ftp commands, please refer to your UNIX manual.

Printing via ftp

  1. Login to the IB-2x. 

IB-2x support for anonymous ftp allows logging in without entering a user name or password. The following example uses 192.168.30.161 as the IB-2x IP address.

#ftp 192.168.30.161
Connected to 192.168.30.161
220 IB-20/21 Ver1.0.0 FTP Server.
User (192.168.110.40:(none)):
331 Password required.
Password:
230 User Logged in.
ftp>
  1. Select the IB-2x logical directory. 

Always use lp as the logical directory unless printing Kanji text. The following example selects lp as the logical directory, then confirms the current directory. 

ftp>cd /lp
250 Command Ok.
ftp>pwd
257 "/lp" is current directory.
ftp>
  1. Select ASCII or BINARY transfer mode. 

BINARY mode should be used to transfer print files generated by a printer driver. ASCII mode is used to transfer text based files and automatically converts LF (linefeed) codes to CR+LF (carriage return, linefeed) codes. If no transfer mode is specified, then ASCII mode is used as the default. 

The following example sets BINARY as the transfer mode and confirms the current transfer mode.

ftp>type binary
200 Type set to I.
ftp>type
Using binary mode to transfer files.
ftp>
  1. Transfer the file using the put command. 

The following example illustrates the transfer of the finance.prn file to the IB-2x.

ftp>put finance.prn
200 PORT command Ok.
150 Open data connection.
226 Data connection closed.
ftp: 122285 bytes sent in 0.07 Seconds 1746.93 Kbytes/sec. 
ftp>

It is also possible to enter the full path to the file name and/or explicitly specify the logical directory (/lp) as in the following put examples.

ftp>put /users/export/finance.prn
ftp>put finance.prn /lp
ftp>put /users/export/finance.prn /lp
  1. Close the IB-2x ftp session.
ftp>quit

Confirming ftp Connection Status

The quote command may be used to confirm the IB-2x IP address, connected user name, and transfer mode, as shown in the following example.

ftp>quote stat
211-FTP server status:
Connected to: 192,168,30,161
User logged in: guest
Transfer type: BINARY
Data connection:Closed.
211 End of status.
ftp>