Solaris 2.x printing MFAQ NOTE: This article contains very long lines. Contents: 1) COMMAND LINE REMOTE PRINTER SETUP 2) PRINTER ALIASES 3) PRINTER CAN"T BE REMOVED, CAN'T REMOVE THE QUEUED FILES 4) DISABLE THE BANNER PAGE 5) CAN'T OPEN THE PRINTER PORT 6) MY POSTSCRIPT PRINTER BLINKS FOR SEVERAL MINUTES BUT NEVER PRINTS 7) WHAT IS THE NAME FOR THE PARALLEL PORT, WHAT CABLE DO I USE? 8) HP 4 LASERJET PRINTER SETTINGS FOR SERIAL PORTS 9) WHAT DO I SET MY PRINTER TYPE TO? 10) ONLY ROOT CAN SEND PRINT JOBS 11) WHERE IS THE PRINTER CONFIGURATION STORED? 12) WHAT IS THE DIFFERENCE BETWEEN BSD AND S5 PROTOCOLS, WHY USE BSD? 13) HOW DO I CHANGE THE BAUD RATE FOR MY PRINTER? 14) LOCAL PRINTING WORKS BUT I CAN'T PRINT FROM A REMOTE TO THIS SYSTEM 15) HOW DO I SET UP NETWORK PRINTERS ON SOLARIS? 16) COMMAND LINE LOCAL PRINTER SETUP 17) PRINTING IN LANDSCAPE 1) COMMAND LINE REMOTE PRINTER SETUP: # lpsystem -t bsd servername (Always Use bsd!) This # lpadmin -p printername -s servername or # lpadmin -p localname -s server\!remotename (different local and remote names) # lpadmin -p printername -T unknown -I any # accept printername # enable printername 2) PRINTER ALIASES: # lpadmin -p oldname -c alias_name # accept alias_name destination "alias_name" now accepting requests 3) PRINTER CAN"T BE REMOVED, CAN'T DELETE THE QUEUE FILES: # /usr/sbin/lpshut # cd /var/spool/lp # pwd (verify the directory) # rm -r requests tmp temp # /usr/lib/lpsched (restart the scheduler) # lpadmin -x printername (printer configuration is removed) 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="" 5) CAN'T OPEN THE PRINTER PORT If you are getting this message, you need to check the eeprom setting for the port that 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 and the eeprom setting might 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 allows the port to open only 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: Workaround: 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 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) 7) WHAT IS THE NAME FOR THE PARALLEL PORT, WHAT CABLE DO I USE? /dev/bpp0 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 Controller 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. 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. 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 running 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 10) 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 change 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 11) 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 Do not edit the file by hand, because 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 12) WHAT IS THE DIFFERENCE BETWEEN BSD AND S5 PROTOCOLS? Solaris 2.x systems can receive and send both S5 and BSD print jobs. BSD uses port 515 and S5 uses port 2766. Because S5 will be EOL soon (end of life), use the BSD protocol and add the following options to the /etc/lp/Systems file. Change the server entry in /etc/lp/Systems on the client from: server:x:-:bsd:-:n:10:-:-: to: server:x:-:bsd:-:n:10:SVR4-Extensions:-: and restart lpsched. By default the BSD print protocol has no provisions to pass S5 options across the wire, that is, -o or -T, unless there is specific knowledge of that option. There is an undocumented enhancement to the BSD protocol that allows the passing of arbitrary S5 options. 13) HOW DO I CHANGE THE BAUD RATE FOR MY PRINTER? # lpadmin -p yourprinter -o "stty=19200" or for a HP PCL type plotter: # lpadmin -p plottername -o "stty='19200 -opost'" 14) 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 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 print server with admintool and delete the local printer The TCP listeners will now be enabled and will restart if you reboot. 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_server -A '\x00020ACE000000000000000000000000'` -v `nlsadmin -V` 15) HOW DO I SET UP NETWORK PRINTERS ON SOLARIS? Use the printer manufacturer's spooling software to install, set up, 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 print jobs will often restart after ten to twenty pages. 16) COMMAND LINE LOCAL PRINTER SETUP lpadmin -p printername -v /dev/cua/b chmod 600 /dev/cua/b chown lp /dev/cua/b chgrp lp /dev/cua/b lpadmin -p printername -T PS -I postscript -h cd /etc/lp/fd Install he filters: lpfilter -f download -F download.fd lpfilter -f dpost -F dpost 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 postplot.fd accept printername enable printername Set up network listeners to print from remote systems: # 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_server -A '\x00020ACE000000000000000000000000'` -v `nlsadmin -V` PRINTING IN LANDSCAPE To print in landscape, you need a postscript printer and you must be printing an ASCII file. Files that are already postscript have their orientation fixed in the postscript code. Example: /usr/openwin/bin/mp -l ascii_file (prints 2 pages on 1) Example: usr/lib/lp/postscript/postprint -pl -l 46 file_ascii | lp (prints 46 lines on a page) Example: lp -y landscape ascii_file (only works when the printer type is set to postscript on Solaris) Example: alias land '/usr/lib/lp/postscript/postprint -pl -l 46 !^ | lp' ( C-Shell alias to print landscape) ***********************************************************************