Contidos dentro
Localizar Mais Documentação
Destaques de Recursos de Suporte
| Fazer download desta apostila em PDF
Setting Up Printer Services Using the Command-Line Interface
A
- This appendix describes how to set up local printers, print servers, print clients, and network printers with the LP print service defaults using the command-line interface to the LP print service.
- If you want to skip the background information that explains the concepts of printer setup, and proceed directly to step-by-step instructions, use the following table to find the page where the instructions for a specific task begin.
-
- If you want background information related to the instructions given in this appendix, read the section, "About Setting Up Printing Using the LP Print Service Command-Line Interface" on page 276.
- You can refer to the following chapters and appendixes in this manual for additional information about printing:
-
- See Chapter 3, "Setting Up Printers," for information about setting up printing using Printer Manager, an Administration Tool application.
- See Chapter 4, "Routine Printer Administration," for information about how to administer printing services once the printers have been set up.
- See Chapter 5, "Managing Character Sets, Filters, Forms, and Fonts," for tasks specific to different types of printers.
- See Chapter 6, "Setting Printing Policies," for tasks to set printing policy, such as whether banner pages are required.
- See Chapter 7, "Troubleshooting Printing Problems," if you have trouble setting up or administering printing.
- See Appendix B, "Understanding and Customizing the LP Print Service," for a description of the LP print service and how to customize various aspects of it.
About Setting Up Printing Using the LP Print Service Command-Line Interface
- Setting up printing services using the LP print service command-line interface is complicated and error-prone. The Printer Manager offers an easier and more reliable solution. Through printer manager, you just supply the information and let the tool run the required commands.
- You should use the procedures described in this chapter only when you have special needs that require the command-line approach, like writing scripts to perform batch setup.
- Regardless of the method, the decisions you make and information you need to supply during setup are similar, whether you use the Printer Manager or command lines. Consequently, most of the conceptual and reference information you may need is described in Chapter 3, "Setting Up Printers," and it is not repeated in this appendix. Cross-references from the margin notes for the tasks point you to the information, as needed. Background information that applies only to using the command-line interface is presented before the instructions in this chapter.
Print Server Configuration
- In addition to defining the characteristics of the printer to the LP print service, you must perform the following tasks for a SunOS 5.x system (with its printer) to act as a print server, thereby providing printing services over the network:
-
- Configure the port monitor.
- Register the network listen service.
- Identify the print clients.
Configuring the Port Monitor
- For print clients to access a print server running SunOS 5.x system software, the port monitor on the print server must accept service requests and notify the LP print service of such requests. In addition, the port monitor on the SunOS 5.x print clients must be running to receive message from the server. See Peripherals Administration for a complete discussion of port monitors and the Service Access Facility.
Registering the Network Listen Service With the Port Monitor
- The LP print service uses a connection-oriented protocol to establish connections for incoming requests from remote systems. When the port monitor is configured, the following listen services are registered:
-
-
Service 0
-
listenS5
-
listenBSD
- These services "listen" for print requests from print clients, or confirmations from the server. When a communication is detected, the service hands over the process to the lpNet daemon.
Identifying Print Clients to the Print Server
- By default the print client type is BSD. If you want a SunOS 5.x print server to support a SunOS 4.1 print client, you must identify the client's type as BSD, which is then stored along with the client's name in the /etc/lp/Systems file on the server.
Setting Up a Network Printer
- A network printer is a hardware device that provides printing services to print clients without being connected to a print server. It has its own system name and IP address, and it is connected directly to the network.
- The procedures in "How to Add a Network Printer (Using the BSD Protocol)" on page 296 describe the steps needed to add a network printer to your network. Two possible variations are covered:
-
- The network printer uses the BSD protocol. The print client is set up as if it were printing to a print server that uses the BSD protocol.
Although the system administrator can choose the IP address and system name of the network printer, the administrator may not be able to change the printer name.
- The network printer uses a special protocol. The print client must use a vendor-supplied program to sent print jobs to this printer.
The procedures to set up the vendor-supplied program can vary. The vendor might supply an SVR4 interface program for you to use. If so, this program will call the command to use to send the job to the printer. If not, you will need to modify the standard interface script to call the vendor-supplied program. For the second case, you should set up a system as a print server. You can use /dev/null as the printer port, since the vendor-supplied program will actually perform the communication to the printer using the network interface. This is done by editing the per-printer copy of the standard interface to call the vendor-supplied program, and is described in the second procedure. Other print clients can be set up to either print to the print server (acting as a server to the network printer) or directly to the network printer.
- Select the procedure that identifies your network printer.
Printer Configuration Information for LP Print Service Commands
- This section describes the configuration information you may need to understand when you are using the LP print service command-line interface, rather than the Printer Manager, to set up a printer on the network:
-
- The filter names for your printer
- The universal address version of the print server's Internet Protocol (IP) address required for printing between systems
- SunOS 5.x system software provides a default set of PostScript filters, which the Printer Manager automatically installs. Some of the TranScript filters used with SunOS 4.1 have SunOS 5.x equivalents, and some do not. Table A-1 lists the default PostScript filters and identifies the TranScript filters, when applicable.
-
Table A-1
Filter |
Action | TranScript
Equivalent |
| download | Download fonts |
|
| dpost | ditroff to PostScript | psdit |
| postdaisy | daisy to PostScript |
| postdmd | dmd to PostScript |
| postio | Serial interface for PostScript printer | pscomm |
| postior | Communicate with printer |
| postmd | Matrix gray scales to PostScript |
| postplot | plot to PostScript | psplot |
| postprint | simple to PostScript | enscript |
| postreverse | Reverse or select pages | psrev |
| posttek | TEK4014 to PostScript | ps4014 |
- SunOS 5.x does not provide the following filters:
-
- TEX
-
oscat (NeWSprint opost)
- Enscript
- The postreverse, postprint, postio, and dpost filters are provided in place of Enscript.
- The Printer Manager installs the default filters. If you have printing needs not met by these filters, see Appendix B, "Understanding and Customizing the LP Print Service," for more information about filters, including how to write a new filter.
Universal Address for the Print Server
- The universal address for the print server is required only if the printer is connected to a print server on a network. As part of configuring the network listen process to listen for print requests from other systems, the universal address--the Internet Protocol address (IP address) in hexadecimal form--of the print server must be registered with the LP print service. The Printer Manager does this for you when you add a printer or add a client.
- You can obtain such information using the lpsystem -A command. The universal address has four parts, as shown in Figure A-1. The third part, the IP Address, consists of zeros. The zeros represent a special IP address that refers to the local host. The last part, RFU, means Reserved for Future Use, and could be used for other families of addresses (for example, Open Systems Interface) in the future.

Figure A-1
Setting Up Printing Services with the Command-Line Interface
- This section contains instructions to set up:
-
- Local printers
- Print servers
- Print clients
- The instructions in this section cover basic setup tasks, using the LP print service defaults with the command-line interface.
- As an alternative, see Chapter 3, "Setting Up Printers," for instructions on how to set up printing services using the Printer Manager, a graphic Administration Tool application.
· How to Set Up a SunOS 5.x Local Printer
-
Prerequisite
-
- System installed with SunOS 5.x system software
-
Information You Need
-
- System's superuser password
- Device name (typically, /dev/term/a, /dev/term/b, or /dev/bpp0)
- Unique printer name
- Printer type
- Printer file content type
- Printer description
-
-
Connect the printer to the system and turn on the power to the printer.
See the printer vendor's manual and your system's installation manual for information about switch settings and cabling requirements. You usually connect printer cables to a serial port, but in some cases you can use a parallel port.
-
On the system to which the printer is connected, log in as, or become, root.
-
Type chown lp /dev/address and press Return. The lp user now owns the port device to which the printer is connected. For a serial port, address is usually term/a or term/b. For a parallel port, address is usually bpp0.
-
Type chmod 600 /dev/address and press Return. Now only lp can access the printer port device.
-
Note - You can combine steps 5, 6, and 7 by entering the lpadmin command once with the -p, -T, and -I options used together in the command.
-
-
Type lpadmin -p printer-name -v /dev/address and press Return. Give the printer a name unique on your network and associate that name with the port. The printer is registered with the LP print service.
-
-
Type lpadmin -p printer-name -T printer-types and press Return. The printer type is used to extract information from the terminfo database. For a local PostScript printer, use uppercase PS for PostScript or uppercase PSR for PostScript Reverse (to reverse the order of the pages). You must specify printer type. If you do not, it defaults to unknown. You can specify more than one printer type; see lpadmin(1M).
-
Note - If you specify printer type PS and pages print in reverse order, try printer type PSR. If you specify more than one printer type, you must specify simple as the content type.
-
-
Type lpadmin -p printer-name -I file-content-types and press Return. Specify the file content types that the printer can print directly, which are added to the printer type (as specified with the -T option in step 6). Table A-2 lists some common file content types.
-
Table A-2
| Types | Description |
| cif | Output of BSD cifplot |
| daisy | Daisy wheel printer |
| dmd | DMD |
| fortran | ASA carriage control format |
| otroff | Cat typesetter instructions generated by BSD or pre-System V troff |
| plot | Plotting instructions from Tektronix displays and devices |
| postscript | PostScript language |
| raster | Raster bitmap format for Varian raster devices |
| simple | ASCII file |
| tex | DVI format files |
| troff | Device-independent output from troff |
- For a local PostScript printer, you should use postscript, or postscript,simple, if in fact, the printer supports these types.
-
Note - PS and PSR are not file content types; they are printer types.
- If you omit -I, the file content list defaults to simple. You can specify one or more file content types. Separate the names with commas. Or, you can use spaces to separate names, enclosing the word allow: and the list of users in quotation marks. If you use the -I option, simple is no longer the default, but must be included in the list to be valid. Use any as the file content type to bypass filtering. In this case, only file types that can be printed directly by the printer should be sent to it. Use -I "" to specify a null file content type list, which means an attempt should be made to filter all files, because the printer can directly print only files that exactly match its printer type.
-
-
Initialize the system's print filters.
You need to set up the print filters only once, when you install a printer (or if you reinstall the operating system). This step is not repeated for additional printers, unless they require different filters, which you must create (see "Creating a New Print Filter" on page 332). Print filters are used to convert the content type of a file to a content type acceptable to a printer. The system-supplied filters support only PostScript printers.
a. Type cd /etc/lp/fd and press Return. Change to the directory containing the print filter descriptor files, so you do not have to give their full path to the lpfilter command.
-
b. Install the filters.
- If you have a PostScript printer, you must install the filters for PostScript (postscript) content type; installing the filters for other content types is optional.
- The following examples show several ways to install the filters using the lpfilter -f filter-name -F filter-name.fd command.
- You can create a script that installs all the filters described in /etc/lp/fd by typing:
-
# sh
# for f in 'ls | sed 's/.fd$//''
> do
> lpfilter -f $f -F $f.fd
> done
#
|
- Or you could create a script that installs the required PostScript filters by typing:
-
# sh
# for f in download dpost postio postior postprint postreverse\
postdaisy postdmd posttek postplot postmd
> do
> lpfilter -f $f -F $f.fd
> done
#
|
- Or you can type the command line for each filter:
-
# lpfilter -f download -F download.fd
# lpfilter -f dpost -F dpost.fd
# lpfilter -f postio -F postio.fd
# lpfilter -f postior -F postior.fd
# lpfilter -f postprint -F postprint.fd
# lpfilter -f postreverse -F postreverse.fd
# lpfilter -f postdaisy -F postdaisy.fd
# lpfilter -f postdmd -F postdmd.fd
# lpfilter -f posttek -F posttek.fd
# lpfilter -f postplot -F postplot.fd
# lpfilter -f postmd -F postmd.fd
|
- The following table lists the filter names to use for other common file content types.
-
Table A-3
| File Content Type | Type Name | Filter Name |
| Plotter | plot | postplot |
| Daisy Wheel | daisy | postdaisy |
| ASCII | simple | postprint |
| TEK 4014 | tek | posttek |
| DMD | dmd | postdmd |
| Matrix | md | postmd |
- The lpfilter command installs the filter description in the filter table, /etc/lp/filter.table. It uses the filter descriptor file (filter-name.fd from the /etc/lp/fd directory) to determine the characteristics of the filter and to find out where the filter program is located. PostScript filters are located in the /usr/lib/lp/postscript directory. You may locate other types of filters you add to the system in a different directory under /usr/lib/lp.
-
-
Type accept printer-name and press Return.
The printer is now ready to begin accepting (queuing) print requests.
-
-
Type enable printer-name and press Return.
The printer is now ready to process print requests in the print queue.
-
-
(Optional) Type lpadmin -p printer-name -D "comment" and press Return.
Attach a description giving the user helpful information, like where the printer is located. The comment is displayed as part of the printer status.
-
(Optional) Type lpadmin -d printer-name and press Return. The printer you specify is established as the default printer for the system. Define a default printer even if there is only one printer configured for a system.
-
Type lpstat -t and press Return.
Check the messages displayed to verify that the printer is accepted and enabled.
Example of How to Set Up a PostScript Printer
- This example is based on a network of five different systems. You have one PostScript printer on the network. You decide to designate terra as the print server, because it can support printing for all five systems.
- You establish the following characteristics for this printer:
-
- Printer name: luna
- Printer type: PS
- File content types: postscript,simple (from Table A-2 on page 282)
- Device Name: /dev/term/b (determined by the port to which the printer is connected)
-
terra% su
# lpstat -r
scheduler is running
# chown lp /dev/term/b
# chmod 600 /dev/term/b
# lpadmin -p luna -v /dev/term/b
# lpadmin -p luna -T PS
# lpadmin -p luna -I postscript,simple
# cd /etc/lp/fd
# lpfilter -f download -F download.fd
# lpfilter -f dpost -F dpost.fd
# lpfilter -f postio -F postio.fd
# lpfilter -f postior -F postior.fd
# lpfilter -f postprint -F postprint.fd
# lpfilter -f postreverse -F postreverse.fd
# accept luna
destination "luna" now accepting requests
# enable luna
printer "luna" now enabled
# lpadmin -p luna -D "PostScript Laser printer in Building 5, Room 262"
# lpadmin -d luna
# lpstat -t
scheduler is running
system default destination: luna
device for luna: /dev/term/b
luna accepting requests since Mon Mar 4 14:37:55 PST 1994
printer luna is idle. enabled since Mon Mar 4 14:37:59 PST 1994. available.
# lp -d luna /etc/passwd
request id is luna-1 (1 file)
#
|
· How to Set Up a SunOS 4.1 Local Printer
-
Prerequisite
-
- System installed with SunOS 4.1 system software
-
Information You Need
-
- System's superuser password
- Device name (typically, /dev/term/a or /dev/term/b)
- Unique printer name
* Set up the printer according to the instructions in the SunOS 4.1 system administration book, System and Network Administration (800-3805-10).
The interoperation of SunOS 4.1 and SunOS 5.x printing systems means that a printer on a SunOS 4.1 system can serve SunOS 5.x print clients.
· How to Set Up a SunOS 5.x Print Server
-
Prerequisites
-
-
Information You Need
-
- Server's superuser password
- Names of printer, server, and clients
-
-
If not already done, set up the local printer.
See "How to Set Up a SunOS 5.x Local Printer" on page 281 for instructions.
-
Log in as, or become, root on the server system.
-
Configure the port monitor to accept service requests.
-
Note - Perform step 3 only once, the first time you configure a print server system. Once registered, the processes and daemons are automatically restarted by the Service Access Controller when the system is rebooted.
-
a. Type sacadm -a -p tcp -t listen \ -c "/usr/lib/saf/listen tcp" -v `nlsadmin -V` -n 9999 and press Return.
- The network listen service starts to listen for incoming TCP/IP requests. The options to the sacadm command are listed in Table A-4.
-
Table A-4 sacadm
| Option | Description |
| -a | Adds the -p port |
| -t | Identifies the type of service |
| -c | Tells which command to use to start the port monitor |
| -v | Identifies the version of the network listen process |
| -n | Specifies the number of times the Service Access Controller will restart the process, if it dies |
-
b. Type sacadm -l and press Return.
- When the network listen service is starting, the following information is displayed:
-
# sacadm -l
PMTAG PMTYPE FLGS RCNT STATUS COMMAND
tcp listen - 9999 ENABLED /usr/lib/saf/listen tcp #
|
-
Note - It may take several minutes before the network listen service is enabled.
-
-
Register the network listen service with the port monitor.
-
Note - Perform step 4 only once, the first time you configure a print server system. Once registered, the processes and daemons are automatically restarted by the Service Access Controller when the system is rebooted.
-
a. Type lpsystem -A and press Return. The system's universal address is displayed.
-
# lpsystem -A
00020203000000000000000000000000
|
- You use the universal address, or a modified version of it, in step 4b. For the modified version, replace port number 0203 with 0ACE (the first digit is a zero). See the section "Universal Address for the Print Server" on page 280 for more.
-
Note - You must type the characters \x at the beginning of the universal (or modified universal) address in the next step exactly as shown. In addition, the address must be enclosed in single quotation marks so the backslash is not stripped off.
-
b. Type pmadm -a -p tcp -s type -i root -m 'nlscmd' -v 'nlsadmin -V' and press Return.
- This command configures the port monitor to listen for requests from the LP print service. Use the following table to determine which values to use for different service types as input to the command. Repeat this step for each of the three service types.
-
Table A-5 pmadm
type
Value | nlscmd
Value |
| lp | nlsadmin -o /var/spool/lp/fifos/listenS5 |
| lpd | nlsadmin -o /var/spool/lp/fifos/listenBSD -A '\xaddress' |
| 0 | nlsadmin -c /usr/lib/saf/nlps_server -A '\xmodified_address' |
-
c. Type cat /var/saf/tcp/log and press Return. Examine the messages displayed to make sure that the services are enabled and initialized.
- The following example illustrates step 4. The print server is terra. All three types of network listen services are registered.
-
# lpsystem -A
00020203000000000000000000000000
# pmadm -a -p tcp -s lp -i root -m 'nlsadmin -o \
/var/spool/lp/fifos/listenS5' -v 'nlsadmin -V`
# pmadm -a -p tcp -s lpd -i root -m 'nlsadmin -o \
/var/spool/lp/fifos/listenBSD -A \
'\x00020203000000000000000000000000'' -v 'nlsadmin -V'
# pmadm -a -p tcp -s 0 -i root -m 'nlsadmin -c \
/usr/lib/saf/nlps_server -A \
'\x00020ACE000000000000000000000000'' -v 'nlsadmin -V'
terra# cat /var/saf/tcp/log
10/28/91 10:22:51; 178; @(#)listen:listen.c 1.19.9.1
10/28/91 10:22:51; 178; Listener port monitor tag: tcp
10/28/91 10:22:51; 178; Starting state: ENABLED
10/28/91 10:22:51; 178; Service 0: fd 6 addr \
\x00020ACE000000000000000000000000
10/28/91 10:22:51; 178; Service lpd: fd 7 addr
\x00020203000000000000000000000000
10/28/91 10:22:52; 178; Net opened, 2 addresses bound, 56 fds free
10/28/91 10:22:52; 178; Initialization Complete
#
|
-
-
(Optional) Perform additional setup steps, depending on the type of printer, and the printing policies you want to set for your site.
For example, you may want to create a class of printers and include the printer in that class. Or, you may want to set up the printer to use a certain form. See Chapter 5, "Managing Character Sets, Filters, Forms, and Fonts," and Chapter 6, "Setting Printing Policies," for more information.
- The next task, after you have set up the print server, is usually to set up print clients. It is hard to tell if you set up the print server correctly until you set up a print client and try to use the printer on the print server. See "How to Set Up SunOS 5.x Print Clients" on page 292 or "How to Set Up SunOS 4.1 Print Clients" on page 295.
· How to Set Up a SunOS 4.1 Print Server
-
Prerequisites
-
- Working printer connected to a system running SunOS 4.1 system software
- Network that enables communication between systems
-
Information You Need
-
- Server's superuser password
- Names of printer, server, and clients
* Set up the print server according to the instructions in the SunOS 4.1 system administration book System and Network Administration (800-3805-10).
The interoperation of SunOS 4.1 and SunOS 5.x printing means that an existing 4.1 print server can be used by a SunOS 5.x print client by simply setting up the SunOS 5.x print client.
· How to Set Up SunOS 5.x Print Clients
-
Prerequisites
-
-
Information You Need
-
- Server's superuser password
- Clients' superuser password
- Names of printer, server, and clients
- Printer type
- Printer file content type
-
On each SunOS 5.x print client: 1. Become root.
-
Note - The next step is the key step that differs when the print client is using a SunOS 5.x print server versus a SunOS 4.1 print server.
-
-
Type lpsystem -t type server-system-name and press Return. This step identifies the print server system and specifies its type as BSD (for SunOS 4.1) or System V (for SunOS 5.x). BSD is the default.
-
Note - You can combine steps 6, 7, and 8 by entering the lpadmin command once with the -p, -s, -T, and -I options used together in the command.
-
-
Type lpadmin -p printer-name -s server-system-name and press Return. This step identifies the printer on the server system. If you want users on the print client to be able to refer to the printer by a name that is not the same as on the server, enter -p printer-name1 -s server-system-name!printer-name2.
-
(Optional) Type lpadmin -p printer-name -T unknown and press Return. Specify a printer type of unknown. The actual printer type has to be specified only when the printer is set up as a local printer. If you omit this step, a printer type of unknown results by default.
-
(Optional) Type lpadmin -p printer-name -I any and press Return. You should specify the file content type as any. This causes files to be filtered on the print server according to the file contents set up for the printer on the server.
-
Type accept printer-name and press Return. The LP print system now accepts print requests.
-
Type enable printer-name and press Return. The printer is enabled and can process print requests.
-
(Optional) Type lpadmin -p printer-name -D "comment" and press Return.
Attach a description giving the user helpful information, like where the printer is located. The comment is displayed as part of the printer status.
-
(Optional) Type lpadmin -d printer-name and press Return. The printer you specify is configured as the default printer for the client system.
-
-
Type lpstat -t and press Return.
Check the messages that are displayed to verify that the printer is accepted and enabled.
-
-
Type lp -d printer-name filename and press Return. The file you chose is sent to the printer. If the file did not print correctly, or did not print on the printer you expected, see Chapter 7, "Troubleshooting Printing Problems," for help.
Examples of Setting Up Print Clients
- Following are two examples of how to set up a SunOS 5.x print client: one for a print client using a SunOS 5.x print server and one for a client using a SunOS 4.1 server.
-
Setting Up SunOS 5.x Print Clients for a SunOS 5.x Print Server This example shows the steps for setting up the SunOS 5.x print client mars to print on luna, which is connected to the SunOS 5.x print server terra. Beginning with the lpsystem command, you would perform the same steps on other print clients like venus, mercury, and jupiter to let them become print clients of terra. You must tell each client system about the print server and the characteristics of its printer.
-
mars% su
# lpsystem -t s5 terra
"terra" has been added.
# lpadmin -p luna -s terra -T unknown -I any
# accept luna
destination "luna" now accepting requests
# enable luna
printer "luna" now enabled
# lpadmin -p luna -D "PostScript Laser printer in Building 5, Room 262"
# lpadmin -d luna
# lpstat -t
scheduler is running
system default destination: luna
system for luna: terra
luna accepting requests since Mon Mar 4 15:15:21 PST 1994
printer luna is idle. enabled since Mon Mar 4 15:15:26 PST 1994. available.
# lp /etc/passwd
request id is luna-23
|
-
Setting Up SunOS 5.x Print Clients for a SunOS 4.1 Print Server The only differences when setting up a print client for a SunOS 4.1 print server instead of a SunOS 5.x print server are that you:
-
- Do not use the lpsystem command on the print server to identify the print clients
- Use -t bsd instead of -t s5 in the lpsystem command
· How to Set Up SunOS 4.1 Print Clients
- Refer to the SunOS 4.1 system administration book, System and Network Administration (800-3805-10), for details. Only a summary of the steps for setting up a SunOS 4.1 print client is given here.
-
Prerequisites
-
-
Information You Need
-
- Print server's superuser password
- Print client's superuser password
- Names of printer, server, and clients
-
On each SunOS 4.1 print client: 1. Log in as root on the client system.
-
-
Add the remote printer to /etc/printcap.
-
Create the spooling directory for that printer and set correct permissions/ownership.
-
Send a file to the printer to verify that the setup works.
If there are problems, see Chapter 7, "Troubleshooting Printing Problems," for help.
Example of Setting Up a SunOS 4.1 Client for a SunOS 5.x Print Server
- Suppose you have a SunOS 4.1 system named neptune. You want to let neptune print files on the printer luna on the SunOS 5.x system terra.
-
neptune% su
# vi /etc/printcap
luna|terra:\
:lp=:rm=terra:rp=luna:br#9600:rw:\
:lf=/var/spool/lpd/luna/log:\
:sd=/var/spool/lpd/luna:
# cd /var/spool/lpd
# mkdir luna
# chmod 744 luna
# chgrp daemon luna
# lpr -Pluna /etc/passwd
|
Adding a Network Printer
-
Prerequisites
-
- System running SunOS 5.x system software
- Network communication between system and network printer
-
Information You Need
-
- Print client's superuser password
- Name of network printer
- IP address and system name of network printer
· How to Add a Network Printer (Using the BSD Protocol)
-
-
Connect the printer to the network and turn on the power to the printer.
See the printer vendor's manual for information about configuring the IP address, setting hardware switches and cabling requirements.
-
Become root on the print client.
-
Type lpsystem -t bsd system-name and press Return.
-
-
Use the lpadmin command to add the printer and specify printer and content types. If the network printer comes with a preset printer name, use step a. Otherwise, use step b.
a. Type lpadmin -p printer-name -s system-name -T unknown -I any and press Return.
b. Type
-
-
lpadmin -p local-printer-name -s system-name!remote-printer-name
-T unknown -I any and press Return.
- If the network printer has a preset- printer name, specify a local printer name (local-printer-name) and the system-name with the network printer's hard coded printer-name. Be careful when using the exclamation point (!) because some shells treat this as a special character.
-
-
Type accept printer-name and press Return. The LP print system now accepts print requests.
-
Type enable printer-name and press Return. The printer is enabled and can process print requests.
-
(Optional) Type lpadmin -p printer-name -D "comment" and press Return.
Attach a description giving the user helpful information, like where the printer is located. The comment is displayed as part of the printer status.
-
(Optional) Type lpadmin -d printer-name and press Return. The printer you specify is configured as the default printer for the client system.
-
Type lpstat -t and press Return.
Check the messages that are displayed to verify that the printer is accepted and enabled.
-
-
Type lp -d printer-name filename and press Return. The file you chose is sent to the printer. If the file did not print correctly, or did not print on the printer you expected, see Chapter 7, "Troubleshooting Printing Problems," for help.
· How to Add a Network Printer (Using a Special Protocol)
-
-
Connect the printer to the network and turn on the power to the printer.
See the printer vendor's manual for information about the IP address, hardware switches, and cabling requirements.
-
On the system that will act as a print server, log in as, or become, root.
-
Use the lpadmin command to configure the printer. If you are using a vendor-supplied interface script, use step a to specify the name of the script with the -i option. If you are modifying the standard interface script, follow steps b-d.
a. Type lpadmin -p printer-name -v /dev/null -T unknown -I any -i vendor-supplied interface and press Return. Provide the printer name, associate that name with the port, and identify the printer type and file content type.
b. Type lpadmin -p printer-name -v /dev/null -T unknown -I any and press Return.
Provide the printer name, associate that name with the port, and identify the printer type and file content type.
c. Modify the standard printer interface script to include the name of the vendor-supplied printing program. Three lines in this file are assigned to the FILTER variable: FILTER="/usr/lib/lp/postscript/postio" FILTER="/usr/lib/lp/postscript/postreverse | \ /usr/lib/lp/postscript/postio" FILTER="${LPCAT} 0"
d. Edit the printer interface script, /etc/lp/interface/printer-name, to change these lines so that they specify the vendor-supplied program instead of the standard programs.
The vendor-supplied program can be placed in the /etc/lp/interfaces directory, and it can be called from the interface script using that path name. The standard interface will use the value of the FILTER variable as the program to run to send print jobs to the device. This variable is used further down in the standard interface program:
-
-
0<${file} eval ${FILTER} 2>&1 1>&3
-
-
Type accept printer-name and press Return.
The printer is now ready to begin accepting (queuing) print requests.
-
Type enable printer-name and press Return.
The printer is now ready to process print requests in the print queue.
-
(Optional) Type lpadmin -p printer-name -D "comment" and press Return.
Attach a description giving the user helpful information, like where the printer is located. The comment is displayed as part of the printer status.
-
(Optional) Type lpadmin -d printer-name and press Return. The printer you specify is established as the default printer for the system. Define a default printer even if there is only one printer configured for a system.
-
Type lpstat -t and press Return.
Check the messages displayed to verify that the printer is accepting print jobs and enabled.
|
|