Info Docs document 16308 SYNOPSIS: Solaris 2.6 Printer Quick Reference Guide *************************************** * Solaris 2.6 Print Guide and FAQ's * *************************************** (Version 1.0 /10/14/97) KEY INFO 1) ADD A PRINTER Without a naming service Command line local printer setup (lpadmin) Command line remote printer setup (lpadmin) Command line remote printer setup (lpset) Adding a networked printer (2.6 only) With a naming service NIS NIS+ 2) REMOVE A PRINTER Without a naming service With a naming service NIS NIS+ 3) Customization Default printer 4) Solaris 2.6/SSPC info 5) Patches 6) Troubleshooting 7) FAQ KEY INFO: There are a few ways to add, and remove print queues when Solaris 2.6 or SSPC is installed.It is important to use one method of administrating the printer configuration, and stick to that method. Solaris 2.6 and SSPC print administration methods: Command line (see man pages): lpadmin (adding/removing print queues, see below) lpset (adding/removing print queues, see below) lpget list (view print queue setup) lpstat -t (view print queue setup) fncreate_printer (populate NIS+/FNS namespace) fndestroy (removing NIS+/FNS print queues in the namespace) GUI's: Solstice (Solstice Adminsuite, can put printer configuration into the name space) Admintool (this GUI uses lpadmin, and print queues may be seen by Solstice admintool, and will NOT be put into a name space) NOTE: If you are NOT running Solstice Adminsuite 2.3 (Solaris 2.6 uses this by default), and the current patches, you should call 1-800-usa-4-sun, and request an upgrade (See below for the existing patches). 1) ADD A PRINTER: Without a naming service COMMAND LINE LOCAL PRINTER SETUP: lpadmin -p <printername> -v /dev/cua/b or a -> serial port (for parallel port device is /dev/bpp0 for Sbus or /dev/ecpp0 for PCI) chmod 600 /dev/cua/b chown lp /dev/cua/b chgrp lp /dev/cua/b lpadmin -p <printername> -T PS -I postscript -h (postscript filtering queue) accept <printername> enable <printername> lpadmin -d <printername> (set default printer) * To make printers available to Solaris 2.6/SSPC print clients a. files, copy the printers.conf b. nis, make the nis map (see nis, nis+ info below) c. nis+, fncreate_printer (see nis, nis+ info below) ******** COMMAND LINE REMOTE PRINTER SETUP (lpadmin): This: # lpadmin -p <printername> -s <servername> or: # lpadmin -p <different_name> -s <servername\!printername> (different local and remote names for the same queue) # lpadmin -p <printername> -T unknown -I any # lpadmin -d <printername> (set default printer) NOTE: It is not suggested to use the above print queue setup to spool directly to a printer on the network, and it is NOT supported. (See "Adding a Network Printer" [2.6 only] below for supported network print queue setup) ******* COMMAND LINE REMOTE PRINTER SETUP (lpset): # /usr/bin/lpset -a bsdaddr=hostname,printername,Solaris ******* ADDING A NETWORKED PRINTER (2.6 only): # lpadmin -p <queuename> -o protocol=bsd,dest=<print_dest> -T PS -I postscript -v /dev/null -i /usr/lib/lp/model/netstandard NOTE: The above command is one continues line. chmod 666 /dev/null chown root /dev/null chgrp sys /dev/null accept <queuename> enable <queuename> NOTE: The <print_dest> should be the host name in the /etc/hosts file, or the IP address. NOTE: This above command can also be done by using the GUI, Adminsuite 2.3, simply type solstice &, click the Print Manager icon, enter none (for no name service) pull down Edit then select the Install Network Printer option. This option cannot be used with a name service, the /etc/printers.conf file can be put into a name service map or table if needed. NOTE: accept, enable, and lpsystem commands are no longer used for adding REMOTE print queues with Solaris 2.6/SSPC. With a naming service, use Solstice, or the below command line. ****** NIS: Create a printer queue with one of the above commands. This will make an entry in the /etc/printers.conf, then copy both the /etc/printers.conf and the make file excerpt to the NIS master. Example: # rcp /etc/printers.conf <nismaster>:/etc/printers.conf # rcp /usr/lib/print/Makefile.yp <nismaster>:/var/yp Then on the nismaster run a make: Example: # make -f /var/yp/makefile -f /var/yp/Makefile.yp printers.conf ***** NIS+: With a naming service, use Solstice, or the below command line. To initialize the NIS+ namespace (i.e. Deploying FNS): To deploy FNS with NO user and host context Before executing any command, an environment variable NIS_GROUP must be set, which is the admin group for FNS. % setenv NIS_GROUP admin (*note: common error - "create of ctx_dir server failed, no permissions" the environment variable isn't set or set correctly) # /usr/sbin/fncreate -t org -o org// Here the "-o" is very important, if this option is omitted the command will create host and user contexts. If the command completes successfully, no output will be printed, else error messages will be printed. Possible error message: No Permission This is a very common error message. Try keylogin to authenticate yourself to NIS+. To populate the printers context: # fncreate_printer -f /etc/printers.conf thisorgunit/service/printer NOTE: After populating the context (FNS/NIS+ namespace), what ever printer configuration setup in /etc/printers.conf will be see by all NIS+ clients. ******* How to add one printer at the command line (lpset): # lpset -n fns -a bsdaddr=server,<printername>,Solaris <printername> NOTE: To see the printers available, use lpget list, or lpstat -t 2) REMOVE A PRINTER Without a namespace COMMAND LINE PRINTER REMOVAL # lpadmin -x <printername> (for print queue added with lpadmin) OR # lpset -x <printername> (for print queue added with lpset) ****** NIS Remove the print queues from /etc/printers.conf by using Solstice, lpadmin, or lpset, or by hand, then run a make. NOTE: Follow the COMMAND LINE LOCAL PRINTER REMOVAL above. ******* NIS+ In some cases, creating printers with the Print Manager (Solstice) and the command line can cause problems. At some point one may try to delete a printer using the Printer Manager; or lpadmin, and it may successfully deleted from the print database, but not from the NIS+ maps. To fix, try a combination of the below commands: # lpset -x <printername> (for print queue added with lpset) # lpadmin -x <printername> (for print queue added with lpadmin) # fnunbind thisorgunit/service/printer/<printername> If fnunbind returns an error message: "Unbind of 'thisorgunit/service/printer/<printername>' failed: Naming in use: '<printername>'" Use the following command to destroy the printer, after the above commands have been run first: # fndestroy thisorgunit/service/printer/<printername> 3) CUSTOMIZATION With Solaris 2.6/SSPC you will see every printer which has been added to the namespace. You can customize a system to see only the printers you want, by making a .printers file in the home directory. ~/.printers * This file live in a users home directory * Printer name aliases * File format <alias><tab><printer> _default<tab><printer> _all<tab><printer1,printer2,printer3> NOTE: _default makes a default printer for a user _all makes a list of printers to be used with lpstat or cancel ****** Default printer There are a few ways to set the default printer: 1) # lpadmin -d <printername> (This puts an _default in the /etc/printers.conf 2) The above .printers file in a users home directory 3) The variable LPDEST (i.e. the users env, # setenv LPDEST hp Make the print queue hp default) 4) The variable PRINTER (i.e. the users env,# setenv PRINTER hp Make the print queue hp default) 4) Solaris 2.6 and SSPC info: See Solstice Adminsuite Print Administration Guide for Solaris 2.6 Part# 802-7906-10 OR Answerbook2 http://answerbook_host:8888/ then search for printing OR Answerbook search for printing OR www.sun.com search for SSPC or printing 5) PATCHES: PATCHES: SSPC: 104734 SSPC 1.0: SunSoft Print Client patch (2.3-2.5.1 only) OTHER PATCHES, FNS: 103743 SunOS 5.5.1: XFN source modifications for BIND 4.9.3 103744 SunOS 5.5.1_x86: XFN source modifications for BIND 4.9.3 103745 SunOS 5.5.1_ppc: XFN source modifications for BIND 4.9.3 103746 SunOS 5.5: XFN source modifications for BIND 4.9.3 103747 SunOS 5.5_x86: XFN source modifications for BIND 4.9.3 ADMINSUITE: 104468 Solstice Adminsuite 2.3/AutoClient 2.1: Jumbo patch 6) Troubleshooting: See man pages on: fnlist fnlookup fncreate fncreate_printer fndestroy fnunbind nisls niscat ypcat 7.) FAQ 1.1) HOW TO CONVERT PRINTER INFORMATION FROM 2.X & 4.X TO SOLARIS 2.6 1.2) PRINTER ALIASES 1.3) PRINTER CAN'T BE REMOVED, CAN'T REMOVE THE QUEUED FILES (i.e CLEARING THE PRINT QUEUES) 1.4) DISABLE THE BANNER PAGE 1.5) CAN'T OPEN THE PRINTER PORT 1.6) MY POSTSCRIPT PRINTER BLINKS FOR SEVERAL MINUTES BUT NEVER PRINTS 1.7) WHAT IS THE NAME FOR THE PARALLEL PORT, WHAT CABLE DO I USE 1.8) HP 4 LASERJET PRINTER SETTINGS FOR SERIAL PORTS 1.9) WHAT DO I SET MY PRINTER TYPE TO 2.0) ONLY ROOT CAN SEND PRINT JOBS 2.1) WHERE IS THE PRINTER CONFIGURATION STORED 2.2) HOW DO I CHANGE THE BAUD RATE FOR MY PRINTER 2.3) LOCAL PRINTING WORKS BUT I CAN'T PRINT FROM A REMOTE TO THIS SYSTEM 2.4) HOW DO I SETUP NETWORK PRINTERS ON SOLARIS 2.5) WHAT ARE THE PKG's 2.6) CAN S5 OPTIONS BE USED 1.1) HOW TO CONVERT PRINTER INFORMATION FROM 2.X & 4.X TO SOLARIS 2.6 4.x to 2.6: Copy the /etc/printcap from the 4.x system to the 2.6 system, and run the following: # /usr/lib/print/conv_lpd -c printers /etc/printcap > /etc/printers.conf NOTE: See man page on conv_lpd for more info 2.x to 2.x with SSPC: Convert the printer configuration information in the system's /etc/lp/printers directory to the /etc/printers.conf NOTE: See man page on conv_lp for more info 1.2) PRINTER ALIASES: # lpadmin -p oldname -c alias_name # accept alias_name destination "alias_name" now accepting requests 1.3) PRINTER CAN"T BE REMOVED, CAN'T DELETE THE QUEUE FILES (i.e CLEARING THE PRINT QUEUES): # /usr/sbin/lpshut # cd /var/spool/lp # pwd (verify the directory) # rm -r requests tmp temp fifos # cd /var/spool/print # rm * (remove all files except .seq file) # /usr/lib/lpsched (restart the schedular) # lpadmin -x printername (printer configuration is removed) NOTE: SEE number 2 above REMOVE A PRINTER for more information. 1.4) DISABLE THE BANNER: To disable the banner pages permanently: cd /etc/lp/interfaces/your_printername vi your_printername Change line 332 from: nobanner="no" to: nobanner="yes" OR nobanner="" 1.5) CAN'T OPEN THE PRINTER PORT If your getting this message you need to check the eeprom setting for the port your printer is attached to and the serial port manager settings. This command will disable logins on the port: lpadmin -p printername -h The default for a Solaris system after it is installed allows the serial ports to be used for printers. If Serial Port Manager has been run the default settings may have changed and the eeprom setting may have changed Defaults: pmadm -l zsmon ttymon ttya u root /dev/term/b I - /usr/bin/login - 9600 ldterm,ttcompat ttyb login: - tvi925 y # eeprom | grep ttya ttya-rts-dtr-off=false (Default) ttya-ignore-cd=true (Default) ttya-mode=9600,8,n,1,- (don't change this it has no effect once the system boots) PROBLEM: ttya-ignore-cd=false The "false" is the setting that stops the serial port from being opened. The other eeprom settings for serial ports have no effect once the system is booted. FIX: eeprom ttya-ignore-cd=true Reset it to true and reboot. pmadm -l check the Serial Port Manager settings zsmon ttymon a ux root /dev/term/a b - /usr/bin/login - 9600 ldterm,ttcompat login: - - n #Modem - Bidirectional ^ This Flag stops the port from opening PROBLEM: The "n" here sets up the port for modem use and only allows the port to open when a modem signal is on pin 8 (Carrier Detect) It must be "y" for printers and the /dev/term/a must have a "I" after it for initialize only. FIX: If you check the software carrier box in serial port manager the y will be set and if you select terminal hardwired and initialize only the port will be back to defaults except for the eeprom setting mentioned above. OR: Work around: delete the service and set eeprom ttya-ignore-cd=true then reboot or if you can't reboot use /dev/cua/a for the printer device as this device does not get locked by the Carrier Detect settings To change printer Device: lpadmin -p printername -v /dev/cua/a 1.6) MY POSTSCRIPT PRINTER BLINKS FOR SEVERAL MINUTES BUT NEVER PRINTS: For all postscript printers attached to a serial or parallel port on a Sun workstation running Solaris 2.x you must set the printer to ether Postscript or PCL (ascii). Do not set the printer to Auto. it will not detect the file type being sent and will not print. Set the file type for the printer on the Sun to ether postscript or simple (ascii) to match the printer setting. You will still be able to print ascii to you postscript printer and the fonts will look better on ascii jobs. i.e lpadmin -p printername -T PS -I postscript or lpadmin -p printername -T hplaser -I simple (LaserJet type) 1.7) WHAT IS THE NAME FOR THE PARALLEL PORT: /dev/bpp0 for Sbus and /dev/ecpp0 for Pci It is a 26 pin mini-din plug on the Sun identified by these marks // It is the upper of the two similar looking plugs. The parallel cable part number is 530-1857-03 for the mini-26 to Centronics The other cable that might be used on the parallel port is a 26 pin Female mini-din to a Female DB-25 P/N 530-1861 The parallel port on the Serial Parallel Controler is: /dev/printers/0 This port requires patch 101398-06 for Solaris 2.3 and patch 102121-02 for Solaris 2.4. Solaris 2.5 does not require a patch. 1.8) HP 4 LASERJET PRINTER SETTINGS FOR SERIAL PORTS: Verify the printer settings: SERIAL MENU SERIAL=RS232 * PACING=XON/XOFF * BAUD RATE=9600 * ROBUST XON=OFF * DTR POLARITY=HI * Verify the cable: cat /etc/hosts > /dev/term/a This is an ascii file you can cat a postscript file for postscript printers. Take the printer offline and press the form feed. The Form Feed light should blink and the job should print. If it doesn't you have the wrong cable or printer settings. The cable needs pins 2,3 & 7. Pins 2 and 3 must be crossed from one cable end to the other and pin 7 is straight through. This is also called a NULL modem cable. 1.9) WHAT DO I SET MY PRINTER TYPE TO: There are 3 types of printers that are commonly used on Solaris 2.x workstations: Postscript, HP Laserjet compatible and Ascii line printers. For remote printing always set your printer type to unknown and file content type to any. For local printers of postscript type set the printer itself to PS or postscript only. On the Sun set the file content type to "postscript" and the printer type to "PS". Postscript example: lpadmin -p printerName -T PS -I postscript For HP Laser compatible PCL ascii type printers set the printer type to hplaser and the file content type to simple. If you are printing HP PCL files the printer type must be unknown and file content type simple. Then you must runing the following command for PCL file to prevent carriage returns at the end of each line in the PCL file: lpadmin -p printerName -o "stty=-opost" HP PCL example: lpadmin -p printerName -T hplaser -I simple For ascii line printers set the printer type to ibmproprinter or epson2500 and the file type to simple. Line Printers: lpadmin -p printerName -T ibmproprinter -I simple 2.0) ONLY ROOT CAN SEND PRINT JOBS: This problem is caused by network spooling software that for a network printer that uses /dev/null for the printer device. The software monitors the queue and spools the print requests over the network to the printer. If the printer setup is modified in any way with admintool the printer device (/dev/null) permissions will change to 600 owner lp. Then only root can print and openwindows fails to start. ls -l /dev/null lrwxrwxrwx 1 root root 27 Jul 26 20:32 /dev/null -> ../devices/pseudo/mm@0:null ls -l /devices/pseudo/mm@0:null crw------- 1 lp sys 13, 2 Jan 16 18:28 mm@0:null FIX: chmod 666 /dev/null chown root /dev/null chgrp sys /dev/null You can changed permissions on the link and it will take effect on the actual file /devices/pseudo/mm@0:null ls -l /devices/pseudo/mm@0:null crw-rw-rw- 1 root sys 13, 2 Feb 12 16:03 /devices/pseudo/mm@0:null 2.1) WHERE IS THE PRINTER CONFIGURATION STORED The information that used to be in the printcap file is now stored in: /etc/lp/printers/printerName/configuration However the main print configuration is in the file /etc/printers.conf Do not edit either files by hand as the information is stored in memory when the lpsched daemon starts up. The file is created by the lpadmin command and can be modified by the same command. The information in the file is useful for debugging print problems. If the file is modified by hand stop and restart lpsched. Here is a remote example: Content types: any Printer type: unknown Remote: austin This is a local example: Banner on Content types: postscript Device: /dev/bpp0 Interface: /usr/lib/model/standard Printer type: PS Modules: default This is a 2.6 and above network attached printer: Banner: on Content types: postscript Device: /dev/null Interface: /usr/lib/lp/model/netstandard Printer type: PS Modules: Options: protocol=bsd,dest=hp_printer 2.2) HOW DO I CHANGE THE BAUD RATE FOR MY PRINTER # lpadmin -p <printername> -o "stty=19200" or for a HP PCL type plotter: # lpadmin -p <plottername> -o "stty='19200 -opost'" 2.3) LOCAL PRINTING WORKS BUT I CAN'T PRINT FROM A REMOTE TO THIS SYSTEM Verify the tcp listeners are running: # pmadm -l -p tcp PMTAG PMTYPE SVCTAG FLGS ID <PMSPECIFIC> tcp listen 0 - root \x00020ACE000000000000000000000000 - c - /usr/lib/saf/nlps_server # tcp listen lp - root - - p - /var/spool/lp/fifos/listenS5 # tcp listen lpd - root \x00020203000000000000000000000000 - p - /var/spool/lp/fifos/listenBSD # If these services are not running set up a LOCAL printer on the printserver with Admintool. Command line to setup the listeners: # sacadm -a -p tcp -t listen -c "/usr/lib/saf/listen tcp" -v `nlsadmin -V` -n 9999 # 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_serve r -A '\x00020ACE000000000000000000000000'` -v `nlsadmin -V` Also make sure that there is a process (lpNet or in.lpd) running which listens on tcp port 515: # netstat -a | grep printer *.printer *.* 0 0 0 0 LISTEN 2.4) HOW DO I SETUP NETWORK PRINTERS ON SOLARIS It is best to use the the printer manufacturers spooling software to setup, and maintain printers that have their own IP address. Often the software is available for free from the manufacturer of the network card for the printer. If the software is available in both system V and BSD get the BSD version. The software has scripts to set up and manage the printer queues. There are a few printers that can speak BSD protocol without software but these printers will usually report faulted when lpstat is run. Without spooling software the printjobs will often restart after ten to twenty pages. ******** For Solaris 2.6 only ********** ADDING A NETWORK PRINTER (2.6 only) It is still suggested to use your printer manufacture's network printing software, however is this is not possible try the following: # lpadmin -p <queuename> -o protocol=bsd,dest=<print_dest> -T PS -I postscript -v /dev/null -i /usr/lib/lp/model/netstandard NOTE: The above command is one continues line. chmod 666 /dev/null chown root /dev/null chgrp sys /dev/null accept <queuename> enable <queuename> NOTE: The <print_dest> should be the host name in the /etc/hosts file, or the IP address. 2.5) WHAT ARE THE PKG'S SUNWpcr = SunSoft Print - Client - root(/) SUNWpcu = SunSoft Print - Client - usr SUNWpsr = SunSoft Print - LP Server - root(/) SUNWpsu = SunSoft Print - LP Server - usr SUNWpsf = Postscript Filters - usr SUNWscplp = SunSoft Print - Source Compatibility - usr SUNWfns Federated Naming System SUNWfnsx5 FNS Support For X.500 Directory Context 2.6) CAN S5 OPTIONS BE USED? NO support for print services defined as s5 (the System V print protocol) in the previous Solaris 2.x releases. PRODUCT AREA: Printers PRODUCT: Printing SUNOS RELEASE: Solaris 2.6 HARDWARE: any