|
|
To configure a spooled local terminal printer using an intelligent serial card with built-in support for local printing, configure the printer using one of the special device nodes provided with your card.
If you are using a dumb serial port or if the device driver for your intelligent serial port does not provide special handling for local terminal printers, then you must use a special null device name. When you stop I/O on this device, no other processes are affected.
To set up the spooled local terminal printer:
Use same major number as /dev/null for lpnull (4 in this case) and use 128 for the minor number. For more information, see the mknod(C) manual page.
interface_script is the name of the printer interface
script to use; new_script is the copy.
# setup string termport="/dev/tty2h" # change tty2h to port for your terminal penable="\017\033d#pdisable=" "\024 161pnull="/dev/lpnull" codes to enable printer for Wyse 60 pdisable= "\024\016\c" # codes to disable printer for Wyse 60 lpnull="/dev/lpnull" # dummy regular file or dedicated device file sttystr="ixon -ixany ixoff opost onlcr" # modify for your printer if necessary# redirect std in, std out to termport std err to lpnull #sleep 3 # uncomment this is if terminal data appears on your printout exec <$termport >$termport 2>$lpnull
# If it is necessary to change the baud rate or other stty settings for your serial printer modify the sttystr above. sttysave=`stty -g` stty $sttystr
# escape sequence for the terminal to lock the keyboard and turn on transparent print mode. # You must first lock the keyboard then turn on transparent print echo "$penable"
# escape sequence for the terminal to turn off transparent print mode and unlock the terminal. First turn off transparent print then unlock keyboard. # sleep 2 # uncomment this if print data appears on your terminal echo "$pdisable"# reset stty settings stty $sttysave
After setting up multiple spooled printers, enter these commands:
cd /dev
rm lpnull
touch lpnull
chown lp lpnull
chgrp lp lpnull
chmod 660 lpnull
These commands replace the character device special file /dev/lpnull with an empty regular file of the same name. This regular file can be shared by the spooled local terminal printers without causing the problems that would occur if they shared a device special file.
The message of the day should print on the local terminal printer.
Only two user IDs can use the local terminal printer:
the user ID logged into the termport
device and root.
To allow others to access the printer temporarily:
disable ttyxx
chgrp lp /dev/ttyxx
chmod 660 /dev/ttyxx
Replace xx with the termport device name.
To return the port to normal use, enter:
enable ttyxx
Replace xx with the termport device name.