INFODOC ID: 2097 SYNOPSIS: Solaris 2 printer configuration commands - quick reference DETAIL DESCRIPTION: Setting up local printers under Solaris 2.x. Some of these steps are only for information: they're commented out. Most of this has to be done as root. Format is English description, then 2.x command on the right. Check general printer status lpstat -s If not running, start /etc/init.d/lp start # To stop all print services /etc/init.d/lp stop Show all printers configured lpstat -p all Show a particular printer lpstat -p myprinter Show a particular printer in detail lpstat -p myprinter -l Check port monitor services pmadm -l Turn off the portmonitor on ttyb pmadm -d -p zsmon -s ttyb pmadm FLGS changes to 'ux' # To turn ON the portmonitor on ttyb pmadm -e -p zsmon -s ttyb # pmadm FLGS changes to 'u' Add a new printer on ttyb cd /dev/term chgrp lp b; chown lp b; chmod 660 b lpadmin -p myprinter -v /dev/term/b Send the output to a file touch /tmp/printout instead chmod 666 /tmp/printout # temporary lpadmin -p myprinter -v /tmp/printout # Remove a printer lpadmin -x myprinter To enable enable myprinter To accept jobs accept myprinter To check status (again !) lpstat -p myprinter To print something lp -d myprinter /etc/passwd Allow normal users to print without lpadmin -p myprinter -o nobanner banners (otherwise, only root can print without banners) Fix up the serial line settings lpadmin -p myprinter (still no banner) -o "nobanner stty='cs8 19200'" Add a description lpadmin -p myprinter -D 'My new printer' Make it the system default destination lpadmin -d myprinter At this point it should be possible to print a job and have it appear either in /tmp/printout (if that's the output device) or on the printer. Adding filters The scheduler attempts to match the type of job beingprinted to the type of the printer. If it does not find one, it prints an error message: # lp -d myprinter -T ps /etc/passwd UX:lp: ERROR: There is no filter to convert the file content. TO FIX: Use the lpstat -p -l command to find a printer that can handle the file type directly, or consult with your system administrator. # To force a filter to be applied to a job, define: The type of the input job The type of data which the printer can accept To print HPGL toan OSE6450 printer, the HPGL must be followed by the string '\033%-12345x' (The first character is ESCAPE.) This can be accomplished as follows: Define the printer as taking ose lpadmin -p myprinter -I ose data. The printer will only print data type ose: the scheduler must find a filter to print other types of data to this printer. Make a directory for local filters mkdir /usr/lib/lp/local Add a suitable filter cd /usr/lib/lp/local cat >hpgl2ose #!/bin/sh #echo anything to send before the job cat - echo '\033%-12345' exit 0 ^D Make it executable, etc. cd /usr/lib/lp/local Make it executable, etc. chmod 755 hpgl2ose chown lp hpgl2ose; chgrp lp hpgl2ose Add a suitable filter definition cd /etc/lp/fd cat >hpgl2ose.fd # comments here Input types: hpgl Output types: ose Printer types: any Printers: any Filter type: fast Command: /usr/lib/lp/local/hpgl2ose Options: PRINTER * = -p* ^D chown lp hpgl2ose.fd chgrp lp hpgl2ose.fd chmod 664 hpgl2ose.fd Add it to the list of filters the lpfilter -f hpgl2ose system knows about -F /etc/lp/fd/hpgl2ose.fd Check the filters that the system lpfilter -f all -l recognizes Check just one filter lpfilter -f hpgl2ose -l # Remove a filter lpfilter -f hpgl2ose -x Check the output from the spooler lpadmin -p myprinter -v /tmp/printout (printer is default dest) cp /dev/null /tmp/printout lp -T hpgl -o nobanner /etc/passwd cat -v /tmp/printout Check that this file will print sleep 30000 tcp listen lpd - root \x00020203819c 88fb0000000000000000 - p - /var/spool/lp/fifos/listenBSD # # To remove the listener at any time, use # pmadm -r -p tcp -s lpd To add System V clients, add the STREAM service used for print requests. The '4' is from 'nlsadmin -V' above. # pmadm -a -p tcp -s lp -i root -v 4 -m `nlsadmin -o /var/spool/lp/fifos/listenS5` # Check that this has taken effect # pmadm -l -p tcp -s lp PMTAG PMTYPE SVCTAG FLGS ID tcp listen lp - root - - p - /var/sp ool/lp/fifos/listenS5 # # Figure out the address to use for service 0, the nlps server. # lpsystem -A 00020203819c88fb0000000000000000 # which divides into: 0000000000000000 16 zeros for padding 819c88fb Server's IP address in hex 0203 BSD printer port == 515 0ACE SysV printer port == 2766 0002 INET protocol family The BSD listener uses the 515 port as reported by 'lpsystem -A' - the System V spooler uses 2766, so theaddress must be changed to 00020ACE819c88fb0000000000000000 The "\x" is added to force it to be interpreted in hex. Add service 0, the nlps server # pmadm -a -p tcp -s 0 -i root -v 4 -m "`nlsadmin -c /usr/lib/saf/nlps_server -A '\x00020ACE819c88fb0000000000000000'`" # Check that this has taken effect # pmadm -l -p tcp -s 0 PMTAG PMTYPE SVCTAG FLGS ID tcp listen 0 - root \x00020ACE819c 88fb0000000000000000 - c - /usr/lib/saf/nlps_server # # To remove the System V listener at any time, use # pmadm -r -p tcp -s lp # pmadm -r -p tcp -s 0 Configuring a print client of a BSD print server Register the print server name with the print service # lpsystem -t bsd bsdserver "bsdserver" has been added # To remove the print server, use # lpsystem -r bsdserver Removed "bsdserver". # To check what's been added # grep bsdserver /etc/lp/Systems bsdserver:x:-:bsd:-:n:10:-:-: # Add the printer to the client system. This information is entered into the directory /etc/lp/printers by the lpadmin command. # lpadmin -p local_prt_name -s bsdserver!rmt_prt_name To remove the printer, use # lpadmin -x local_prt_name Set the printer's content and type # lpadmin -p local_prt_name -T unknown -I any Allow queuing # accept local_prt_name Enable the printer # enable local_prt_name Check the configuration # lpstat -p local_prt_name -l printer local_prt_name is idle. enabled since Sun May 9 17:50:15 BST 1993. available. Content types: any Printer types: unknown Description: Users allowed: (all) Forms allowed: (none) Banner not required Character sets: (none) Default pitch: Default page size: Configuring a print client of a System V print server Register the print server name with the print service # lpsystem -t s5 sys5server "sys5server" has been added # To remove the print server, use # lpsystem -r sys5server Removed "sys5server". # To check what's been added # grep sys5server /etc/lp/Systems sys5server:x:-:s5:-:n:10:-:-: # Add the printer to the client system. This information is entered into the directory /etc/lp/printers by the lpadmin command. # lpadmin -p local_prt_name -s sys5server!rmt_prt_name To remove the printer, use # lpadmin -x local_prt_name Set the printer's content and type # lpadmin -p local_prt_name -T PS -I PS Register bundled PostScript filters using the lpfilter command. From sh: # cd /etc/lp/fd # for filt in `ls | sed 's/\.fd//'` > do > lpfilter -f $filt -F $filt.fd > done # Check the filters have been added # lpfilter -f all -l Allow queuing # accept local_prt_name Enable the printer # enable local_prt_name Check the configuration # lpstat -p local_prt_name -l printer local_prt_name is idle. enabled since Sun May 9 17:50:15 BST 1993. available. Content types: any Printer types: unknown Description: Users allowed: (all) Forms allowed: (none) Bannernot required Character sets: (none) Default pitch: Default page size: *********************************** Setup HP Jetadmin software http://h20338.www2.hp.com/hpsub/cache/332262-0-0-225-121.html?jumpid=ex_r2845_go/webjetadmin/gc121306 goto www.hp.com/Support/Drivers/Network Products jetadmin cli # pkgadd -d SOLd412.PKG (or some version) # /opt/hpnp/jetadmin get webadmin s/w # pkgadd -d webjetadmin (or some version) # hppi (replaces jetadmin) # /opt/hpnpl/bin/hpnpadmin -v printername (shows stats) # admintool printer_device: /dev/jetdirect If you have a set of printers and/or users that loose jobs, that is, lp gives back a squence, but they never queue lpshut cd /var/spool/lp rm -r fifos requests tmp temp SCHEDLOCK /usr/lib/lpsched If you want to delete everything under jetadmin control WITH jobs stuck in the queue lpshut cd /var/spool/lp rm -r fifos requests tmp temp SCHEDLOCK rm -r /var/spool/print rm /etc/printers.conf cd /etc/lp/interfaces; rm ALL BUT model.orig rm /etc/lp/interfaces rm -r /etc/lp/printers /usr/lib/lpsched