From: faq-rt@antimatr.hou.tx.us (Mark Whetzel) Newsgroups: comp.sys.ibm.pc.rt,comp.unix.aix,comp.answers,news.answers Subject: COMP.SYS.IBM.PC.RT: AIX V2 FAQ - Software questions, Part 3 of 3 on software issues when using AIX V2.2.x on IBM RT (615x) computers. Plus general information, hints and tips. Keywords: IBM RT PC software FAQ 6150 6151 6152 AIX VRM AOS MACH PICK Message-ID: Date: 5 Jul 94 03:57:28 GMT Expires: 17 Aug 94 03:56:49 GMT References: Sender: markw@antimatr.hou.tx.us Reply-To: aix-rt@antimatr.hou.tx.us Followup-To: comp.sys.ibm.pc.rt Lines: 741 Approved: news-answers-request@MIT.Edu Supersedes: Xref: news.lth.se comp.sys.ibm.pc.rt:2923 comp.unix.aix:41903 comp.answers:6163 news.answers:24716 Archive-name: ibm-rt-faq/aix-v2/software/part3 Last-modified: Mon Jul 4 19:44:31 CDT 1994 Version: 1.4 Frequently Asked Questions for: AIX V2.2.1 on IBM RT systems. System Software topics for AIX/RT. Part 3 of 3 parts. The AIX V2 FAQ currently consists of EIGHT parts in 5 topic areas: AIX V2 FAQ Index and acknowledgements AIX V2 OS specific hardware issues - in one part (currently). AIX V2 Software questions - in three parts. (This FAQ) AIX V2 Problem Questions and answers - two parts. AIX V2 Porting software notes - in one part (currently). See the AIX V2 FAQ index posting for a complete index of the AIX FAQ postings. ================================================================================ ------------------------------ 2.0 Software questions (continued). S.28 - How to set up print queues on AIX V2 and general printing setup and control notes. How to increase the number of printers over eight. * The devices command will add the physical printer device to the system, and under normal conditions, it will configure the queueing system to use the newly added printer. The following printers represent those currently supported by AIX 2.2.1: 5152 - IBM PC Graphics Printer 5182 - IBM PC Colour Printer 3852 - IBM PC Colour Jetprinter 5201 - IBM PC Quietwriter Printer Model 1 - IBM PC Quietwriter Printer Model 2 5202 - IBM PC Quietwriter Printer III 4201 - IBM Proprinter II & III (Serial or Parallel) 4202 - IBM Proprinter II & III XL (Serial or Parallel) 4224 - IBM 4224 Printer (Serial) 4216 - IBM Personal Pageprinter Model 20 (Postscript) opp - Other Parallel Printer - for non-IBM Printers osp - Other Serial Printer - for non-IBM Printers 3812 - IBM Pageprinter The following printers can also be configured for use on the 6150: 5204 - IBM Quickwriter (4201 serial and 5202 parallel) 4216 - IBM Personal Pageprinter Model 010 (4201 serial and parallel) The opp and osp devices can run quite a few non-IBM printers very easily with the proper setup of both the printer and AIX V2. * NOTE: If devices is used to CHANGE a printer configuration information then it is necessary to recreate the device driver by issuing the following commands: vrmconfig -d lpX vrmconfig -a lpX Where lpX is the name of the relevant device. * The printing and queue control commands used are rather unique to AIX/RT. The following commands show BSD commands and their AIX/RT equivlent. BSD AIX/RT lpq print -q Displays the status of the printers and printer queues. lprm xx print -ca xx Cancels a print request for the file 'xx'. lpr -Plp1 xx print lp1 xx Specifies that file 'xx' should be printed on the printer lp1 rather than the default printer. * In BSD the 'lpc' command is an interactive command used to alter the printing system. In AIX/RT this is replaced by several different command flags. Only the root account or members of the system group can use these flags. print -dd lp1 Takes the print queue lp1 down. All devices on this queue are shown as OFF by print -q. print -du lp1 As above but turns the queue back on. print -dg filename Kills the qdaemon after the file is printed. This is the only clean way of killing the qdaemon. * The following are some handy print command examples: print -nc=3 filename Prints 3 copies of a file print -no filename Notifies you that the file has finished printing. print -tl=TITLE filename Prints TITLE on the first page of the document. Also shown from the print -q command. print -cp filename Copies the file to the /usr/spool/qdamon space, instead of using the actual file for printing. You can edit it while waiting for the current copy to print. print -su=user1 -ca job1 This command allows a user to remove another users print job from the queue. Only system group members can use this flag. print -pr=nn filename Causes the print job to take the priority specified by the 'nn' parameter when queued. System group users can use priorities 1-30 and other users can use 1-20. print -ap=nn filename Alters the priority of a queued print job to 'nn'. This allows jobs to be moved up and down the queue as seen by the 'print -q' command. * Another very useful feature of the "print" command is that it can be used to provide parameters to the stanard backend 'piobe'. For example, when adding a Quietwriter III in devices there are many parameters that can be changed. Among the various parameters are "lm", "pq" and "psd" for setting Left Margin, Print Quality and Paper Source Drawer. Rather than setting these in devices and changing them each time they need altering, it is possible to enter print commands in the following way: $ print -lm=3 -pw=letter -psd=2 filename This has the effect of dynamically changing the margin, print quality and paper source drawer for the period of this print job only. The printer reverts to the previous settings immediately after the job has completed. * There are two special flags for the printing system that can be very helpful: -plot This flag allows files to pass through the backend without change. Embedded control codes will not be altered by the backend. -strip Removes all control codes in the text before passing it through to the printer. It is possible to pass 'piobe' these parameters in two ways. For permanent changes, they can be put into the /etc/qconfig file in the device stanza as normal parameters to 'piobe'. Alternatively they can be passed with the print command. $ print -plot lp1 file.with.codes This will print the file 'file.with.codes' on the printer associated with the lp1 queue but with the -plot option. * The /etc/qconfig fle can be edited to alter print queue and device characteristics. Although the 'print' command will act on the changes without further action, it is necessary to reload the qdaemon with the modified /etc/qconfig information. This is achieved by issuing the 'print -rr' command which forces the qdaemon to reread the information. * Some stanzas in this file describe queues and other stanzas describe devices. Every queue stanza requires that one or more device stanzas immediately follow it in the file. The first queue stanza describes the default queue. The print command uses this queue if no queue parameter is provided. * The /etc/qconfig file with one printer defined will look something like this: lp0: argname = lp0 device = dlp0 dlp0: file = /dev/lp0 access = both backend = /usr/lpd/piobe -statusfile -pname=lp1 -device=d4201ss2 -profile=/etc/ddi/sprinter bsh: argname = bsh friend = FALSE discipline = fcfs device = bshdev bshdev: backend = /bin/sh The first stanza (labelled lp0:) describes the argument name for this print queue and the device name. The label lp0: is the name of the queue and the argname (also lp0 in this case) is the name used by the 'print' command to select this queue. The label and the argname need not be the same. Note: Queue names MUST be a maximum of three characters (lp0 in the example above). The 'device' entry stanza (dlp0 in the example) has a maximum length of six characters. * A single queue can be used to service more than one device for a particular queue. For example, if there are two identical printers attached to the system then it may be desirable to have them both on the same queue. This would enable users to send jobs to be printed and if one printer was busy then the job could be printed on the alternate printer. This can be achieved as follows: - Add both printers with devices. The assume the first one is lp0, and the second is lp1. - Edit /etc/qconfig and delete the lp1 'queue' stanza and edit the lp0 queue stanza to select both devices: Locate the line: device = dlp0 associated with the lp0 queue and change it so that both device stanzas are referenced by that queue entry. lp0: argname = lp0 device = dlp0,dlp1 dlp0: file = /dev/lp0 access = both backend = /usr/lpd/piobe -statusfile -pname=lp1 -device=d4201ss2 -profile=/etc/ddi/sprinter dlp1: file = /dev/lp1 backend = /usr/lpd/piobe -statusfile -pname=lp1 -device=d4201ss2 -profile=/etc/ddi/sprinter If it is necessary to access either of the devices individually, this can still be achieved using the following format: print filename lp0:0 (Selects dlp0) print filename lp0:1 (Selects dlp1) * In the default /etc/qconfig file there are two stanzas, bsh and bshdev. These form the queue characteristics for the background shell. The background shell isn't actually used for printing, but may be used for queuing jobs to be executed on the system. For example, to run a program called PROG, that can only be executed by one user at a time (eg for load implications), you would enter: print bsh PROG These stanzas can be removed if not needed, to prevent 'print -q' from displaying bsh information, or inadvertant use. * Working with more than 8 printers The AIX 2.2 device driver supports up to 16 printers. There are some manual steps that need to be taken to get other portions of the system to also work with more than 8 printers. For "devices" support: we need to change the /etc/master file. For every stanza related to a printer device (those which have the keyword "prefix = lp"), change the value of the "maxminor" keyword from 8 to 16. To cause this change to go into effect, a kernel rebuild is neessary. For "qdaemon" support: when these printers actually get added, a stanza for the printer is added to the /etc/qconfig file. The qdaemon only supports 3-character queue names. So when the 10th printer gets added, modify the created stanza names, with an editor. The "argname" and "device" keywords, and the "-pname" flag as follows: Typical example: --------------- lp10: argname = lp10 device = dlp10 dlp10: file = /dev/lp10 backend = /usr/lpd/piobe -pname=lp10 -device=d5152mp Is changed to become: -------------------- lpa: argname = lpa device = dlpa dlpa: file = /dev/lp10 backend = /usr/lpd/piobe -pname=lpa -device=d5152mp The reason for this alteration is that the printer device driver supports 16 printers, but the qdaemon, who reads the qconfig file, only supports queue names of 3 bytes or less. Because the lp10 - lp15 are 4 byte queue names they need to be amended to 3 bytes. Note "/dev/lp10" is the device special file name and does not need to be changed. * There are a number of fields that may be included in the print queue stanza (lp0: in the example below) and the device stanza (dlp0). lp0: argname = lp0 device = dlp0 acctfile = /usr/adm/qacct (or any other filename) discipline = fcfs (or sjn) friend = TRUE (or FALSE) up = TRUE (or FALSE) dlp0: file = /dev/lp0 backend = /usr/lpd/piobe -statusfile -pname=lp1 \ -device=d4201ss1 -profile=/etc/ddi/sprinter access = write (or both, or FALSE) align = TRUE (or FALSE) feed = 3 (or never) header = always (or never, or group) trailer = always (or never, or group) The fields shown above can be used to customise the output and queue characteristics of each printer. It is important to note that some are entered in the print queue stanza and some are entered in the device stanza. If any field is placed in the wrong stanza then an error message will occur in the form of: error in config file /etc/qconfig, line 6 illegal field name for queue stanza PRINT (FATAL ERROR): error from digester /usr/lpd/digest Please notify system administrator. This error will also occur if there is no blank line between stanzas. > Fields in the print queue stanza (lp0): argname Identifies the queue name identifier used by the 'print' command. This can be changed to a more meaningful name such as 'argname = draft' device Identifies the the symbolic name that refers to the following device stanza(s). acctfile Identifies the file used to save print accounting information. If the named file does not exist, no accounting is done. FALSE, the default, indicates suppressed accounting. The information provided is user number, user name and number of pages printed. discipline Defines the scheduling algorithm used by the queue. The default 'fcfs' means 'first come, first served'. The other option, 'sjn', specifies shortest job next. friend Indicates whether the backend updates the status file and responds to terminate signals. TRUE is the default, FALSE indicates that it does not. A friendly backend (like 'piobe') will provide status information as seen by 'print -q' whereas an unfriendly one (like 'cat') does not. up Defines the state of the queue. TRUE, the default indicates that it is running, FALSE indicates that it is not. This is used when a printer becomes unavailable for a period of time (eg maintenance) and it is not relevant to delete the device from the system. > Fields in the device stanza (dlp0:) access Defines the type of access the 'backend' has to the file specified in the 'file' field. The value of access is 'write' if the backend has write access to the file or 'both' if it has read/write access. If the value of access is FALSE this field is ignored. align Specifies whether the backend sends a form feed before starting the job if the printer was idle. (Default - FALSE) feed Specifies the number of separator pages to print if the device becomes idle. The default, 'never', indicates that no separator pages should be printed. header Specifies whether a header page prints before each job. The default, 'never', indicates no header pages at all, 'always' means print a header page before each job and 'group' means before each group of jobs for the same user. trailer Operats the same as 'header' but puts trailer pages after the users output rather than than preceding it. * Using Flow Control with serial printers. AIX/RT can communicate serially with printers at up to 19200 baud. If a large file is being printed then the printer buffer will often fill up because the printer cannot print as fast as the system is transmitting. To prevent the subsequent loss of characters some form of flow control must be implemented. There are two main types of flow control used with serial printers. One, "dtr" uses hardware and the other, "Xon/Xoff" uses software. + dtr Flow Control The dtr (Data Terminal Ready) flow control method uses one of the pins in the RS232C wire to indicate to the RT that the printer buffer is full and that no more data is to be sent. It uses the same pin to indicate that the buffer is no longer full and that more data can be sent to the printer. If you examing the printer cable diagram show in section H.14 of the harware FAQ, for a serial printer cable, you will see that Pin 20 on the printer end of the cable is the "dtr" pin per RS-232 standards. This pin is connected to Pin 8 on the RT end of the cable, this is the RT Clear To Send (CTS) signal. If your printer uses dtr then you must specify pro=dc in the devices program when you add the printer. Also, ixp (Include Xon/Xoff Protocol) MUST be set to false in devices since this ignores the 'pro' setting if ixp is set to TRUE. This tells the RT to look at the CTS pin which is connected to 'dtr' on the printer for dtr flow control (NOT the "dtr" pin of the RT side). A common mistake is to set "pro=dtr" in devices when the printer is using dtr. This, however tells the RT to look at the dtr pin (Pin 2) which is connected to CD and DSR using the standard printer cable. Since CD and DSR will always be high, the RT never has reason to believe that the buffer is full and lost data and error messages occur. + XON/XOFF Flow Control Xon/Xoff is more straight forward than dtr. It uses the Receive and Transmit lines and a couple of special characters to indicate the status of the buffers. When data is being sent down the transmit line from the RT and the buffer fills, the printer sends a special code down its transmit line, which the RT receives and interprets as Xoff. The RT then waits until the printer sends an Xon character before it sends more data to the printer. The normal values for Xon and Xoff are 11 and 13 (HEX) respectively. To set up a printer to use Xon/Xoff it is necessary to set "ixp" to true in devices. As mentioned this ignores the "pro" parameter. * In AIX the "splp" command is used for changing the device driver characteristics of both parallel and serial printers. Basically, each printer is set up using the "devices" command which edits all the relevant "/etc/ddi/xxxx" files and configures the device driver. If the print command is used to output files then splp will not be necessary. However, for redirection of files to the device, it may be necessary to alter the device driver settings (eg +plot to pass a file through without altering it in any way). The "splp" command can be used by superuser or any user in the system group to alter the characteristics of a printer device driver interactively. It can also be used to display the current characteristics of a serial or parallel printer device driver. Note: When the "print" command is used with the piobe backend, splp is set to +plot during the printing. Therefore any splp parameters set by the user are ignored. If a file is redirected (e.g. cat filename >/dev/lp0) then the splp settings are active. To display the device driver characteristics of the lp1 printer issue the "splp /dev/lp1" command: # splp /dev/lp1 indent = 0, width = 80, length = 66, timer = 60 seconds +bs +cr +ff +nl +tb -cap -wrap -plot -sync -err -fontinit serial printer: -parenb -parodd -cstopb exta cs8 Parameters can be changed with the splp command in the following form: splp /dev/lp1 width=132 Note: splp will not work for serial printers unless CD is high on the printer port. Therefore the printer must be on-line before the "splp" command is issued. When using splp from the "/etc/rc.include". file so it is important to bear this in mind. NOTE: To include parameters such as "plot" in the "splp" command you must use "+plot" to turn the parameter on and "-plot" to turn the parameter off. This is different to the "piobe" command where the "-" indicates that the parameter is included. * If the '-cp' flag is used with the print command or if output is piped to print, temporary storage of the file to be printed is kept in /usr/spool/qdaemon. For this reason, it is essential that the '/usr' minidisk is large enough to hold the files that are going to be printed. Remote print requests via the lpd daemon are also received in /usr/spool/lpd until queued, then they are stored in /usr/spool/qdaemon. * More documentation on the printing subsystems can be found in: Using the AIX Operating System Chapter 2 - Printing Files The print command is described with it's flags and their meanings and examples are given. Managing the AIX Operating System Chapter 3 - Using the Queuing System This section deals with parts of the queuing system; print, qdaemon, backend and qconfig. It covers these in some depth. Chapter 4 - Managing Printers This short section discusses piobe and the ways in which print can be controlled by the user. ------------------------------ S.29 - Accessing remote printers via TCP/IP. Sharing your printers with other systems (lpd daemon). To use remote printers on another system will require you to have the TCP/IP component insalled and configured, and to manually edit the /etc/qconfig file for the remote printers. Notes: 1) Queue stanza names MUST be a maximum of three characters. 2) Device stanza names must be a maximum of six characters. 3) Queues names are shared among systems, not device entries. 4) More than one queue can point to a single device. To utilize a printer on system 'george' that has a queue name of 'lp0' requires the following entries in the qconfig file. The printer on this system 'sam' will be called 'rp0'. rp0: argname=rp0 device=drp0 drp0: friend = TRUE backend = /usr/lpp/tcpip/etc/lprbe -pserver=george -pqueue=lp0 If the remote system is NOT a AIX system, add '-naix' to the command line arguments for the lprbe backend statement. The lprbe backend also supports user filters with the -filter= line flag. For more information on this, and the available filters, see the "Interface program for TCP/IP" manual. * To be allow other systems to utilitze your printers for remote printing is a three step process. 1) Make sure the remote system IP address and name are known. If you are not using domain name service or NIS(YP), make sure that the remote hostname and IP address are listed in /etc/hosts. 2) Insure that the 'lpd' daemon is started. To have it started at boot time, edit /etc/rc.tcpip and uncomment the three lines after 'Start up Print Daemon': # Start up Print Daemon #if [ -f /usr/lpp/tcpip/etc/lpd ]; then # /usr/lpp/tcpip/etc/lpd & echo " lpd\c" >/dev/console #fi Note: The LOCAL printing daemon 'qdaemon' MUST also be started to use remote printing. The 'lpd' daemon just hands off received remote printing requests and files and queues them in the local queues controlled by the qdaemon. 3) Systems allowed to print on your printers MUST be listed in the access file read by the 'lpd' daemon. This file is '/etc/hosts.lpd'. It is a simple ascii file with one line for each hostname that will be using your print queues. Note: If you change this file with 'lpd' running, send a 'kill -2 ' to cause the daemon to re-read the /etc/hosts.lpd file for new authorized hostnames. If using domain name service AND the remote system is NOT in your domain the full domain name of the system MUST be entered. * If using remote printing make sure that TCP/IP updates are installed: - IX03872 located on update 1733 or later, security problems with the lpd daemon. - IX06162 located on update 1734 or later, lpd not cleaning up /usr/spool/lpd temporary files. ------------------------------ S.30 - Using 9332 (SCSI) disk drives with AIX. Coming soon... ?????? ------------------------------ S.31 - Making a backup of the VRM minidisk. To take a backup of your installed VRM, use the command: cvid /dev/fd0 This command will backup your current VRM and create a TAILORED VRM install diskette, which you can use to re-install your VRM. This is especially helpful for those who have altered the standard VRM install with their own drivers or re-ordered the lpost file order. You must have superuser authority and already initialized diskettes! ------------------------------ S.32 - How to increase the number of pty devices over 16. Includes kernel rebuild instructions, and some tuning notes. Note: The number of available ptys sets total number of available simultaneous xterms + rlogins + telnets Both xterm and rlogin use ptys that are in a getty disabled state. =============================================================== You have two ways of defining the limits on the number of ptys: o The number of ptys configured into the kernel o The number of pty device nodes in /dev. Kernel pty Customization By default, the kernel is configured with 16 ptys. You can change this number and rebuild the kernel to adjust the number of possible ptys. Use the following steps to change the number of possible ptys: 1. Edit the /etc/master file. A) Modify the ptybuffers attribute in the sysparms stanza. sysparms: << see NOTES2 below ... ptybuffers = 16 << modify to 64 ... charlists = 64 << see below on value B) Modify the maxminor attribute in the uptc and upts stanzas. uptc: major = 9 maxminor = 16 << modify to 64 prefix = ptc routines = open,close,read,write,ioctl,init,select,revoke mandatory = true upts: major = 7 maxminor = 16 << modify to 64 prefix = pts routines = open,close,read,write,ioctl,init,select,revoke mandatory = true C) validate all sysparm values in /etc/master, and then rebuild the kernel. See NOTES2 below on steps. Each pty uses some kernel memory. Other system parameters (such as the number of processes and charlists) should be tuned to reflect the additional ptys. Each pty implies at least two processes in use: one for control and one for the slave. As you increase the number of ptys, you should also increase the number of charlists. Each charlist (or cblock) has space for 64 characters. Try to have a minimum of three or four charlists for each pty to be in use at the same time. For ptys that are heavily used, increasing the number of charlists may improve performance. WARNING: It is possible to run out of charlists and hang the system. If an X Server is hidden by another virtual terminal, and there are processes (such as xterm) writing to that server, and if the sockets to the server fill up, the ptys may fill up on the slave-to-master path and use all the charlists. The blockage can be resolved by showing the X Server, allowing its display backlog to disappear and freeing the used charlists. To avoid running out of charlists, provide enough charlists so that xterm slave processes can block on output without using up all the free charlists. This means you should provide approximately five additional charlists (about 300 characters) for each pty. The charlists are defined by the charlists attribute in the sysparms stanza of the /etc/master file. System pty Customization Each device is declared in a stanza of /etc/system. Use the devices command to add devices to the system. The devices command adds devices to the configuration files and makes a special device node in /dev. Many programs other than X-Windows use ptys. Most of the other programs require the use of a getty that supports login. You may have more ptys in the kernel than you have defined by devices. The maximum number of ptys is 256 (the maximum number of minor devices per major device). Ordinarily, you should not use devices to create more than 64 ptys. ============================================================== The above information is quoted from the "X-Windows Guide and Reference" pg 2-18 and 2-19. NOTE1: The charlists sysparms value should approximately be: 64 minimum, or #pty * 5 NOTE2: If you will be making use of the additional login/rlogin/xterm capability, you will HAVE to increase the following parameters in the sysparms stanza of /etc/master. procs = 60 Sets total number of processes. suggested value: 60 + ( 2 * #ptys ) + #xservers + #hft devices + #nfsd + #biod + #tty ports kprocs = 5 Sets number of kernel processes. Suggested value: 5 + #xservers maxprocs = 40 Maximum number of processes per user. may need more, if users have lots of xterms open. filetab = 250 Sets the total number of open file table entries. suggested minimum value: 100 + (3 * procs) better value: 100 + (6 * procs) inodetab = 250 Make the same as filetab. Changing any of these values requires a kernel rebuild. To rebuild the kernel, follow these steps: 1) login as root. 2) Make sure you have the "install/maint" diskette handy to correct a botched kernel build! 3) make sure /usr has enough free space to rebuild. 4) cd /usr/sys 5) compile new kernel: make 6) save old kernel: cd / cp -p /unix /unix.keep 7) copy new kernel to root: cd /usr/sys cp unix.std /unix 8) reboot the system sync sync shutdown -rf 0 9) after system comes back up, add any needed pty devices using the 'devices' command. ================================================================================ *** FAQ Continued in Q & A secton part 1 *** =============== end of ibm-rt-faq/aix-v2/software/part3 ======================== -- Posted around the first of each month to comp.sys.ibm.pc.rt, and to comp.unix.aix. This FAQ is dedicated to use of the AIX Version 2 operating system, running on the IBM RISC processor known as the RT. The RT is known also as an IBM model 6150 or 6151 machine. For AIX RT submissions E-mail to: aix-rt@antimatr.hou.tx.us For AOS RT submissions E-mail to: aos-rt@antimatr.hou.tx.us For MACH RT submissions E-mail to: mach-rt@antimatr.hou.tx.us For general Q&A submissions (hardware and other stuff) E-mail to: faq-rt@antimatr.hou.tx.us Other comments and correctons should be sent to the author: Mark Whetzel DOMAIN addr: markw@antimatr.hou.tx.us BANG address: ..!uhnix1!lobster!antimatr!markw Daytime work number 8AM-5PM M-F CST VOICE: (713) 963-2544 -- AIX..... NOT just another UNIX. (tm) Mark Whetzel | My own RT system.. My own thoughts.. DOMAIN: markw@antimatr.hou.tx.us | IBM RT/135 running AIX 2.2.1 UUCP ..!menudo!lobster!antimatr!markw | comp.sys.ibm.pc.rt FAQ maintainer.