How do I configure a basic printer?
The information below is by no means authoritative, but gives a pretty decent example of how to configure a printer in Solaris 2.x. There is a lot of good information in the man pages for lpadmin, lpshut, lpsched, lprm, lpmove, lpstat, enable, accept, lp, lpr, lpq, lpsystem, and others.
From Admintool
To configure an HP LaserJet for postscript and ASCII, load the admintool, go to the "Browse" menu and click on "Printers". Next, click on "Edit", then "Add", then "Local Printer". Enter the information as needed. The only thing that might not be obvious is that you have to select "Other..." in the "Printer Port" menu. This will bring up a requester, where you can type in the full path to the device file, such as /dev/dty/a001s. For the rest of the options, set them up as shown below (again, assuming a device name of a001s):
printer name: lj4
printer server: your_host_name
comment: HP LaserJet 4
printer port: /dev/dty/a001s
printer type: hplaser
file contents: both postscript and ascii
fault notice: write to superuser
print server: System V
system default: yes
printer banner: not required
enable queue: yes
accept jobs: yes
If you have a serial printer, the operating system figures this out automatically, but from within the "model" or "interface" script. By default, 9600,8,N,1 is selected, but you can change it to whatever you want. The default model script (unless you select another) is /usr/lib/lp/model/standard. When you create a printer, that gets copied to /etc/lp/interfaces/. In other words, for the example above, it would be /etc/lp/interfaces/lj4. Simply edit the script, do a search for 9600, and you will be in the place where these settings exist. Make any changes you like.
From the Command Line:
To create a print spool by the name "lj4" for ASCII and Postscript printing based on the parallel port addressed by /dev/dty/a001s:
Shut down print services first:
# lpshut
Add the new printer:
# lpadmin -p lj4 -T hplaser -I postscript,simple -v /dev/dty/a001s
For serial ports, simply specify the appropriate baud rate and line settings for your printer using the stty parameter, and use the correct device name. For example:
# lpadmin -p lj4 -o stty=''''19200'''' -T hplaser -I any -v /dev/dty/a001s
The 8 bit character setting is the default, with no parity and one stop bit. If your printer needs different settings, just place them in the single quotes with the baud rate (separated by spaces), such as ''''19200 cs7''''.
Assigning a Default Printer (lp):
# lpadmin -d lj4
Restart the scheduler:
# /usr/lib/lp/lpsched
Next, enable the queue and printing, and check the status:
Let the queue accept jobs:
# accept lj4
# enable lj4
Check the status:
# lpstat -t
lpstat should yield something like:
scheduler is running
system default destination: lj4
device for lj4: /dev/sts/lpc58
lj4 accepting requests since Wed Apr 5 14:13:24 CDT 1995
printer lj4 is idle. enabled since Wed Apr 5 14:13:24 CDT 1995. available.
You can also get a more detailed output from lpstat for a specific printer by using the command:
# lpstat -l -p lj4
This would yield something like:
printer lj4 is idle. enabled since Wed Apr 5 14:13:24 CDT 1995. available.
Form mounted:
Content types: postscript, simple
Printer types: hplaser
Description: HP LaserJet 4
Connection: direct
Interface: /usr/lib/lp/model/standard
On fault: write to root once
After fault: continue
Users allowed:
(all)
Forms allowed:
(none)
Banner not required
Character sets:
(none)
Default pitch: 10 CPI 6 LPI
Default page size: 80 wide 60 long
Default port settings:
To disable and remove the printer setup above, run these commands:
Don''''t allow any new queue entries:
# reject lj4
Disable the queue:
# disable lj4
Completely remove the printer definition:
# lpadmin -x lj4 Shut down printer services
# /usr/lib/lpshut
Restart printer services:
# /usr/lib/lpsched