4.2 already has a similar feature.


------------------------------

1.149 How to install LPPs on a shared disk?
From: Ciaran Deignan <C.Deignan@frec.bull.fr>

I have an LPP that I want to install on all my AIX machines (for
example the "perl" freeware), but I want to minimize the disk-space
used on the network of machines. Can I selectively mount part of /usr
on another machine?

In general it is not possible to share an LPP with several machines.
Sometimes it is possible to use a dedicated filesystem to install
freeware which can then be shared.

However for anything packaged as an LPP it is possible to use
a script that replaces /usr/sbin/inurest, and that redirects files
delivered by the LPP to the shared disk.

One script that does this is called Ninstallp, and it is available
(with instructions) from
http://www.geocities.com/ResearchTriangle/5428/ninstallp.html

------------------------------

1.150 How can I reduce the size of /var/adm/wtmp ?

The file /var/adm/wtmp grows with each login, but is never reduced.
The contents of wtmp is used (only?) by the command "last",
which shows, in reverse order, all the logins and reboots that
happened since the start of the wtmp file.

The file should not be deleted, but the contents can be discarded using
the following command:
# > /var/adm/wtmp

Alternatively the freeware utility "tidysys" can remove all the entries
from wtmp that are older than (say) 15 days. Tidysys was written by
Terry Murray <terry@weavel.demon.co.uk> for AIX 3.2 and is available
from ftp://ftp.frontiernet.net/pub/aix/tsys220.tar.

Tidysys was ported to AIX 4.1 by C. Deignan and is available from
<http://www-frec.bull.com/>.

------------------------------

1.151: How do I start local daemons at system startup?

AIX does neither use the BSD style rc.local file nor the System V style
/etc/rc*.d startup files directories. To add local daemons to the system
startup sequence in a BSD rc.local style use the following command to
create an /etc/inittab entry:

# mkitab -i rcnfs "rclocal:2:wait:/etc/rc.local >/dev/console 2>&1"
# touch /etc/rc.local
# chmod 700 /etc/rc.local

Then put the command lines to start the daemons in /etc/rc.local.

------------------------------

1.200: Some info about tape backups
From: Craig Anderson

The following supplements the information on rmt devices in
InfoExplorer. It is based on my own personal experience with IBM tape
drives running on AIX 3.1. No warranty is expressed or implied.

CONFIGURING THROUGH SMIT:
    BLOCK size (0=variable length)		(ALL)
	Sets the tape block size.  When reading, the block size must be
	set to the block size set when the tape was written.  When
	using some commands, tapes written with ANY block size can be
	read if the block size is set to 0 (variable length) (see
	"BLOCK SIZES" below).

    Use DEVICE BUFFERS during writes		(ALL)
	Set to yes, the device will buffer data internally on writes.
	This greatly improves performance, but under certain cases may
	be undesirable since the data is not written to tape before
	returning a good indication.

    Use EXTENDED file marks			(8mm only)
	Extended file marks take up much more space than short (or
	non-extended) file marks.  But extended file marks can be
	overwritten, allowing data not at the beginning of tape to be
	overwritten (see "FILE MARKS" below).

    RETENSION on tape change or reset		(1/4" only)
	If set to "no" then the tape will not be retentioned
	automatically when the tape is inserted.  Note that this will
	take effect only after the device is used.


FILE MARKS:
     Tape devices support multiple tape files.  Tape files are the
     result of a backup/cpio/tar/dd type command, where the device is
     opened, written to, and closed.  Because tapes allow large
     quantities of data to be written on a single tape, several backups
     (that is, tape files), may be combined on one physical tape.
     Between each tape file is a "tape file mark" or simply "file
     mark".  These file marks are used by the device driver to indicate
     where one tape file ends and another begins.

                              B       E
                   <-------   O       O   ------->
                              T       T
     physical | \            |       |      \             |physical
     beginning|  \           | tape  |       \            | end
       of     |   \          | file  |        \           |  of
      tape    |    \         | mark  |         \          | tape
              |_____\________|_______|__________\_________|
 
     Note that there is a distinction between the beginning of tape
     (BOT) side of a file mark and the end of tape (EOT) side of a file
     mark.  If the head is on the BOT side of a file- mark, "tctl fsf
     1" command will move only to the EOT side of the same file mark.

     With the 1/4" tape drive, writing can only take place
     sequentially, or after blank tape has been detected.  You cannot
     write over data on the tape (except at BOT).  If you wish to add
     data to a tape which has been written and then rewound you should
     space forward file mark until an error occurs.  Only then can
     you start writing again.

     With an 8mm tape drive, writing can only take place before blank
     tape, an EXTENDED file mark, or at BOT.  Thus if several backups
     have been made on one tape and you wish to overwrite one of the
     backups, position the tape to the place you wish to start writing
     and issue the following commands:
	tctl bsf 1
	tctl eof 1
     The first command skips back to the BOT side of the same file
     mark.  The second command rewrites the file mark (writing is
     allowed before extended file marks).  The erase head will erase
     data ahead of the write head, so that after writing the file mark
     the head will be positioned before blank tape.  Only after this
     may you start writing over data in the middle of the tape.  (All
     data beyond where you are currently writing will be lost).  Note
     that you cannot write over short file marks.  In order for this to
     work, the tape must have been written with extended file marks
     (use smit to change this).

     With the 9-track drive writing can take place anywhere on the
     tape although overwriting single blocks of data is not supported.

     On the 8mm drive extended filemarks use 2.2 megabytes of tape and
     can take up to 8.5 seconds to write.  Short filemarks use 184K
     and take up to 1.5 seconds to write.

BLOCK SIZES:
     When data is written to tape it is written in blocks.  The blocks
     on a tape are separated by inter-record gaps.  It is important to
     understand the structure of the written tape in order to
     understand the problems which can occur with changing block
     sizes.

     In fixed block size mode all blocks on the tape are the same
     size.  They are the size of the block size set in the device
     configuration.  All read()s and write()s to the tape drive must be
     a multiple of the fixed block size.

     In fixed block mode a read() will return as many blocks as needed
     to satisfy the read() request.  If a file mark is encountered
     while reading the tape only the data up until the file mark will
     be returned.

     It is not possible for the tape drive to read a tape whose block
     size is not the same as the block size in the device
     configuration.  (Unless the device configuration is in variable
     size blocks.)

     In variable block size (0) mode, the blocks written on the tape
     are the size of the read() and write() requests to the device
     driver.  In this case, the actual block sizes on the tape can be
     changed using the options to the backup commands (tar -C, cpio -C,
     backup -C).

     In variable mode, read() requests greater than size of the block
     on the tape will return only the data from the next block on the
     tape.  It is this feature that allows tapes written in any block
     size (fixed or variable) to read with the dd command (the output
     from the dd command may be piped to restore, tar, or cpio for
     example.)  Note that backup, tar, and cpio cannot read all tapes
     by using a large block size because they assume there is an error
     if they get a short read().
		dd ibs=128k obs=16k if=/dev/rmt0 | ...

     The tape head is always positioned at an inter-record gap, file
     mark, or blank tape after reading or writing.

     With the 8mm tape drive, using a fixed block size which is not a
     multiple of 1K is inefficient.  The 8mm tape drive always writes
     internally in 1K blocks.  It simulates the effect of variable
     block sizes, but, for example, using a fixed block size of 512
     bytes (or using variable block size and write()ing 512 bytes at a
     time) wastes one half of the tape capacity and gives only one half
     the maximum transfer rate.

     To figure out a tape's actual block size try:

     1). Set the tape to variable block size.
     2). "dd if=<tape> of=/tmp/dummy bs=128k count=1"
     3). "ls -l /tmp/dummy"
     4). The number of bytes in "/tmp/dummy" is the physical block size.

EXCHANGING DATA WITH NON-UNIX AND OTHER VENDORS MACHINES:
     Many tape drives support both variable and fixed block sizes.

     Variable block mode writes block sizes the size of the write
     command issued (tar and backup specify this with the -b option). 
     In fixed mode, block sizes are fixed and all writes must be a
     multiple of the fixed block size.

     Unix often internally chops larger reads and writes up into
     manageable pieces (often 65535, 65534, or 65532 bytes) before
     doing the actual reads and writes.  This means reads and writes of
     64K bytes are often broken up into a 65535 byte record and a 1
     byte record (In fixed mode the write will fail).  Block sizes >=
     64K (-C128 and greater) should be avoided for this reason.  AIX
     does not break up read and write requests, but be aware of the
     situation on other machines.

     If the tape is written in an unknown block size then set the
     device configuration in smit to use variable size blocks, use the
     "dd" command with a large input block size, and pipe it to the
     restore command.  For example:
	  chdev -l rmt0 -a block_size=0
	  dd if=/dev/rmt0 ibs=128k obs=16k | tar -tvf-
Newsgroups: comp.unix.aix,comp.answers,news.answers
From: jum@anubis.han.de
Approved: news-answers-request@mit.edu
Followup-To: comp.unix.aix
Supersedes: <aix-faq-2-886305604@anubis.han.de>
Reply-To: jum@anubis.han.de (Jens-Uwe Mager)
Keywords: AIX RS/6000 questions answers
Sender: jum@baghira.han.de (Jens-Uwe Mager)
Expires: Sun, 5 Apr 1998 05:01:07 GMT
Organization: At Home
Message-ID: <aix-faq-2-888724807@anubis.han.de>
References: <aix-faq-1-888724807@anubis.han.de> 
Date: Sun, 1 Mar 1998 04:00:18 GMT
         and their answers.  AIX is IBM's version of Unix.
Path: news.univie.ac.at!aconews.univie.ac.at!newscore.univie.ac.at!newsfeed.nacamar.de!uni-erlangen.de!uniol!news.rz.uni-hildesheim.de!baghira.han.de!jum
Lines: 1311
Xref: news.univie.ac.at comp.unix.aix:125558 comp.answers:29709 news.answers:39487

Posted-By: auto-faq 3.3 (Perl 4.035)
Archive-name: aix-faq/part2
Posting-Frequency: monthly


------------------------------

1.201: How do I do remote backup?

There seems to be several ways of doing this.  The first approach is a
one-liner to allow tar to reference another machine's device.  The
second is more complete but uses a similar approach.  The latest
addition to this section claims to be able to support mksysb on a
remote machine.  Thanks to all the contibutors.

  tar -b1 -cf - . | rsh REMOTEHOST "dd ibs=512 obs=1024 of=/dev/TAPEDEVICE"

[Ed.: The usave.sh script has been moved to section 8.06.  I've verified
this script works fine. However, it may be slow for large filesystems
since it creates a temp file of filenames in /tmp.]

There are also several commercial solutions.  One is IBM's SYSBACK/6000
product.  See Question 1.209 for more information.

Open Microsystems sells a product called DistribuTAPE which supports
mksysb to a remote tape drive under AIX 3.2, 4.1 and 4.2.  DistribuTAPE
supports remote tape drives by placing a pseudo tape driver on the
client system, and a server daemon on the server.  More information at
http://www.openmic.com/

------------------------------

1.202: How do I backup a multi-disk volume group?
From: pack@acd.ucar.edu (Daniel Packman)

[ Ed.: I have not verified this procedure. I would actually recommend
  NOT to have one volume group span multiple disks unless you really
  need such big logical volumes. ]

  1. If you have a set of three or more disks in a volume group
     (typically 3 for 5xx machines with three internal drives;
     with only two, the procedures outlined here have to be modified
     to ignore the fact that you don't have a quorum in the volume group)

  2. If one drive has failed (usually only one fails at a time :-) )

It is possible to go through a service boot (the volume group is called
rootvg and one of the 2 good disks on it is called hdisk0):

  importvg -y rootvg hdisk0
  varyonvg -f -n -m1 rootvg

These commands will work, but give error messages. If you wish to mount
a user filesystem, say /u on logical volume /dev/lv00, then

  mount -f /dev/lv00 /v

will work only if jfslog, the journaled file system log device, is not
on the damaged disk. If it is, you must (and can in any case) mount the
filesystem read-only:

  mount -f -r /dev/lv00 /v

This crucial and rather obvious point baffled several level 3 support
personnel at Austin as well as myself for almost a week. Once the file
system(s) of interest are available, they can be saved to tape for
restoration later. Of course, one can expect only about two thirds of a
filesystem to be recoverable if it spans all 3 physical disks. One
other point to remember is that the standard boot procedure from floppy
includes the restore command but does not include the backup command.

*****************************************************************************
* If you do not have other RS6000 machines at your site it is imperative    * 
* that you either build a bootable tape which includes either restore or    * 
* tar or cpio (a bootable floppy set will not have enough space) or at the  *
* very least copy onto a spare floppy backup, cpio, or tar.  The floppy     *
* should be created with backup -ivq so that its contents can be read into  *
* the memory resident system after booting.                                 *
*****************************************************************************

All is not lost if tar, cpio or backup are available on an undamaged
disk that can be mounted. Since tar and cpio are in /bin, they may both
very well be unavailable.

It is a very good idea for those who have tape devices to build a
bootable tape with their desired extra commands in it. Follow the
instructions from IBM but add your desired commands to the following
three files:

    /usr/lpp/bosinst/tape2
    /usr/lpp/bosinst/diskette/boot2
    /usr/lpp/bosinst/diskette/inslist

If you have anything other than a minimum memory configuration, you
should be able to add many commands.

------------------------------

1.203: How do I put multiple backups on a single 8mm tape?
From: kerm@mcnc.org (Cary E. Burnette)

There are two possible solutions to this, both of which use /dev/rmt0.1
which is non-rewinding.

SOLUTION #1
-----------

To put multiple backups on a single tape, use /dev/rmt0.1, which is a
no-rewind device, using either rdump or backup (both by name & inode
work). Using rdump or backup "byinode" both generate the message that
the tape is rewinding but actually do not. This is an example that
works on my system:

# rsh remote1 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
# rsh remote2 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
# tctl -f /dev/rmt0.1 rewind       # rewinds the tape

where I am implementing the command from host.

# restore -f /dev/rmt0.1 -s1 -tv

where the -s1 flag tells restore to go to the first record on the tape. 
Type the exact command again to get the second record. The -s(Number)
means go to Number record from this spot. It works pretty well.


SOLUTION #2
-----------
Steve Knodle, Educational Resources Center, Clarkson University

I use:
------------------- Dump.sh --------------------
CONTENTSFILE=`date |dd conv=lcase |sed -e 's/19//' |awk '{print $6 $2 $3}'`
set -x
LEVEL=$1
shift

backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /
backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /usr
backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /u
tctl -f /dev/rmt0 rewind

touch /usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /usr" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /u" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
tctl -f /dev/rmt0 rewind

I process the table-of-contents first by a little program that does
common prefix encoding, and then compress.

is reused.


Solution #3
-----------
   mount | grep jfs | cut -c27- | cut -d" " -f1 | \
     xargs -i backup -${LEVEL} -u -f /dev/rmt1.1 {} > ${DATE}.backup 2>&1

------------------------------

1.204: How can I make an exact duplicate of a tape over the network?

The challenge here is not to have to create a temporary file (disk space
limitation) and work across heterogeneous networks.

This script might work:

LOCAL=/dev/tape_dev
REMOTE=/dev/tape_dev
dd if=$LOCAL ibs=64k obs=512 | rsh remote_host dd ibs=512 obs=64k of=$REMOTE


From: pack@acd.ucar.edu (Daniel Packman)

Daniel provides the following perl script to convert from the known
world's function codes to AIX for compatibility.

#!/bin/perl
# Wrapper to convert input rmt requests to
# AIX 3.2 ioctl numbers.  We pass on all commands we don't understand
# I0 MTWEOF -> I10  STWEOF write and end-of-file record
# I1 MTFSF  -> I11  STFSF  forward space file
# I2 MTBSF  -> I12  STRSF  reverse space file
# I3 MTFSR  -> I13  STFSR  forward space record
# I4 MTBSR  -> I14  STRSR  reverse space record
# I5 MTREW  -> I6   STREW  rewind
# I6 MTOFFL -> I5   STOFFL rewind and unload tape
# I7 MTNOP  -> I0   (no-op? should ignore following count)
# I8 MTRETEN-> I8   STRETEN retension tape, leave at load point
# I9 MTERASE-> I7   STERASE erase tape, leave at load point
#I10 MTEOM (position to end of media ... no ibm equivalent?)
#I11 MTNBSF  (backward space file to BOF ... no ibm equivalent?)
@iocs = (10,11,12,13,14,6,5,0,8,7);
open(RMT,"|/usr/sbin/rmt") || die "Can't open pipe to rmt\n";
select(RMT);
$| = 1;
while (<STDIN>) {
  s/(^I)(\d$)/I$iocs[$2]/;
  exit 0 if $_ =~ /^[Qq]/;
  print RMT $_ ; }
exit 0;

------------------------------

1.205: What is tape block size of 0?
From: benson@odi.com (Benson I. Margulies)

Tape devices are generally split into two categories: fixed block and
variable block.  1/4" tape is the fixed block, and 8mm is variable.

On a fixed block size device, the kernel always sends data to the device
in suitable block size lumps, and varying the size passed to write(2)
(e.g., via the bs option to dd) gives the kernel more data to stream. 
On a variable block size device, the kernel writes to the device
whatever passed to it. On an 8mm, it had better be a multiple of 1024
to get efficient tape usage.

AIX has the World's Only Variable Block Size 1/4" tape drive. If you
use SMIT to set the block size to a nonzero value, AIX treats the device
as fixed block size, whether it is or not. By default, 8mm drives are
set to the same size as 1/4", 512 bytes. This is wasteful, but
otherwise mksysb and installp would fail.

If you set the block size to 0, the device is treated as variable block
size, and the size passed to write becomes the physical block size. 
Then if you use a sensible block size to dd, all should be wonderful.

------------------------------

1.206: Resetting a hung tape drive
From: Craig_Anderson@kcbbs.gen.nz (Craig Anderson)

A process accesses the tape drive. The process stops, exits, or whatever,
but still hold on to the drive. When this happens, the process cannot be
killed by any signal and the tape drive cannot be used by any other
process until the machine is rebooted.

The following should help:

RESET:

AIX, like most UNIX systems has no reset function for tape drives. You
can however send a Bus Device Reset (a standard SCSI message) to the
tape drive using the following piece of code. If the tape drive does
not respond to the BDR, then a SCSI Bus Reset will be sent (and this
will reset every device on the SCSI Bus). SCSI Bus resets are rather
extreme so you should refrain from using this program unnecessarily. 
But there are times (like after you've inserted a jammed/old/bad tape in
an 8mm drive), when there's no other way to reset the device other than
to shutdown and reboot (obviously you can power down and up an external
drive to reset it - and this would be the better choice).

This is actually documented in info, but can be hard to find and
there's no complete program.

/* taperst: resets the tape drive by sending a BDR to the drive. */
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/scsi.h>

int main(int argc, char **argv)
{
         /* This can be run only by root */

         if (argc != 2) {
             fprintf(stderr, "Usage: %s /dev/rmt#\n", argv[0]);
             return 1;
         }

         if (openx(argv[1], O_RDONLY, 0, SC_FORCED_OPEN) < 0) {
             perror(argv[0]);
             return 2;
         }
         return 0;
}

------------------------------

1.207: How do I read a mksysb tape with tar?
From: Marc Pawliger (marc@sti.com)

To recover specific files from a backup made with mksysb, try
$ tctl fsf 3
$ tar xvf/dev/rmt0.1 ./your/file/name


------------------------------

1.208: How do I read a 5Gbyte tape on a 2Gbyte drive?
Posted by: bobmet@clam.com (Robert Metcalf)

To read a 5Gbyte tape on a 2Gbyte drive, the
tape needs to have been created with a density setting of 20.

The following is from IBM's electronic ASKSUPPORT repository:
  
   R: The 7208 011 5 GB tape drive has various density settings which are
      as follows:
  
     +-------+--------------------------+
     | DENSIT| DESCRIPTION              |
     | SETTIN|                          |
     +-------+--------------------------+
     | 140   | Writes in 5.0GB mode and |
     |       | will enable data com-    |
     |       | pression; also, to do    |
     |       | compression you must use |
     |       | "DATA COMPRESSION = yes" |
     +-------+--------------------------+
     | 21    | Writes in 5.0GB mode and |
     |       | will NOT do data com-    |
     |       | pression                 |
     +-------+--------------------------+
     | 20    | Writes in 2.3GB mode and |
     |       | will NOT do data com-    |
     |       | pression                 |
     +-------+--------------------------+
     | 00    | Factory power-on default |
     |       | for 5.0GB data com-      |
     |       | pression mode            |
     +-------+--------------------------+
  
     The density setting of the 7208 011 must be 20 for it to make a tape
     that is readable by the 7208 001.


------------------------------

1.209: What can Sysback do for me?
From: johnsont@austin.ibm.com (Tony Johnson)

Sysback provides the flexibility of restoring onto the same system in
the exact same manner, or onto a completely different system with
differnet disk configuration, platform type, kernel, etc, while
reporting any inconsistencies and allowing you to adjust to fit. For
instance, you will get warnings if a particular volume group cannot be
created because the original disks to not exist, or that mirroring
cannot be accomplished because there is no longer enough disk space
because the disks are smaller. You can then select the disks for each
volume group, reduce or add space to filesystems and LVs, exclude
entire VGs or filesystems, etc.  You can even add and delete mirrors,
stripe or un-stripe logical volumes, etc.

In addition, all of the Sysback functions can be performed across the
network, including network boot and network install, and you can
perform striped backups across multipel tape drives, use sequential
tape autoloaders, and perform unattended multi-volume backups with
cron.

ON AIX 3.2, mksysb does not retain paging space config, disk LV
placement, mirroring, etc.

On AIX 4.1, it does these on an EXACT same configuration, but does not
allow any flexibility, and still does not retain non-rootvg volume
groups (although you can now use additional commands to backupa nd
restore these).  mksysb also does not allow you to clone onto
different platforms (i.e.  rspc -> rs6k -> rs6ksmp).


------------------------------

1.210: How can I get my HP 4mm DAT to work?

For HP25470/80A DDS:
   MRS disabled: Set switches 3,6,7,8=0 and 1,2,4,5=1
   MRS enabled:  Set switches 3,6,7=0 and 1,2,4,5,8=1

------------------------------

1.211: How do I copy DAT tapes?

If you have two drives try tcopy(1).  Otherwise the traditional UNIX
approach is ( dd if=/dev/rmt0 bs=1024b | dd of=/dev/rmt1 bs=1024b )
Put that in a while loop using a non-rewinding device to do multiple
files.  To use drives from two different machines either get the GNU
dd (bundled with GNU tar) or use something like.

  $ dd if=/dev/rmt0 bs=1024b | rsh hostname dd of=/dev/rmt0 bs=1024b


------------------------------

1.212: How do I speed up backups to DLT tapes?

DLT tapes need high data rates to stay in streaming mode. To achieve
higher data rates, use a variable length block size by setting the fixed
length block size to zero. Also use a buffer size of about 64KB for
backup (128 blocks for tar).

------------------------------

1.300: Some info about the memory management system
From: Michael Coggins (MCOG@CHVM1.VNET.IBM.COM).

1. Does AIX use more paging space than other unix systems?

Under many scenarios, AIX requires more paging space than other unix
systems. The AIX VMM implements a technique called "early allocation of
paging space". When a page is allocated in RAM, and it is not a
"client" (NFS) or a "persistent" (disk file) storage page, then it is
considered a "working" storage page. Working storage pages are commonly
an application's stack, data, and any shared memory segments. So, when
a program's stack or data area is increased, and RAM is accessed, the
VMM will allocate space in RAM and space on the paging device. This
means that even before RAM is exhausted, paging space is used. This
does not happen on many other unix systems, although they do keep track
of total VM used.

Example 1: 
Workstation with 64mb RAM is running only one small application that
accesses a few small files. Everything fits into RAM, including all
accessed data. On AIX, some paging space will already be used. On
other unix systems, paging space will be 100% free. Clearly, this is an
example that shows where we use more paging space than the other machines.

Example 2:

Same machine as above, except we are in an environment where many
applications are running with inadequate RAM. Also, the system is
running applications that are started, run, left idle, and not in
constant use. A session of FRAME running in a window, for example. 
What happens is that eventually (theoretically) all applications will be
paged out at least once. On the AIX system and the other systems the
total paging requirements will be the same (assuming similar malloc
algorithm). The major difference is that the AIX system allocated the
paging space pages before they were actually needed, and the other
systems did not allocate them until they were needed. However, most
other systems have an internal variable that gets incremented as virtual
memory pages are used. AIX does not do this. This can cause the AIX
system to run out of paging space (virtual memory), even though malloc()
continues to return memory. This "feature" allows sparse memory
segments to work, but requires that all normal users of malloc()
(sbrk()) know how much virtual memory will be available (actually
impossible), and to handle a paging space low condition. A big problem. 
There are some pretty obvious pros and cons to both methods of doing
Virtual Memory.

2. How much paging space do I need?

Concerning the rule of thumb of having 2 times RAM for paging space:
this is rather simplistic, as are most rules of thumb.  If the machine
is in a "persistent storage environment", meaning that they have a few
small programs, and lots of data, they may not need even as much as 1
times RAM for paging space.  For example, a 1GB database server running
on a 6000 with 256MB of RAM, and only running about 50MB of "working"
storage does not need 512MB of paging space, or even 256MB.  They only
need the amount of paging space that will allow all their working
storage to be paged out to disk.  This is because the 1GB database is
mostly "persistent storage", and will require little or no paging space. 
Excessive paging space may simply mean wasted disk space.  However,
avoid insufficient paging space.  Tip: Don't have more than one paging
space per disk.  Tip: Put lots of RAM in your system - it will use it.

3. Why does vmstat show no free RAM pages?

AIX uses RAM as a possibly huge disk buffer.  If you read a file in the
morning, that file is read into RAM, and left there.  If no other
programs need that RAM, that file will be left in RAM until the machine
is halted.  This means that if you need the file again, access will be
quick.  If you need that RAM, the system will simply use the pages the
file were using. The pages were flushed back to disk earlier.  This
means that you can get a huge speedup in disk access if you have enough
RAM.  For example, a 200MB database will just ease into RAM if you have
a 256MB system.

4. Since vmstat shows no free RAM pages, am I out of RAM?

Probably not. Since disk files will be "mapped" into RAM, if vmstat
shows lots of RAM pages FREE, then you probably have too much RAM (not
usual on a RISC System/6000)!

5. Shouldn't the "avm" and the "fre" fields from vmstat add up to something?

No. The "avm" field tells you how much "Active Virtual Memory" AIX
thinks you are using. This will closely match the amount of paging
space you are using. This number has *ABSOLUTELY* nothing to do with
the amount of RAM you are using, and does *NOT* include your mapped
files (disk files).  The amount of RAM can be determined with
/usr/sbin/bootinfo -r

6. Why does the "fre" field from vmstat sometimes show lots of free
   RAM pages?

This will happen after an application that used a lot of RAM via
"working" storage (not NFS storage, and not disk file or "persistent"
storage) exits. When RAM pages that were used by working storage (a
program's stack and data area) are no longer needed, there is no need to
leave them around. AIX completely frees these RAM pages. The time to
access these pages versus a RAM page holding a "sync'd" mapped file is
almost identical. Therefore, there is no need to periodically "flush" RAM.

7. Is the vmstat "fre" field useful?

The vmstat "fre" field represents the number of free page frames.  If
the number is consistently small (less than 500 pages), this is normal. 
If the number is consistently large (greater than 4000 pages), then you
have more memory than you need in this machine.

------------------------------

1.301: How much should I trust the ps memory reports?
From: chukran@austin.VNET.IBM.COM

Using "ps vg" gives a per process tally of memory usage for each running
process.  Several fields give memory usage in different units, but these
numbers do not tell the whole story on where all the memory goes.

First of all, the man page for ps does not give an accurate description
of the memory related fields.  Here is a better description:

RSS - This tells how much RAM resident memory is currently being used
for the text and data segments for a particular process in units of
kilobytes.  (this value will always be a multiple of 4 since memory is
allocated in 4 KB pages).

%MEM - This is the fraction of RSS divided by the total size of RAM for
a particular process.  Since RSS is some subset of the total resident
memory usage for a process, the %MEM value will also be lower than actual.

TRS - This tells how much RAM resident memory is currently being used
for the text segment for a particular process in units of kilobytes. 
This will always be less than or equal to RSS.

SIZE - This tells how much paging space is allocated for this process
for the text and data segments in units of kilobytes.  If the executable
file is on a local filesystem, the page space usage for text is zero. 
If the executable is on an NFS filesystem, the page space usage will be
nonzero.  This number may be greater than RSS, or it may not, depending
on how much of the process is paged in.  The reason RSS can be larger is
that RSS counts text whereas SIZE does not.

TSIZ - This field is absolutely bogus because it is not a multiple of 4
and does not correlate to any of the other fields.

These fields only report on a process text and data segments.  Segment
size which cannot be interrogated at this time are:

       Text portion of shared libraries (segment 13)

       Files that are in use. Open files are cached in memory as
       individual segments.  The traditional kernel cache buffer
       scheme is not used in AIX 3.

       Shared data segments created with shmat.

       Kernel segments such as kernel segment 0, kernel extension
       segments, and virtual memory management segments.

Speaking of kernel segments, the %MEM and RSS report for process zero
are totally bogus for AIX 3.1.  The reason why RSS is so big is that the
kernel segment zero is counted twice.  For AIX 3.2, this has been
changed, but the whole story is still not known.  The RSS value for
process 0 will report a very small number of the swapper private data
segment.  It does not report the size of the kernel segment 0, where the
swapper code lives.

In summary, ps is not a very good tool to measure system memory usage. 
It can give you some idea where some of the memory goes, but it leaves
too many questions unanswered about the total usage.

------------------------------

1.302: Which simms do RS6000's use?

This answer is under construction... I'm trying to collect details
about compatable simms.

RS/6000 220,230 USE 2 pair 70ns PS/2 style simms
RS/6000 250,C10 USE 4 pair 70ns PS/2 style simms

------------------------------

1.303: What is kproc?

kproc (always PID 514 on AIX 3 and PID 516 on AIX 4) is the kernel's
idle process.

------------------------------

1.304: How do I create a RAM disk in AIX?
From: Jeff Wang <hjiwa@nor.chevron.com>

You can't create a RAM disk in AIX.  The closest related functionality
the operating system gives you is the RAM disk buffer. Read 1.300
sub-section 3.

------------------------------

1.305: How much RAM (real memory) does my machine have?
From: Michael Abel/resnova
	<Michael_Abel/resnova%RESNOVAD@notesgw.compuserve.com>

As     root:  bootinfo -r
As any user:  lsattr -E -l sys0 -a realmem

lsattr -C -c memory

shows all memory adapters.  On MCA systems one may add up the values
displayed for each memory card in order to sum up to the amount of
total memory.  On PCI systems only one item (mem0) is
displayed. Additional information may be displayed with

lsattr -E -lmem0

These commands were tested on various IBM systems running AIX relases
3.2.5 and 4.1.4

------------------------------

1.306: Why do PIDs run non-sequentially?
From: Julianne F. Haugh <jfh@austin.ibm.com>

The answer (I was there, consider me an authority ...) is that the
PIDs needed to be somewhat unpredictable.  This is because AIX was
originally designed with a number of C2 and B1 features, and one of those
is the notion of covert channel analysis.  Sequential PIDs are a covert
channel (assuming the system has one PID namespace ...) since the value
of the "next" PID is shared by all currently running processes.  So if I
want to sneak some of my classified data out to your co-operating
non-classified program, I can do it by carefully controlling the value
of the "next" PID.

------------------------------

1.400: How do I make an informative prompt in the shell?

In the Korn Shell (ksh), the PS1 variable is expanded each time it is
printed, so you can use:

$ export myhost=`hostname`
$ PS1='$LOGNAME@$myhost $PWD \$ '

to get, e.g. 

bengsig@ieibm1 /u/bengsig $

In the C-shell, use:

% set myhost=`hostname`
% alias cd 'chdir \!* > /dev/null; set prompt="$LOGNAME@$myhost $cwd % "'
% cd

to get, e.g.

bengsig@dkunix9 /u/bengsig/aixfaq %

There is no easy solution in the Bourne Shell.  Use the Korn Shell instead.

------------------------------

1.401: How do I set up ksh for emacs mode command line editing?

The ksh has an undocumented way of binding the arrowkeys to the emacs
line editing commands. In your .kshrc, add:

alias __A=`echo "\020"`   # up arrow = ^p = back a command
alias __B=`echo "\016"`   # down arrow = ^n = down a command
alias __C=`echo "\006"`   # right arrow = ^f = forward a character
alias __D=`echo "\002"`   # left arrow = ^b = back a character
alias __H=`echo "\001"`   # home = ^a = start of line

Type "set -o emacs" or put this line in your .profile.

Also, you MUST have PTF U406855 for this to work in AIX 3.2.  The APAR #
for the problem is IX25982, which may have been superseded.

------------------------------

1.402: Listing files with ls causes a core dump
From: Julianne F. Haugh <jfh@austin.ibm.com>

Scenario: a directory that is shared by N users (N >= 200).
Run 'ls -l' in that directory.  It goes for a while, then
Seg fault(coredump)!

It only occurs when the usernames are displayed (almost every file is
owned by a different person).  The -g and -n options work fine; only -l
and -o (which shows owner and not group) cause it. 

I believe that this problem was corrected by U407548.  If you have that
many users that you are having core dump problems (it took over 200),
you might also want to look into getting the PTF that fixes IX31403. 
That APAR deals with large numbers of accounts and performance problems
associated with looking them up.

------------------------------

1.403: How do I put my own text into InfoExplorer?

With AIX 3.1, you cannot do it.  AIX 3.2 has a product called
InfoCrafter that allows you to do that.

------------------------------

1.404: InfoExplorer ASCII key bindings 
From: mycroft@hal.gnu.ai.mit.edu (Charles Hannum)

If you just press 'Return' when it starts up, with 'Basic Screen
Operations' highlighted, you'll get some help.

If you look long enough, you'll find a page named 'Using Keys and Key
Sequences in the InfoExplorer ASCII Interface'.  It describes the key
sequences and actions.  Here are a few to get you started.

Keys       Action

Ctrl-W     Moves between the Navigation screen and the Reading screen.
If the Navigation screen is displayed, you can press Ctrl-W to display
the Reading screen.  If the Reading screen is displayed, you can press
Ctrl-W to display the Navigation screen.

Ctrl-O     Makes the menu bar active or inactive.  If your text cursor is
located in the text area of the screen, you can press Ctrl-O to make the
menu bar active.  If the menu bar is already active, you can press
Ctrl-O to make it inactive, which moves the text cursor to the text area.

Tab     Moves to the next menu bar option in the menu bar.  If a pull-down
menu is not displayed and you press the Right Arrow key, the next menu
bar option is displayed in reverse video.
 
------------------------------

1.405: How can I add new man pages to the system?
From: horst@faui63.informatik.uni-erlangen.de (Horst Luehrsen)

Put the man pages in /usr/man, e.g. /usr/man/man1/tcsh.1 for the tcsh
man page.  Under AIX 3.1.10, /usr/lib/makewhatis can be used to update
the makewhatis-database /usr/man/whatis so apropos and whatis know about
the added manpages.  /usr/lib/makewhatis should be available on all 3.2
versions.

For AIX 4.x, you can store the man pages in the /usr/share/man hierarchy.
/usr/lib/makewhatis is still there.

------------------------------

1.406: Why can't I read man pages?  Where is nroff?

Nroff and troff aren't in the base installation.  It is shipped as
part of AIX 3.2.5 but may not be installed.  Use smit to install a
software package called txtfmt.tfs.obj from your 3.2.5 distribution
media.

In AIX 4.x, you need bos.txt.tfs.

------------------------------

1.407: Why is my environment only loaded once?

The .profile file is only loaded once (for your login shell) subsequent
shells should be initialized by setting ENV=$HOME/.kshrc (for ksh).

Bash users can use $HOME/.bash_profile for the login shell environment
and $HOME/.bashrc.

------------------------------

1.408: Where is the 'nawk' command on my AIX system?
From: Jeff Wang <hjiwa@nor.chevron.com>

The /bin/nawk that exists on many UNIX flavors is a superset of the
'awk' command, revised by the same original authors to include added
functionality.  All the extra options normally associated with 'nawk'
on other UNIXes have been incorporated into the AIX version of 'awk';
the AIX 'awk' InfoExplorer or man pages include nawk-specific features
such as the "-v" command line option and atan2(), rand(), srand(),
match(), sub(), gsub(), system(), close(), getline functions.

If your AIX version is missing /bin/nawk (as are most AIX 3.x
versions), the simplest way to get around this and maintain script
portability between UNIX platforms is to make a /bin/nawk link to
/bin/awk (as root, of course).  If you do not have root privilege or
do not want to create a /bin/nawk link, to make the script work on
different UNIXes, you may have to test `uname` first and set all
'nawk' references on AIX runs to /bin/awk.  If your script is to only
run on AIX systems, you can just change all references of 'nawk' to
'awk' and everything should still work okay...but check the AIX awk
script on test data prior to making actual runs.

[Editor's note: AIX 4.x already contains a link from /usr/bin/nawk
to /usr/bin/awk.]

------------------------------

1.409: How do I copy InfoExplorer (manpages and more) to my hard drive?
From: David Alexander <unilink@online.rednet.co.uk>

[Editor's note: While this is documented in one of the AIX manuals
and covered in /usr/lpp/bos/bsdadm (AIX 3 only), it comes up often
enough I thought I would include it here.]

Not all the Info databases are required, so do not copy them all unless the 
customer specifically requests them, or has asked for the software they 
refer to.  These instructions assume you have enough space on /usr.

	Install and mount the InfoExplorer CD-ROM as for use of Info 
	from CD-ROM.

	Log in as Root
	umount /usr/lpp/info/lib/$LANG
	mkdir /mnt/$LANG
	mount -v cdrfs -r /dev/cd0 /mnt/$LANG

	cd /
	cd /mnt/$LANG
	cp -r aix /usr/lpp/info/lib/$LANG
	cp -r aix2 /usr/lpp/info/lib/$LANG
	cp -r compnav /usr/lpp/info/lib/$LANG
	cp -r hardware /usr/lpp/info/lib/$LANG
	cp -r nav /usr/lpp/info/lib/$LANG
	cp -r prog /usr/lpp/info/lib/$LANG
	cp -r uiprog /usr/lpp/info/lib/$LANG

	Other sections can be copied if required:
	Section						Size
	cp -r ada /usr/lpp/info/lib/$LANG		7.2  Mb
	cp -r assemb /usr/lpp/info/lib/$LANG		5.23 Mb
	cp -r cxx /usr/lpp/info/lib/$LANG		6.52 Mb
	cp -r dce /usr/lpp/info/lib/$LANG		3.8  Mb
	cp -r encina /usr/lpp/info/lib/$LANG		2.67 Mb
	cp -r fortran /usr/lpp/info/lib/$LANG		6.85 Mb
	cp -r graph /usr/lpp/info/lib/$LANG		9.75 Mb
	cp -r graph2 /usr/lpp/info/lib/$LANG		4.1  Mb
	cp -r pascal /usr/lpp/info/lib/$LANG		3.23 Mb

	umount /mnt/$LANG
	eject the CD-ROM

------------------------------

1.410: Why can't I set my default shell to one we've just installed?

When adding new shells to the system, add them to the "shells=" line
in /etc/security/login.cfg so they can be used during ftp and rlogin
by users who use them as their default shell.

------------------------------
 
1.411: Why do I get the "Unable to connect socket: 3"
                starting Info-Explorer?

It's a bug in the way infod sets the initial permission on the            
/tmp/.info-help socket. Do a chmod 777 on /tmp/.info-help and the
message will go away. (Charlie McGuire, mcguire@cs.umt.edu)

This problem was fixed by APAR IX43230, PTF U432315
(Paul Sitz, psitz@empros.com)

------------------------------

1.412: Why can't I write a setuid shell script?
From: mww@microfocus.com (Michael Wojcik)

AIX, as of about the first release of 3.2.5* does not allow SUID scripts.
(It ignores the SUID and SGID bits on scripts.)  They're a huge security
hole.

If you really want to run a script SUID, you can create a small C program
that does a setuid(0) and then system()'s your script.  (Actually, the
setuid() call isn't necessary on all Unixes; IIRC, it's not on AIX 3.2.5,
but YYMV.)  Make the program SUID.  Be very careful.

There are other similar solutions.  You might also want to look into
sudo, which handles this sort of thing in a somewhat more controlled
manner

* Julianne Frances Haugh (jfh@tab.com) writes:

I raised an objection to set-ID shell scripts before AIX 3.1 was
golden.  ... it was finally done in the 3009 PTF for AIX 3.1.

------------------------------

1.500  Which release of X11 do I have?

AIX 4.x includes X11 R5 and Motif 1.2.

On AIX 3, Run 'lslpp -h X11rte.obj'.
If your output has a line similar to:

            01.02.0000.0000 COMPLETE   COMMIT     03/04/93   02:05:11 root

you have X11 R4. If your output has a line similar to:

    U491068 01.02.0003.0000 COMPLETE   COMMIT     07/28/93   12:50:42 root

you have X11 R5. Some people also call these AIXwindows 1.2.0 and
1.2.3.  'lslpp -h X11rte.motif1.2.obj' should tell you if you are
running Motif 1.2.


------------------------------

1.501: How to prevent ctrl-alt-backspace from killing the X session

Start X with 'xinit -T' to disable ctrl-alt-backspace from stopping X.

------------------------------

1.502: Who has a termcap/terminfo source for the HFT console?

The console used on the RISC System/6000, PS/2 and RT can be used as a
terminal on another system with the termcap below.  You can find this
and other termcaps in /lib/libtermcap/termcap.src, including IBM
specific ones.  The terminfo sources are stored in /usr/lib/terminfo/*.ti.
This termcap can also be used from an aixterm window.

hf|hft|hft-c|ibm8512|ibm8513|IBM_High_Function_Terminal:\
	:co#80:li#25:am:ht:\
	:cm=\E[%i%d;%dH:ti=\E[25;1H:te=\E[20h:\
	:nd=\E[C:up=\E[A:do=^J:ho=\E[H:\
	:bs:sf=\E[S:ec=\E[%dX:\
	:cl=\E[H\E[J:cd=\E[J:ce=\E[K:\
	:AL=\E[%dL:DL=\E[%dM:al=\E[L:dl=\E[M:\
	:im=\E[4h:ei=\E[4l:mi:\
	:dm=\E[4h:ed=\E[4l:\
	:so=\E[7m:se=\E[m:ul=\E[4m:ue=\E[m:\
	:md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:\
	:as=^N:ae=^O:sc=\E[s:rc=\E[u:\
	:kl=\E[D:kb=^H:kr=\E[C:ku=\E[A:kd=\E[B:kh=\E[H:\
	:kn#10:k1=\E[001q:k2=\E[002q:k3=\E[003q:k4=\E[004q:k5=\E[005q:\
	:k6=\E[006q:k7=\E[007q:k8=\E[008q:k9=\E[009q:k0=\E[010q:\
	:is=\Eb\E[m^O\E[?7h:rs=\Eb\E[m^O\E[?7h\E[H\E[J:

------------------------------

1.503: How can I look at PostScript files?  Why is "dpsexec" so lousy?
From: Marc Pawliger <marc@sti.com>

showps comes with the 1.2.3 (X11R5) version of the X11rte.ext.obj LPP.
Very nice PS file previewer from Adobe.  Replaces xpsview which came
with pre-1.2.3 Installed as /usr/lpp/DPS/showps/showps

From: VRBASS@ATLVMIC1 (Vance R. Bass)

You can look at PostScript files using either "xpreview" (in the
optionally installable text formatting services) or you can get
Ghostscript and Ghostview from a comp.sources.x server and build it
yourself.

>From the "xpreview" man page:
The xpreview command is an AIXwindows 1.2- and Motif 1.1-based
application that displays output from the troff command on an AIXwindows
display.  The troff command output file must be prepared for any one of
the devX100, devX100K or devpsc devices.  The xpreview command also
displays PostScript language files that begin with %!.

"dpsexec" is NOT intended to be a full-service document browser, but
rather a simple DPS code debugger.  If you insist on using it, you can
edit your PS code to remove the "showpage" (which will reset dpsexec
and clear the window) to view single-page files.  It does not handle
multi-page files gracefully.

------------------------------

1.504: unix:0 vs `hostname`:0

1.) Is there any way to get the machine to check its local host table
    first without renaming resolv.conf?

[AIX 3.2 only]
PTF U412845 implements an environment variable to set the resolver
time out in AIX 3.2.  This allows you to set RES_TIMEOUT to the number
of seconds before it times out, a failing a DNS query the machine will
consult /etc/hosts.  

2.) How do you tell X applications where you are if the console display 
    is unix:0?

From: David L. Crow <crow@waterloo.austin.ibm.com>

  I would suggest that if you have R5, use ":<display>.<screen>".  I do
  not believe that R4 clients will understand :0, so I would suggest
  unix:0 for them.

  Without specifying unix or the hostname, you will get the fastest
  transport mechanism.  While currently there are only two transport
  methods in the AIXwindows X server (Unix sockets and TCP sockets),
  many vendors are looking at using shared memory as a transport method. 
  If you use :0 (or :0.0 or :1, etc.), then you should get the best
  performance regardless of the available transport methods.

From: Marc Pawliger <marc@sti.com>

  Using "unix:0" or "hostname:0" when the X11 Shared Memory Transport
(SMT) is installed as part of the 1.2.3 X11rte.obj (X11R5) will incur
a penalty vs. using ":0" See /usr/lpp/X11/README.SMT

3.) Is there a significant performance penalty incurred by using
    `hostname`:0 as DISPLAY?

  Yes! Using unix:0, you are using Unix sockets.  These are much faster
  than their TCP socket counterparts.

------------------------------

1.505: VT100 key bindings for aixterm
From: haedener@iac.unibe.ch <Konrad Haedener>

Add this to your .Xdefaults file and start your VAX session with
'aixterm -v -name vt100 -e telnet MYVAXHOST'

-----
vt100.vt102: true
vt100.fullcursor: false
vt100.translations:    <Key>F1: string(0x1b) string("OP") \n\
                       <Key>F2: string(0x1b) string("OQ") \n\
                       <Key>F3: string(0x1b) string("OR") \n\
                       <Key>F4: string(0x1b) string("OS") \n\
                       <Key>KP_0: string(0x1b) string("Op") \n\
                       <Key>KP_1: string(0x1b) string("Oq") \n\
                       <Key>KP_2: string(0x1b) string("Or") \n\
                       <Key>KP_3: string(0x1b) string("Os") \n\
                       <Key>KP_4: string(0x1b) string("Ot") \n\
                       <Key>KP_5: string(0x1b) string("Ou") \n\
                       <Key>KP_6: string(0x1b) string("Ov") \n\
                       <Key>KP_7: string(0x1b) string("Ow") \n\
                       <Key>KP_8: string(0x1b) string("Ox") \n\
                       <Key>KP_9: string(0x1b) string("Oy") \n\
                       <Key>KP_Divide: string(0x1b) string("OQ") \n\
                       <Key>KP_Multiply: string(0x1b) string("OR") \n\
                       <Key>KP_Subtract: string(0x1b) string("OS") \n\
                       <Key>KP_Add: string(0x1b) string("Om") \n\
                       <Key>KP_Enter: string(0x1b) string("OM") \n\
                       <Key>KP_Decimal: string(0x1b) string("On") \n\
                       <Key>Next: string(0x1b) string("Ol") \n\
                       <Key>Left: string(0x1b) string("OD") \n\
                       <Key>Up: string(0x1b) string("OA") \n\
                       <Key>Right: string(0x1b) string("OC") \n\
                       <Key>BackSpace : string(0x7f) \n\
                       <Key>Down: string(0x1b) string("OB")

You should also add

XENVIRONMENT=$HOME/.Xdefaults
export XENVIRONMENT

to your .profile.

------------------------------

1.506: Is there a screen saver that does not use excessive CPU?
From: Don Buchholz <buchholz@ese.ogi.edu>

Try using xlock with these options:

	xlock -mode life -count 1500 -nice 20 -root


From: pranav@evolving.com (Pranav Vakil)

Use mlock -hide to hide the background. You can also modify the mlock
(/usr/local/tools/mlock) code to allow the standard X screen saver to
take effect. The timeout value is originally set to 0 which means the
screen saver is off. Modify this to be 120 (2 minutes) and set the
interval time to be 60 (1 minute). Using these intervals, I have found
that over a 24 hour period, it uses only .3 cpu minutes.

------------------------------

1.507: Where are the colors, available for an X session, listed.

/usr/lpp/x_st_mgr/bin/rgb.txt and on AIX 4.2, the file is
/usr/lpp/X11/lib/X11/rgb.txt

------------------------------

1.508: Why does my app hang the X server but not an X station?
From: Bjorn P. Brox <brox@corena.no>

/usr/lpp/X11/README.SMT X client/server communication uses a 64k
buffer by default.  The size of this buffer is controled by the
X_SHM_SIZE environment variable increasing the size of the buffer has
been used to prevent some applications from hanging the X server :)

------------------------------

1.509: How do I switch the control and caps lock key bindings?

If you are running the X window system, you can put the following into
.xmodmaprc

  remove Lock = Caps_Lock
  remove Control = Control_L
  keysym Control_L = Caps_Lock
  keysym Caps_Lock = Control_L
  add Lock = Caps_Lock
  add Control = Control_L

Hidden Hint: Use (xmodmap -e "pointer = 3 2 1") to make the mouse
lefty friendly.

------------------------------

1.510: Missing fonts?

If your Xserver supports X11R5 try running a font server (edit
/usr/lib/X11/fs/config and run fsconf && startsrc -s fs) Consult your
Xserver instructions on how to include a font server in your font
path.

------------------------------

1.511: What's the termcap entry for an IBM 3151 look like?

#
# Written by Aleksandar Milivojevic, alex@srce.hr
# 24.09.1994
#
I2|ibm3151|3151|IBM 3151 terminal:\
	:am:mi:cr=^M:sf=^J:co#80:li#24:cd=\EJ:ce=\EI:cm=\EY%+\040%+\040:\
	:cl=\EH\EJ:dc=\EQ:dl=\EO:do=\EB:le=\ED:mb=\E4$a:md=\E4(a:\
	:me=\E4@\E>B:mr=\E4!a:nd=\EC:se=\E4>b:so=\E4!a:ue=\E4=b:up=\EA:\
	:us=\E4"a:kb=^H:kd=\EB:kh=\EH:kl=\ED:kr=\EC:ku=\EA:\
	:k1=\Ea\r:k2=\Eb\r:k3=\Ec\r:k4=\Ed\r:k5=\Ee\r:\
	:k6=\Ef\r:k7=\Eg\r:k8=\Eh\r:k9=\Ei\r:k0=\Ej\r:\
	:ti=\E>B:te=\E>B:ms:ho=\EH:bl=^G:al=\EN:ta=^I:

------------------------------

1.512: Errors starting X11 application binaries from aixpdslib.
From: <URL:ftp://aixpdslib.seas.ucla.edu/pub/README_X11R5_Stuff>

We have been aware of the problem people have with dynamic links
when running the prebuilt of X-stuffs from this library.

The typical error messages will be:

    Could not load program [program_name]
    Member shr4.o not found or file not an archive
    Member shr4.o not found or file not an archive
    Could not load library libXt.a[shr4.o]
    Error was: No such file or directory

It's because that we built the programs using X11 libraries of MIT
which are not compatible with those of IBM.  If this is the case,
then please get the compressed tarred file of the source code instead,
and recompile them on your system using your libraries.

------------------------------
1.513: .XShm*, .sm* (Shared memory) Link errors building 
                 Xwindows applications.

Link errors that refer to .XShm* often times are a result of compiling
applications to take advantage of the Shared Memory extension of the X
server.  You may either compile without shared memory or load the
shared memory extensions. (see /usr/lpp/X11/README and README.SMT) A
script for rebuilding your X server with the shared memory can be found
in /usr/lpp/X11/Xamples/server.

------------------------------

1.514: How do I set my DISPLAY when I login to another machine?

Though this is not a question specific to AIX, it appears often enough
to warrant an answer here.  There are lots of approaches, some of which
are described in the X Windows FAQ.  Most involve a little login shell
programing to parse the output of `who` or `who am i`.
<URL:ftp://boogle.uchicago.edu/pub/aix/src/hostwhence.tar.Z> by
e-siebert@uchicago.edu will help if you are willing/able to install it
suid.  See the X Windows FAQ and newsgroup for more information.

Hostwhence is also availabile in the "lsof" smit-installable package on
www-frec.bull.com. The installation scripts use ACLs to allow hostwhence to
read /dev/kmem without being set-uid-root.

------------------------------

1.515:  Why doesn't Netscape work?
From: "Gary R. Hook" <hook@austin.ibm.com>

The problem is that Netscape has statically linked libc into 
Mozilla.  When the AIX 3 libc code (setlocale()) tries to
load an AIX 4 locale, the two are incompatible and a core
dump ensues.  AIX 4 locales have to be loaded by AIX 4 libc.
Using LANG=C causes a lot of locale code to be bypassed, allowing
the application to avoid loading a non-C locale, and to continue
execution.

>From: Colin <apollo@randomc.com>
Here is a shell script that works around Netscape's problems by
setting the LANG and CLASSPATH environment variables.

#!/bin/sh
LANG=C
CLASSPATH=/path/to/java_30
export LANG CLASSPATH
if [ $# -eq 0 ]; then
   /path/to/netscape http://your.home.page &
else
   /path/to/netscape $* &
fi

------------------------------

1.600: My named dies frequently, why?
From: jpe@ee.egr.duke.edu (John P. Eisenmenger)

Running on 3.2, named dies frequently on network's primary name server.


Try the following:

     stopsrc -s named		# stop running named
     setenv MALLOCTYPE 3.1	# use 3.1 memory allocation algorithm
     /etc/named ...		# don't use smit to start named

You might be able to use startsrc/smit after setting MALLOCTYPE and get
the same effect, but I'm not sure.

[According to John, the problem is malloc() in the named code. He
 also suggests using Berkeley's bind, which he has ported and can be
 ftp'ed from ftp://ftp.egr.duke.edu/archives/bind-4.8.3.tar.gz. -ed]

Two ptfs should fix this problem. Get U412332 and U414752.

Christophe Wolfhugel <Christophe.Wolfhugel@grasp.insa-lyon.fr> reports
that bind 4.9 works fine on AIX 3.2 and without MALLOCTYPE=3.1.

------------------------------

1.601: How do I trace ethernet packets on an AIX system?
From: afx@muc.ibm.de (Andreas Siegert)

Do the following:

     iptrace -i en0 /tmp/ipt

The iptrace backgrounds.  Find its process id and kill it when you are
ready.  Then run

     ipreport -rns /tmp/ipt >/tmp/ipr

and look at the output.  The current version of Info does not document
the r, n and s options but they are quite useful for layering the output.

------------------------------

1.602 What is the authorized way of starting automount at boot time?
From: curt@ekhadafi.austin.ibm.com (Curt Finch)

I put this in my /etc/inittab:

automount:2:once:/usr/etc/automount -T -T -T -v >/tmp/au.se 2>&1

I hereby dub it authorized.

Jim Salter <jsalter@netscape.com> writes: You can also use the command:
'mkitab "automount:2:once:/usr/etc/..."' to avoid editing the file by hand.

------------------------------

1.603: How do I set a tty port for both dial-in and dial-out?

Set the mode of the tty to be either 'shared' or 'delayed'. 

------------------------------

1.604: How to move or copy whole directory trees across a network

The following command will move an entire directory tree across a network 
while preserving permissions, uids and gids.

      $rsh RemoteHost "cd TargetDir; tar -cBf - ." | tar -xvBf -

Explanation:

The tar-create is rsh'd to the remote system and is written to
stdout (the pipe).

The local system is extracting the tar that is being read from
stdin (the pipe).

From: abeloni <abeloni@hstern.com.br>

Another method is:

	rcp -rp host1:/dir host2:/dir

------------------------------

1.605: How can I send mail to hosts that cannot be pinged?
From: jupiter.sun.csd.unb.ca!dedourek (John DeDourek)

AIX 3.2 as shipped is configured to only send mail to mail addresses
which include a host name.  Many organizations use a mail address whose
"host name" part is not a host name (technically an MX name).  To change
the configuration of the AIX mailer, login as root.  Then edit the file
/etc/sendmail.cf to remove the comment marker ("# ") at the beginning of
the line which reads:
    # OK MX

Now rebuild the machine readable form of the configuration with
    sendmail -bz

and finally restart signal sendmail to load the new configuration by one
of the following:
     reboot
or
     stopsrc -s sendmail
     startsrc -s sendmail
or 
     kill -1 `cat /etc/sendmail.pid`

Newsgroups: comp.unix.aix,comp.answers,news.answers
From: jum@anubis.han.de
Approved: news-answers-request@mit.edu
Followup-To: comp.unix.aix
Supersedes: <aix-faq-3-886305604@anubis.han.de>
Reply-To: jum@anubis.han.de (Jens-Uwe Mager)
Keywords: AIX RS/6000 questions answers
Sender: jum@baghira.han.de (Jens-Uwe Mager)
Expires: Sun, 5 Apr 1998 05:01:07 GMT
Organization: At Home
Message-ID: <aix-faq-3-888724807@anubis.han.de>
References: <aix-faq-1-888724807@anubis.han.de> 
Date: Sun, 1 Mar 1998 04:00:22 GMT
         and their answers.  AIX is IBM's version of Unix.
Path: news.univie.ac.at!aconews.univie.ac.at!newscore.univie.ac.at!fu-berlin.de!news-ber1.dfn.de!news-lei1.dfn.de!news-nue1.dfn.de!uni-erlangen.de!uniol!news.rz.uni-hildesheim.de!baghira.han.de!jum
Lines: 1621
Xref: news.univie.ac.at comp.unix.aix:125559 comp.answers:29710 news.answers:39488

Posted-By: auto-faq 3.3 (Perl 4.035)
Archive-name: aix-faq/part3
Posting-Frequency: monthly


------------------------------

1.606: How to configure dialup SLIP

IBM's WWW page <http://www.ibm.com/> can lead you to a helpful document
<http://www.austin.ibm.com/pub/www/services/aix_service/faxes/SLIP.DOC.zap>

From: marvin@tornado.oche.de (Christian Bode)

If you don't have problems with slattach you should have PTF 
bos.obj 3.2.0.0.U411505 installed.  I assume that you did the right
ifconfig commands to setup your slip-device (for example sl0).

1. Create a group called slip.

2. Create a user slip with smit like this:
                                                     [Entry Fields]
* User NAME                                          [slip]
  ADMINISTRATIVE User?                                true
  User ID                                            []
  LOGIN user?                                         true
  PRIMARY group                                      [slip]
  Group SET                                          [slip]
  ADMINISTRATIVE groups                              [system]
  SU groups                                          [slip]
  HOME directory                                     [/home/slip]
  Initial PROGRAM                                    [/bin/sh]
  User INFORMATION                                   [SLIP-Dialup]
  Another user can SU to user?                        false
  User can RLOGIN?                                    true
  TRUSTED PATH?                                       nosak
  Valid TTYs                                         [/dev/tty1]
  AUDIT classes                                      []
  PRIMARY authentication method                      [SYSTEM]
  SECONDARY authentication method                    [NONE]
  Max FILE size                                      [2097151]
  Max CPU time                                       [-1]
  Max DATA segment                                   [262144]
  Max STACK size                                     [65536]
  Max CORE file size                                 [2048]
  Max physical MEMORY                                [65536]
  File creation UMASK                                [022]
  EXPIRATION date (MMDDhhmmyy)                       [0]

3. Create a tty with getty on it:
                                   Add a TTY
                                               [Entry Fields]
  TTY type                                     tty
  TTY interface                                rs232
  Description                                  Asynchronous Terminal
  Parent adapter                               sa0
* PORT number                                  [s1]
  BAUD rate                                    [38400]
  PARITY                                       [none]
  BITS per character                           [8]
  Number of STOP BITS                          [1]
  TERMINAL type                                [dumb]
  STATE to be configured at boot time          [available]
  DMA                                          on
  Read Trigger                                 0,1,2,3
  Transmit buffer count                        [16]
  Name of initial program to run               [/etc/getty]

  Note: The following attributes are only applicable if /etc/getty is
        specified as the initial program to run.

  Enable program?                              respawn
  Run level                                    2
  Enable LOGIN                                 share
  TIME before advancing to next port setting   [0]
  STTY attributes for RUN TIME                 [hupcl,cread,brkint>
  STTY attributes for LOGIN                    [hupcl,cread,echoe,>
  RUN shell activity manager                   no
  Optional LOGGER name                         []

4. Change the hardware characteristics so that it uses NO XON/XOFF handshake
   section 1.613 also talks about tty flow control.

5. A (new) .profile template for slip accounts is provided in section
   8.07.  The author, David Migliavacca, writes, "I would also like to
   assert that, to my experience, it is NOT required that the SLIP user
   be made "administrative" or member of "system" as other parts of the
   FAQ (and the original script) say.  At least on my machine 8-).  I now
   create SLIP users as members of group slip, it being the ONLY group;
   allowed ttys are set to the available modem lines only; their home
   directory is owned by root and the .profile is only readable by group
   slip.

Here's another scenario:
From: oosten@angelo.ee.ualberta.ca (Brian Oostenbrink)

Operating System: IBM AIX 3.2.1 and 3.2.3

Configuring two RS6000s via a Serial Line Interface Protocol (SLIP) 
connection over two US Robotics Sportster 14,400 modems.

The AIX implementation of SLIP is slightly different from most others. 
The ifconfig command is used to bring up a serial interface, and the
slattach command is used to connect the interface to the serial port
used for the connection.  Dialer device commands can also be issued when
invoking the slattach command, using UUCP chat syntax.

The following describes a connection between two machines:

     local.j.k.l
         ethernet IP address 129.128.127.21
         slip interface IP address 129.1.2.1

     remote.a.b.c
         ethernet IP address 129.11.22.44
         slip interface address 129.11.22.1

1. Interface configuration

Each machine must have a separate IP address dedicated to the SLIP
interface. On remote.j.k.l, start the SLIP interface with:

         ifconfig sl0 129.11.22.1 129.128.127.1  up

and on local.a.b.c:

         ifconfig sl0 129.128.127.1 129.11.22.1  up

It is important in later versions of AIX 3.2.3+ to use the same SLIP
interface # as the ptty port #, ie. if you use tty12, use ifconfig sl12
instead of sl0.

At this point the interfaces are ready to be connected.

2. tty configuration
   The tty ports on both machines were configured in an identical manner
   using smit.
                                                 [Entry Fields]
 TTY type                                           tty
 TTY interface                                      rs232
 Description                                        Asynchronous Terminal
 Parent adapter                                     sa0
 PORT number                                        []                       +
 BAUD rate                                          [38400]                  +
 PARITY                                             [none]                   +
 BITS per character                                 [8]                      +
 Number of STOP BITS                                [1]                      +
 TERMINAL type                                      [dumb]
 STATE to be configured at boot time                [available]              +
 DMA                                                on                       +
 Read Trigger                                       0,1,2,3
 Transmit buffer count                              [16]                      #
 Name of initial program to run                     [etc/getty]

 Note: The following attributes are only applicable if /etc/getty is specified
 as the initial program to run.

 Enable program?                                    respawn
 Run level                                          2
 Enable LOGIN                                       disable                  +
 TIME before advancing to next port setting         [0]                      +#
 STTY attributes for RUN TIME                       [hupcl,cread,brkint,icr>
 STTY attributes for LOGIN                          [hupcl,cread,echoe,cs8,>
 RUN shell activity manager                         no                       +
 Optional LOGGER name                               []

On older versions of AIX, we encountered some problems disabling getty, and
resorted to changing the /etc/inittab file directly. For example, change

   tty0:2:respawn:/etc/getty /dev/tty0
to
   tty0:2:off:/etc/getty /dev/tty0

This will disable getty from running. After creating the SLIP tty device,
you will need to change its hardware configuration to disable Xon/Xoff
flow control. Software flow control should not be used for SLIP. Type
'smit chtty', and then select sub item 2: Hardware settings.

Most of the parameters in the tty configuration are the defaults.

3. Modem Configuration

   The modems were configured as follows:

   RTS/CTS flow control enabled.
   Xon/Xoff software flow control disabled. Usually this is automatic if
      RTS/CTS is enabled.
   Data rate, terminal to modem = fixed.
      This is the baud rate from the tty port to the modem. We used a
      fixed modem-port transfer rate, set to the fastest speed supported
      by both the tty port and the modem. Newer modems can use a higher
      transfer rate between the modem and serial port than the modem to
      modem rate, which is necessary to use data compression effectively.  
      In our setup, we used 14.4 kBaud modems with a port speed of 38.4
      kBaud. If your modem supports this feature, use it, otherwise set
      the port speed equal to the modem connection rate. On the USR
      Sportster at&b1 fixes the serial port rate to that of the last
      AT command. The speed parameter of the slattach command can be
      used to ensure that this rate is that set in the tty configuration.
   Error Correction enabled - not mandatory, but a good idea
   Data Compression - not required, but it helps, especially for text
      transfers.
   Auto Answer - If the SLIP connection is to be initiated from either
      machine, both modems should be set to auto answer, otherwise, just
      the answering modem.

   It is a good idea to configure the modem and then save the settings
   to NVRAM, so that the correct settings can always be restored by the
   slattach command.

4. UUCP configuration files

   /usr/lib/uucp/Devices
   /usr/lib/uucp/Dialers

   The Devices file must contain an entry with the tty and serial port
   speed used for the interface. In our example,
      Direct tty0 38400 slipdialer

   The keyword 'slipdialer' is merely an index into the Dialers file.
   For our purposes, the slipdialer entry in the Dialers file is simply:

      slipdialer

   This entry can also contain UUCP chat commands, or the chat commands
   can be included in the slattach command.

5. slattach invocation

   slattach connects the device on the tty port to the SLIP interface
   created by ifconfig, and sends any commands to the tty device if
   needed. For our example, remote.j.k.l would never initiate a call,
   only answer incoming calls. Therefore we execute:

         slattach tty0 38400 '"" ATZ OK ""'

   which connects the tty at 38400 baud. We could also simply run

         slattach tty0

   ie. without any modem commands, but the modem to port speed may not
   be correctly set this way. In addition, the ATZ command ensures the
   modem is set to the NVRAM settings.

   On local.a.b.c type:

         slattach tty0 38400 '"" ATZ OK \pATDT4925871 BIS ""' 4

   This establishes the link at 38400 baud, and executes the dial string
   as shown. The dial string is a UUCP chat string and are configured
   in an expect send expect send ... format. The string:

         '"" ATZ OK \pATDT4925871 BIS ""'

   is interpreted as:
   expect "" (null string) from modem
   send   ATZ              to modem
   expect OK               from modem
   send   \pATDT4925871    to modem
   expect BIS              from modem

   BIS is the end of the CONNECT STRING. You could use any portion of
   the string returned by the modem upon a connection as the expect
   string. It may be wiser to simply expect CONNECT since all
   connections should return this string.
   The null strings are necessary because the first parameter of the
   UUCP is an expected string from the modem, which can only be a null
   string until the modem has been given a command.

   The last parameter (4) of the slattach command is the debug level. 
   A debug level of 4 displays the UUCP chat strings, which is useful
   for checking the modem status.

6. Routing
   ifconfig is sufficient if all you want to do is talk between the
   two hosts.  If you are running SLIP so that you can talk to more
   than just that one other host you have to advertise your address.
   
   1) arp -s 802.5 iago 10:00:5a:b1:49:d8 pub
        where 802.5 is a token-ring network the hardware address can
        be obtained with `netstat -v` and iago was the SLIP client (My
        PC at home :)  pub is the important part it means "published"
        You may want to run this at boot time. 

   Routing through the SLIP link is similiar to routing of any gateway. 
   Invoking the ifconfig command automatically sets up a route between
   the two SLIP machines. An entry in /etc/hosts or the named database
   should be made, with the same machine name used for the SLIP address
   as the ethernet address on each machine. For example, in /etc/hosts
   on remote.a.b.c (and any other machine on remote.a.b.c ethernet):

     129.11.22.44 remote.a.b.c # ethernet address
     129.11.22.1  remote.a.b.c # slip address

   It is preferable to place the ethernet address in the hosts file
   before the SLIP address so remote.a.b.c will resolve to the
   ethernet address. When using named, it is important to have both
   addresses in the reverse file with the same name. We experienced
   difficulties with NFS mounting over the slip link, owing to some
   machine interpreting NFS requests from one of the two SLIP machines
   as coming from the SLIP address, while the SLIP machine believed it
   was sending the request from the ethernet address. This problem was
   eliminated by having both addresses reverse resolve to the same name.

7. Performance
   At a modem speed of 14.4 kBaud and a port speed of 38.4 kBaud, we
   realized a transfer rate through ftp of about 3.5 kB/s for text
   files, and 1.3 kB/s for compressed files.

------------------------------

1.607: Where is DCE discussed?

DCE is the Distributed Computing Environment, which is roughly a
flexible client-server architecture for heterogenous platforms.
For more information, take a look in comp.soft-sys.dce.


------------------------------

1.608: How do I make /var/spool/mail mountable?
From: petersen@pi1.physik.uni-stuttgart.de (Joerg Petersen)

In our cluster we share a /usr/local disk. We have a directory
/usr/local/spool/mail and /var/spool/mail is soft-linked to it.

From: fred@hal6000.thp.Uni-Duisburg.DE (Fred Hucht)

Several problems has been reported on sharing the mail directory via
NFS. The problems may occur when two or more sendmail daemons and/or
mail readers access a user's mail file simultanously, because of NFS'
file locking mechanism.

We use another method here: Every user has one line in his/her
$HOME/.forward file that reads

xxx@mainserver.domain.name

where xxx is the user node and mainserver.domain.name is the full
hostname of one of the machines. Then all incoming mail to all machines
is forwarded to mainserver, while mainserver ignores this line.


1.609: getty spawning too rapidly 
From: aslam@abaseen.lums.edu.pk (Sohail Aslam)

The problem can occur due a number of modem settings. The most
frequent is that the echo is not disabled on modems that are to
accept incoming calls. In hayes language, ATE0 disables echo.
If echo is enabled, the login prompt sent by the DTE (computer)
is echoed back to it. It then issues "password:" prompt which
the modem conveniently echoes back again. And the cycle goes on.

Another setting to check is the Q registers which controls the
modem's response to the DTE. The hayes command ATQ0 enables
results codes. The Q register in conjunction with the X and
the V registers, reports back to the DTE the status of the incoming
or outgoing call, and the type of connection established. For
outgoing calls, one would want to enable result codes but not
for incoming calls. If codes are enabled (via ATQ0), when a
call comes in, the modem will send strings (if ATV1 and ATX4 set)
"RINGING", "CONNECTED" etc. to the local DTE. The getty will think
some one is trying to login. It will send password prompt. Trouble
again. Telebit and other intelligent modems has ATQ2 setting
which says "reports codes only when calling out." For others,
you will need to disable it (ATQ1) and enable when calling out.

The DSR setting can be a source of problem. Ideally, modem should
raise DSR only when CD is detected and modem raises CTS. Computer,
such as the VAX, wait 30 seconds after the modem raises DSR. If
CD is not on by that time, the computer will drop DTR causing the
modem to reset. The DSR should be set to be raised only when
carrier has been detected. The hayes setting is AT&S1.

The DCD setting should be such that it reflects the true nature of
the carrier. The CD can be forced on at all times (AT&C0). This
is not good. Set it to AT&C1.

Most modems can reload saved settings from non-volatile memory
on a DTR transition. This is useful for resetting the modem
when a call drops. Use AT&D3 to get this effect. 

For dial in, thus, set AT E0 Q1 &C1 &D3 &S1 &W. The &W stores the
settings in memory. They will be reloaded due to &D3.


------------------------------

1.610: Does AIX support Compressed SLIP (CSLIP)?

No.  That means no VJ compression either :)  See PPP in section 5.07 
if you want more than standard SLIP.


------------------------------
1.611: How do I setup anonymous ftp on my AIX system?

(stolen from Peter Klee <klee@dhdibm1.bitnet> posting)

Have a look at '/usr/lpp/tcpip/samples/anon.ftp'. It is a shell script
and will set up a anonymous ftp site on your local RS/6000.  Note: the
ftpd that comes with AIX does not support the display messages every
time a user changes a directory or even when they login.

------------------------------

1.612: Talk, getting notification.

If you are not getting notification (that someone wants to talk to
you), use (swcons `tty` && mesg y) in one window.

There are many variations of 'talk' and finding compatible versions
for multiple operating systems can be tricky.


------------------------------

1.613: Disabling software flow control; using RTS/CTS.

Different versions of AIX 3.2.5 respond differently to attempts to
enable flow control (RTS/CTS signals).  This section is an attempt to
compile a list of different approaches.

The most straight forward is:
   chdev -l ttyxx -a rts=yes
   [ Note: ix40410 for AIX 3.2.5 should give you this functionality.  
   PTF U426113 and numerous other superceding ptfs should provide this.]

If carrier signal is high (its connected) you can try
   stty add rts </dev/ttyxx 

There is also a program that I first saw on the 800-IBM-4FAX number,
also found in INFO that will remedy the situation in some cases.  Note
that this code ignores the return code from ioctl (which on my machine
is <0 :)

------------------------------

1.614: NIS security
Ole.H.Nielsen@fysik.dtu.dk (Ole Holm Nielsen)

SUMMARY: AIX 3.2.4 and above includes support for a more secure setup
of the ypserv NIS daemon.  You can prevent any random host on the
entire Internet from reading your NIS maps, as is possible with the
default AIX setup.
 
The details:
------------
After starting the ypserv daemon, I noticed in the syslog the following line:
Jan 17 12:01:18 zeise syslog: /usr/etc/ypserv: no /var/yp/securenets file 
This indicates that ypserv is looking for the mentioned configuration
file, but did not find it, and hence will deliver the NIS maps to
anyone on the net who can guess the NIS domainname.  I installed the
/var/yp/securenets file and restarted ypserv, and it works !  Any
illegal attempt to read NIS maps will result in the following getting
logged to syslog (example):
Jan 18 13:37:27 zeise syslog: ypserv: access denied for 129.142.6.79 

How to enable this NIS security option:  
Install the /var/yp/securenets file, for example:

# /var/yp/securenets file
#
# The format of this file is one of more lines of
# netmask netaddr
# Both netmask and netaddr must be dotted quads.
#
# Note that for a machine with two Ethernet interfaces (i.e. a gateway
# machine), the IP addresses of both have to be in /var/yp/securenets.
#
# for example:
#255.255.255.0 128.185.124.00
# Loopback interface
255.255.255.255 127.0.0.1

Uncommenting the last line would limit access to hosts on the
128.185.124.*  net, only.  The loopback interface must be included, as
shown above.

To log violations, have a /etc/syslog.conf file containing the proper
events.  We use this line:

*.err;kern.debug;auth.notice;user.none          /var/adm/messages

Caveat emptor:  This works for us, and you will have to verify it at
your own installation.  Don't complain to us if you have troubles.  
I do not know what PTF level our AIX 3.2.4 is at.  Our ypserv daemon 
looks like this:

zeise> strings /usr/lib/netsvc/yp/ypserv | head -2
@(#)16
1.12  com/cmd/usr.etc/yp/ypserv.c, cmdnfs, nfs325, 9334325a 5/4/93 19:44:41

If your AIX doesn't have securenets support, ask your support centre
for the PTF which includes APAR IX32328.  That seems to have included
the securenets support.


------------------------------

1.615: Why can't non-anonymous users login using WU-FTP?
From: swcxt@boco.co.gov (Shane Castle)

You must create a file named /etc/shells (this is the real /etc not a
subdirectory of your false root), that contains all the shells that
are defined on your system.  Get the list from
/etc/security/login.cfg.  Also, if having proper group authentication
is important to you, apply the following patch:

--- ftpd.c.dist	Wed Apr 13 15:17:18 1994
+++ ftpd.c	Tue Jan 17 13:29:58 1995
@@ -1153,7 +1153,13 @@
        setgroups(NULL, NULL);
        if (setpriv(PRIV_SET|PRIV_INHERITED|PRIV_EFFECTIVE|PRIV_BEQUEATH,
                    &priv, sizeof(priv_t)) < 0 ||
-           setuidx(ID_REAL|ID_EFFECTIVE, (uid_t)pw->pw_uid) < 0 ||
+           initgroups(pw->pw_name, (gid_t)pw->pw_gid) < 0 ||
+           setgidx(ID_REAL|ID_EFFECTIVE, (gid_t)pw->pw_gid) < 0 ||
+           setegid((gid_t)pw->pw_gid) < 0) {
+               reply(550, "Can't set gid (AIX3).");
+               goto bad;
+       }
+       if (setuidx(ID_REAL|ID_EFFECTIVE, (uid_t)pw->pw_uid) < 0 ||
            seteuid((uid_t)pw->pw_uid) < 0) {
                reply(550, "Can't set uid (AIX3).");
                goto bad;

------------------------------

1.616: NIS users can't login, do I need '*' in /etc/passwd?
From: ohnielse@fysik.dtu.dk (Ole Holm Nielsen)

Aparently at least one version of AIX InfoExplorer suggests
administrators use "+:*:0:0:::" as the last entry in the /etc/passwd
file of NIS clients for security reasons.  If the configuration SMIT
is done using SMIT it will actually append "+::0:0:::" which works and
does not compromise security.  Using the '*' in the passwd field
actaully prevents NIS users from logging in.

"+::0:0:::" should not allow you to login as user "+" and without a
password even when NIS is disabled, but it never hurts to double
check.

------------------------------
1.617: HP JetDirect cards and virtual printers?  mkvirprt problems?

(stolen from many)

Since the release of AIX 3.2.5 adding a queue for JetDirect cards is as
easy as creating a virtual printer using "smit mkvirprt" or mkvirprt.
If the command hangs make sure you are using an HFT, aixterm or vt100
terminal.  The entire procedure is available from the IBM FAX
"Information Line" (800 IBM-4-FAX).

From: Mark Bergman <mark.bergman@syseca.co.uk>

SMIT complains that some required software is not present on the system.
It turns out that this software, "printers.hpJetDirect.attach (4.1.3.0)"
is on the installation CD.

HOWEVER, there is some bug somewhere, whereby the software may actually
be already installed, but the system cannot see it.  (Or maybe the bug
is that the software is actually NOT installed, but the system in one
place thinks it is! - I'm not sure).  Therefore, use smit to look at
Installed Software ("Software Installation and Maintenance", "Maintain
Installed Software", "List Installed Software" and look at all software,
then search through for "jet".  If it finds it (i.e. it thinks that it
is installed) - you must remove it (under smit's "Maintain Installed
Software" level), and then reinstall from the CD!

------------------------------

1.618: How can I hack libc.a to alter how hostnames are resolved?
From: <mlarsen@ptdcs2.intel.com> "L. Mark Larsen"

[ 
  Editors note:  The implications of corrupting libc.a should not be
  understated.  While recovering from a corrupt libc.a should be a
  matter of booting from floppy I wouldn't wish that on anyone with a 
  supervisor or users to support :)

  Before you attempt this,  you might want to read 2.07 first for
  advice on recovering from a destroyed or corrupted libc.a.
  Remember:  backups are a VERY GOOD IDEA.

  enough of the weak kneed quivering...
]

Nate Itkin (a colleague) is the individual who did the initial work.
I suspect he would rather not be troubled with any questions you may
have in this area and I can probably answer them just as easily.  The
motivation for this was to use DNS for MX records (we are using IDA
sendmail) but NIS for most hostname lookups.

Secondly, warnings:  IBM has not given any sort of stamp of approval on what
we have done (though they appear to have integrated resolv+ into AIX 4 based
on some release notes I saw).  While we have been using it successfully for
about one year and have seen no problems, we can't and won't promise the same
for you.  This procedure plays around with libc.a which, as you probably know,
is an XCOFF shared library under AIX and hence a critical part of the running
system.  You assume all the risk if you try to install this.  All the usual
disclaimers about liability, etc. apply - there is no warranty associated with
any of this.

Furthermore, know that any PTF you subsequently install that updates/replaces
libc.a implies that you have to execute most of these procedures again.

The details on how to use resolv+ under AIX 3 (it's only tested under
3.2.5 but should work for all point releases), have been moved to
section 8.09.

------------------------------

1.619: What modem settings do I need?

ATQ2  - result codes in originate only
AT&C1 - CD follows state of carrier 
AT&D2 - hangup on DTR drop


------------------------------
1.620: NIS slave server config with master on different subnet?
From: msidler@metronet.com (Mike Sidler)

Assuming AIX 3.2.5,the master server up and running and the hosts file
has the master name defined. On slave do:

    1) domainname <domain_name that matches master>
    2) startsrv -s ypserv
    3) startsrv -s ypbind (ypwhich should return "loopback")
    4) (/usr/sbin/)ypset -d <domainname> <master_server_name>
       (ypwhich should return "<master_server_name>"
    5) (/usr/sbin/)ypinit -s <master_server_name>
    6) Put "+::0:0:::" in /etc/passwd after last local login. 
       Note: InfoExplorer has this entry INCORRECT in some versions.
    7) Other cfg files (group, etc) may need configuring but this will
       get ypserv and ypbind running on the slave looking at the right stuff.


------------------------------

1.621: Why does my 64 port concentrator loose data and drop the queue?
[From: as@mynet.no (Arild Sletvold)]

This problem has been associated with upgrading machines to 3.2.5.
Try changing the values for the "Transmit buffer count" parameter in
the printer/plotter setup in smit. You need to experiment with this
parameter, to see which value that makes the printer print as fast as
possible.  If the value is too high, the printers will loose some of
the data, and the queue will be disabled.  If the value is too low,
the printers will print very slowly.

------------------------------

1.622: Netscape FastTrack server won't install on AIX 3.2.5 or 4.1.
From: Cameron Ferstat <cferstat@austin.ibm.com>

Before installing FastTrack on an AIX 3.2.5 or 4.1 system, you must 
first install the AIX Shared Library Hookable Symbols/6000 Version 
1.1.5.0, Reference RPQ No. P91153.  (Note:  This software should *not*
be installed on an AIX 4.2 system!)

If you try to install FastTrack on an AIX 3.2.5 or 4.1 system, without 
first installing the Hookable Symbols PRPQ, you will get the following 
error:

   > ./ns-setup
     0509-037 System error - error data is: ./ns-setup
     0509-022 Cannot load library libsvld.a[shr.o].
     0509-026 System error: A file or directory in the path name does not exist.

You can download the installp image by anonymous ftp from
<ftp://ftp.software.ibm.com/aix/products/netscape/tools/slhs.rte.inst_image>.

There is also an associated README.slhs file in that directory.

------------------------------

1.623: How can I share files/printers with Windows 95?

The freeware solution is Samba,  available from <http://www-frec.bull.com/>.

Commercial solutions include Fusion95 from Performance Technology
<http://www.perftech.com/> and Syntax <http://www.syntax.com/>.

------------------------------

1.700: Free LVM lecture slides.
From: shieh@austin.ibm.com

If you want free LVM documentation (lecture notes) from the
SHARE conference in San Franciso where I presented last March
just:
 
 mail -s "S_basics.ps" shieh@austin.ibm.com < /dev/null
 mail -s "S_limits.ps" shieh@austin.ibm.com < /dev/null
 mail -s "S_lvm_extra.ps" shieh@austin.ibm.com < /dev/null

[Editor's note: Jens-Uwe Mager converted the slides to PDF format.  They
are available as <ftp://anubis.han.de/pub/aix/lvm.pdf>.]

------------------------------

1.701: How do I shrink /usr?
From: mike@bria.UUCP (Michael Stefanik) and Richard Hasting

FOR AIX 3.1
-----------

 1) Make a backup of /usr

        find /usr -print | backup -ivf /dev/rmt0 (or appropriate device)

 2) shutdown to maintenance mode

        shutdown -Fm
 
 3) export LANG=C
 
 4) remove the filesystem and the logical volume
    ignore an error about the "dspmsg" command not found

        umount /usr
        rmfs /usr

 5) make a new logical volume hd2 and place it on rootvg with desired size

        mklv -yhd2 -a'e' rootvg NNN 

   where NNN is the number of 4 meg partitions

 6) create a filesystem on /dev/hd2

        crfs -vjfs -dhd2 -m'/usr' -Ayes -p'rw'

 7) mount the new /usr filesystem and check it

        /etc/mount /usr
        df -v

 8) restore from the tape; system won't reboot otherwise

        restore -xvf/dev/rmt0

 9) Sync and reboot the system; you now have a smaller /usr filesystem

FOR AIX 3.2
-----------

 0)  Experiences posted to comp.unix.aix lead me to suggest that
     many administrators find the following piece of information 
     useful after completing this procedure.  I thought some of you
     might like to read it BEFORE getting yourself into this
     predicament.  

     Call 1-800-IBM-4FAX and request document 2503 dated 1/26/94.  
     Title is "How to recover if all files are owned by root after
     restoration from a mksysb tape".

 1) Remove any unneeded files from /usr.

 2) Make sure all filesystems in the root volume group are mounted. If
    not, they will not be included in the re-installed system.

 3) Type mkszfile. This will create /.fs.size that contains a list of
    the active filesystems in the root volume group that will be
    included in the installation procedure.

 4) Edit .fs.size. Change the size of /usr to what you want.

    Example: This .fs.size file shows /usr to be 40MB.

	rootvg 4 hd2 /usr 10 40 jfs

    The 10 is the number of physical partitions for the filesystem and
    the 40 is 40 MB. Most systems have a physical partition size of 4 MB.
    Therefore, the second number (40) will always be 4 times the
    previous number (10). Note, however, that a model 320 with a 120 MB
    drive will have a physical partition size of only 2 MB, and the
    total MB is twice the number of physical partitions. The first
    number (4) in the .fs.size file represents the PP size.

    If you want to reduce the size of /usr from 40 MB to 32 MB, edit the
    /usr entry to:

        rootvg 4 hd2 /usr 8 32 jfs

    IMPORTANT: Make sure that you DO NOT enter a value which is less
    than the size of the filesystem required to contain the current
    data. Doing so will cause the re-installation procedure to fail.

 5) chdev -l rmt0 -a block=512 -T

 6) Unmount all filesystems that are NOT in the root volume group.
 
 7) Varyoff all user-defined volume groups, if any

        varyoffvg VGname

 8) Export the user-defined volume groups, if any

        exportvg VGname

 9) With a tape in the tape drive, type

        mksysb /dev/rmt0

     This will do a complete system backup, which will include
     information (in the .fs.size file) for the installation procedure
     on how large the filesystems are to be created.

 10) Follow the instructions in the Installation Kit under "How to
     Install and perform maintenance from Diskettes" (reportedly now 
     called "BOS Installation from a System Backup") using the
     diskettes and tape that you created in the previous steps.

     [ pre AIX 325: DO NOT select the option "Reinstall AIX with
     Current System Settings". Instead use "Install AIX with Current
     System Settings" for the logical volume size changes to take affect. ]

     [ w/ AIX 325: Select "Install from a mksysb image" ]

 11) When the installation is complete, you may then import any
     user-defined volume groups.

         importvg -y VGname PVname

     where "VGname" is the name of the volume group, and "PVname" is
     the name of any one of the physical volumes in the volume group.

 12) Varyon your user-defined volume groups

         varyonvg VGname

 The reduction of the filesystems is now complete.

COMMERCIAL OPTION
-----------------
There are also commercial tools availible to help you do this more
conviently.  I know of one vendor that can be reached at info@compunix.com

------------------------------

1.702: How do I make a filesystem larger than 2Gb?

AIX 3.2.5 and preceeding versions are limited to 2 Gigabytes per
filesystem.

With AIX 4.1 IBM allows filesystems up to 64Gb (reference:
Individual files are still limited to 2Gb.  AIX 4.2 allows 128Gb
filesystems and 64 Gb files.  (See also question 1.706.)

If you are having trouble creating a file greater than 1Mb it maybe
because that is the default limit for your account, see 'smit users'
or /etc/security/limit.

------------------------------

1.703: Chlv warning.  Is the first 4k of a LV safe?

The first 4k of a raw LV are used to store control block.
Applications that write to the raw disk can overwrite this section
(common applications that do this are Oracle and Sybase).  Commands
that call getlvcb will generate a warning but succeed (since the
control block exists in ODM.  Don't run synclvodm unless you really
want to erase the first 4k and replace it with the info from the ODM.

shieh@austin.ibm.com (Johnny Shieh) has kindly provided the following
explanation:

The logical volume control block (lvcb) is the first 512
bytes of a logical volume.  This area holds important
information such as the creation date of the logical volume,
information about mirrored copies, and possible mount points
in a journaled filesystem.  Certain LVM commands are required
to update the lvcb, as part of completeness algorithms in
LVM.  The old lvcb area is first read and analyzed to see if
it is a valid lvcb.  If the information is verified as valid
lvcb information, then the lvcb is updated.  If the
information is not valid, then the lvcb update is not
performed and the user is given the warning message:

	Warning, cannot write lv control block data

Most of the time, this is a result of database programs
accessing the raw logical volumes (and thus bypassing the
journaled filesystem) as storage media.  When this occurs, the
information for the database is literally written over the lvcb.
Although this may seem fatal, it is not the case.  Once the
lvcb has been overwritten, the user can still:

	1) Extend a logical volume
	2) Create mirrored copies of a logical volume
	3) Remove the logical volume
	4) Create a journaled filesystem with which to mount
		the logical volume (note that this will destroy any
		data sitting in the lvcb area)

However, there is a limitation caused by this deletion of the
lvcb.  The logical volumes with deleted lvcb's face possible,
incomplete importation into other AIX systems.  During an
"importvg", the LVM command will scan the lvcb's of all defined
logical volumes in a volume group for information concerning the
logical volumes.  Surprisingly, if the lvcb is deleted, the
imported volume group will still define the logical volume to
the new AIX system which is accessing this volume group, and
the user can still access the raw logical volume.  However, any
journaled filesystem information is lost and the logical volume
and its associated mount point won't be imported into the new AIX
system.  The user must create new mount points and the availability
of previous data stored in the filesystem is NOT assured.  Also, during
this import of a logical volume with an erased LVCB, some non-jfs
information concerning the logical volume, which is displayed with
the "lslv" command, cannot be found.  When this occurs, the system uses
default logical volume information to populate the logical volume's
ODM information.  Thus, some output from the "lslv" will be inconsistent
with the real logical volume.  If logical volume copies still exist on
the original disks, this information will not be correctly reflected in
the ODM database.  The user should use "rmlvcopy" and "mklvcopy" to
rebuild any logical volume copies and synchronize the ODM.  Finally,
with an erased lvcb, the output from the "lslv" command might be
misleading or unreliable.


------------------------------

1.704: What's the limit on Physical Partitions Per Volume Group?
From: shieh@austin.ibm.com (Johnny Shieh)

1016 Physical Partitions Per Disk in a Volume Group:

     In the design of LVM, each Logical Partition
maps to one Physical Partition.  And, each Physical
Partition maps to a number of disk sectors.  The design
of LVM limits the number of Physical Partitions that LVM
can track PER DISK in a volume group to 1016.  In most cases,
not all the possible 1016 tracking partitions are used by a disk.
The default size of each Physical Partition during a
"mkvg" command is 4 MB, which implies that individual
disks up to 4 GB can be included into a volume group.

     If a disk larger than 4 GB is added to a volume
group (based on usage of the default 4 MB size for
Physical Partition) the disk addition will fail with a
warning message that the Physical Partition size needs
to be increased.*  There are two instances where this
limitation will be enforced.  The first case is when the
user tries to use "mkvg" to create a volume group where
the number of physical partitions on one of the disks in
the volume group would exceed 1016.  In this case, the
user must pick from the available Physical Partition ranges of:

1, 2, (4), 8, 16, 32, 64, 128, 256

Megabytes and use the "-s" option to "mkvg".  The second
case is where the disk which violates the 1016 limitation
is attempting to join a pre-existing volume group with
the "extendvg" command.  The user can either recreate the
volume group with a larger Physical Partition size (which
will allow the new disk to work with the 1016 limitation)
or the user can create a standalone volume group (consisting
of a larger Physical Partition size) for the new disk.

     In AIX 4.1 and 3.2.5, if the install code detects
that the rootvg drive is larger than 4 GB, it will change
the "mkvg -s" value until the entire disk capacity can be
mapped to the available 1016 tracks.**  This install change
also implies that all other disks added to rootvg, regardless
of size, will also be defined at that new Physical Partitions size.

For RAID systems, the /dev/hdiskX name used by LVM in AIX may
really consist of many non-4GB disks.  In this case, the 1016
limitation still exists.  LVM is unaware of the size of the
individual disks that may really make up /dev/hdiskX.  LVM bases
the 1016 limitation on the AIX recognized size of /dev/hdiskX,
and not the real independent physical disks that make up /dev/hdiskX.

The questions asked of this issue are:
1) What are the symptoms of this problem?
2) How safe is my data?  What if I never use mirroring or migratepv?
3) Can I move this volume group between RS/6000 systems and versions
   of AIX?

Here are the answers:
A) What are the symptoms of this problem?
     The 1016 VGSA is used to track the "staleness of mirrors".
     If you are in violation of 1016, you may possibly get a false
     report of a non-mirrored logical volume being "stale" (which
     is an oxymoron) or you may get a false indication that one of
     the your mirror copies has gone stale.  Next, migratepv may
     fail because migratepv briefly uses mirroring to move a logical
     volume from one disk to another.  If the target logical
     partition is incorrectly considered "stale", then the migratepv
     cannot remove the source logical partition and the migratepv
     command will fail in the middle of migration.

B) How safe is my data?  What if I never use mirroring or migratepv?
     The data is as safe (in your mind) as the day before you found
     out about 1016 violations.  The only case where data may be
     lost is if one is mirroring a logical volume and ALL copies go
     bad at the same time and LVM isn't aware of it because the
     copies that go bad are beyond the 1016 tracking range.  However,
     in this case, you would lose data even if you were within the
     1016 range.  If you never mirror or use migratepv, then this
     issue shouldn't concern you.  But, it might be unwise to state
     you'll NEVER use either of those options.

C) Can I move this volume group between RS/6000 systems and versions
   of AIX?
     Yes you can.  The enforcement of this 1016 limit is only
     during mkvg and extendvg.  The "safeness" of the data on the
     volume group on AIX 3.2 is the same as it is on AIX 4.1.


* This bug was fixed in apar ix48926.  Current AIX 3.2.5 and
4.1.1, which do not have this fix on applied, will allow the
creation of volume groups with more than 1016 partitions.  The
implication of this bug allowing more than 1016 physical
partitions is that the user may access all portions of the logical
volume.  However during disk mirroring, the status of partitions
beyond the 1016 limit will not be tracked correctly.  If mirrors
beyond the 1016 range become "stale", LVM will not be aware of
their condition and data consistency may become an issue for
those partitions.  Additionally, the "migratepv" command creates
mirrors and deletes them as a method for moving logical volumes
around within/between disks.  If the 1016 limit is violated,
then the "migratepv" command may not behave correctly.
The user should pick up apar ix51754, which clarifies the error
message when this condition is detected.  Additionally, the user
can read the non-ptf documentation apar ix50874 which is a companion
to ix48926 and ix51754.

** This bug was fixed for AIX 3.2.5 rootvg install in apars
ix46862 and ix46863.  This bug does not exist in AIX 4.1.1.

------------------------------

1.705: Why am I having trouble adding another disk to my VG?
From: shieh@austin.ibm.com (Johnny Shieh)

In some instances, the user will experience a problem adding
a new disk to an existing volume group or in the creation of
a new volume group.  The warning message provided by LVM will
be:

	Not enough descriptor space left in this volume group.
	Either try adding a smaller PV or use another volume group.

On every disk in a volume group, there exists an area called the
Volume Group Descriptor Area (VGDA).  This space is what allows
the user to take a volume group to another AIX system and
"importvg" that volume group into that AIX system.  The VGDA
contains the names of disks that make up the volume group, their
physical sizes, partition mapping, logical volumes that exist in
the volume group, and other pertinent LVM management information.

When the user creates a volume group, the "mkvg" command
defaults to allowing the new volume group to have a maximum
of 32 disks in a volume group.  However, as bigger disks have
become more prevalent, this 32 disk limit is usually not
achieved because the space in the VGDA is used up faster, as
it accounts for the capacity on the bigger disks.  This
maximum VGDA space, for 32 disks, is a fixed size which is
part of the LVM design.  Large disks require more management
mapping space in the VGDA, which causes the number and size
of available disks to be added to the existing volume group
to shrink.  When a disk is added to a volume group, not only
does the new disk get a copy of the updated VGDA, but all
existing drives in the volume group must be able to accept
the new, updated VGDA.

The exception to this description of the maximum VGDA is
rootvg.  In order to provide AIX users more free space, when
rootvg is created, "mkvg" does not use the maximum limit of
32 disks that are allowed into a volume group.  Instead in
AIX 3.2, the number of disks picked in the install menu of
AIX is used as the reference number by "mkvg -d" during the
creation of rootvg.  For AIX 4.1, this "-d" number is 7 for
one disk and one more for each additional disk
picked. i.e. you pick two disks, the number is 8.  you pick
three disks, the number is 9, and so on.....  This limit does
not mean the user cannot add more disks to rootvg in the
post-install phase.  The amount of free space left in a VGDA,
and thus the number of size of the disks added to a volume
group, depends on the size and number of disks already
defined for a volume group.  However, this smaller size
during rootvg creation implies that the user will be able to
add fewer disks to rootvg than compared to a non-rootvg
volume group.

If the customer requires more VGDA space in the rootvg, then
they should use the "mksysb" and "migratepv" commands to
reconstruct and reorganize their rootvg (the only way to
change the "-d" limitation is recreation of the rootvg).

Note:  It is always strongly recommended that users do not place
user data onto rootvg disks.  This separation provides an extra
degree of system integrity.

------------------------------

1.706: What are the limits on a file, filesystem?

There are other limits but these come up most often.  Logical Volumes
do not _have_ to contain Journaled File Systems and therefore can be
larger than 2GB even in 3.2.5.

	File	jfs-Filesystem
3.2.5	2GB	2GB
4.1.x	2GB	64GB
4.2	64GB	128GB

While it *might* be possible to create larger file systems,  the limits
shown here represent values that IBM has supposedly tested.	

------------------------------

1.707:  Hints for Segate 9 GB and other disks larger than 4 GB? 

[read 1.704]


------------------------------

1.708: How do I fix Volume Group Locked?

>From /usr/lpp/bos/README (AIX 3.2.5) and 1.800.IBM.4FAX #2809

If you get '0516-266 publvodm: volume group rootvg is locked, try again'
or something similar, you can use (putlvodm -K `getlvodm -v <vgname>`)

------------------------------

1.709: How do I remove a volume group with no disks?
From: shieh@austin.ibm.com (Johnny Shieh)

This is a very common question about AIX LVM and I thought
I might take some time to explain what is going on.  Within
a volume group is the Volume Group Descriptor Area (VGDA) is
is kinda a "suitcase" of lvm information.  This is what allows
you to pick up your drives and take them to another machine,
importvg them, and get filesystems automatically defined.

What happens is that when you importvg the volume group,
the RS/6000 goes out and reads the VGDA and finds out about
all the logical volumes and filesystems that may exist on the
volume group.  It then checks for clashes (name conflicts, etc..)
on its own machine and then, here is the important part, populates
its own database with information about the new volume group and
its associated logical volumes.  In cases of filesystems, it will
go into the /etc/filesystems file and add the new filesystem entries
that came along with the imported volume group.

Okay, the key point is that you've got this independent volume group
that has "docked" at the new RS/6000.  What keeps the two tethered
to each other is the varyonvg command.  When this is started on the
volume group, a software link is created where you can't separate the
volume group from the AIX operating system unless the volume group
is no longer seen as active by the system.  In very rare cases, a
situation can occur where the VGDA thinks that someone has it (the
volume group) activated, but the operating system doesn't think it has the
volume group opened up.  This is pretty rare.

The main question I see is "I've taken away the disks, but how do
I get rid of the volume group".  The question should really say,
"How do I get rid of the volume group INFORMATION" since that's
all you have on the system.  You've got possible entries in
the /etc/filesystems and definitely entries in the ODM.  Just 
do:
	exportvg <vgname>

It does a reverse importvg, except it doesn't go off and read
the VGDA.  It nukes anything relating to the volume group in
the /etc/filesystems and ODM.  The only time this won't work is
if the system detects that the volume group is varied on.  Then,
it would be like trying to change tires on a moving car, we won't
let you do it!

Some people are concerned that doing an exportvg will somehow damage
the volume group and/or its VGDA. As I said, all it does is affect the
information about the volume group on the RS/6000 box, not on the actual
disk platter itself.  Thus, the volume group you exported is safe to
take to another system.  The only time the VGDA gets overwritten is when
you create a new volume on top of it.

The second most often asked question is "How do I get rid of a disk
that is no longer really in the volume group?"

In this case, you DON'T want to do an exportvg.  What you want to do
is tell the system you want to cut out the memory of the old, bad disk
from the RS/6000 AND from the VGDA of the volume group.  You simply
do:

		reducevg -d -f <vgname> <hdname>

or if the hdname can't be found:

		reducevg -d -f <vgname> <PVID>

Be careful with this command.  Unlike the exportvg command, actions done
with this command WILL affect the VGDA information on the platter.

Hope this clarifies some questions about volume groups.

------------------------------

1.710:  What are the theoritical limits within the LVM?
From: Gerry FitzGerald <G.FitzGerald@uk22p.bull.co.uk>

  -------------------------------------
  LVM Limits within AIX (my perception)
  -------------------------------------
  
  The system may have 1 to 255 Volumes Groups (VG's).
  Each VG may contain 1 to 32 Physical Volumes (PV's).
  Each PV may contain upto 1016 Physical Partitions (PP's).
  Each PP may have a size (square of 2) from 1 to 256MB.
  
  Therefore, if you can get hold of a 260,096 MB disk (one PV with 1016 
  x 256MB PPs), you can install 32 of these in a single VG giving you 
  8,323,072MB per VG. You may have up to 255 VG's in one AIX system so 
  you could (in theory) create the maximum addressable AIX storage area 
  of 2,122,383,360 MB (2,072,640 GB or 2,024 TB or approx. 2 PB). This 
  is based on the current limitations of AIX V4.1.
  
  The limits for file and filesystem sizes are:
  
  AIX V3.2  Max Filesystem size:  2,097,152 bytes (2 GB)
  Max single file size:  2,097,152 bytes (2 GB)
  

  AIX V4.1  Max Filesystem size:  67,108,864 bytes (64 GB)
  Max single file size:  2,097,152 bytes ( 2 GB)  
  
  AIX V4.2  Max Filesystem size:  67,108,864 bytes (64 GB)
  Max single file size:  67,108,864 bytes (64 GB)

------------------------------

1.800: How do I control how hostnames are resolved?
From: <kraem@ibm.de> Frank Kraemer

Information from AIX 4.1.2 Infoexplorer:

The default order can be overwritten by creating the configuration file,
/etc/netsvc.conf and specifying the desired order. Both the default and
/etc/netsvc.conf can be overwritten with the environment variable,
NSORDER. If either the /etc/netsvc.conf file or environment variable,
NSORDER are defined, then at least one value must be specified along with
the option.

examples: 
    echo hosts = local,nis,bind >/etc/netsvc.conf
    NSORDER=local,bind; export NSORDER

------------------------------

Subjet: 1.801: dtlogin ignores /etc/profile?
From: Trevor Bourget (trevor@thomsoft.com)

Read the /usr/dt/bin/Xsession script.  You can add a file to the
/etc/dt/config/Xsession.d and it will get sourced as part of the
startup.  The order is: $HOME/.dtprofile, /etc/dt/config/Xsession.d/*,
/usr/dt/config/Xsession.d/* (backwards, in my opinion, but CDE is a
committee result after all).

>From: Ed Ravin <eravin@panix.com>

If you want your terminal session to automatically read in
/etc/profile and your .profile when they start up, you need to either
invoke them with the "-ls" option (which I couldn't figure out how to
do, perhaps someone else can elaborate), or set up the default X
resources so that they set:

*Dtterm*loginShell:     true

You could always do this with the .Xresources file in your own account,
but that wouldn't fix any other users in the system.  To make this change
globally:

CDE configuration files are kept in /usr/dt/config
 
Those files warn you strenuously not to change them, since AIX upgrades
will overwrite them and lose your changes.  They recommend that you copy
the files to /etc/dt/config and change them there, so:

# cd /usr
# find dt/config -print | cpio -pdvum /etc
... (files get copied)
# cd /etc/dt/config/C
# echo "*Dtterm*loginShell:     true" >> sys.resources
# cd ../en_US
# echo "*Dtterm*loginShell:     true" >> sys.resources

------------------------------

1.802:  Where's the C compiler?

As of AIX 4.1,  the C compiler has been "unbundled."  It's a separate product,
and you must purchase a separate license for it.  IBM does offer free
time limited trial licenses if you want to "try before you buy."

The GNU C compiler is available from various sources.  The most convenient
is probably <http://www-frec.bull.com/>.  <ftp://aixpdslib.seas.ucla.edu/>
is another source.

------------------------------

1.803:  Why doesn't Netscape work?

See question 1.515.

------------------------------

1.900: SCSI-1 and SCSI-2 "interoperability" got you confused?  

A.  SCSI-1 devices are supported on a SCSI-2 adapter.  This
    config will provide SCSI-1 performance.

B.  SCSI-2 devices are supported on a SCSI-1 adapter.  This
    config will provide SCSI-1 performance.

C.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-1
    adapter.  All devices will have SCSI-1 performance.

D.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-2
    adapter.  SCSI-2 devices will have SCSI-2 performance (10 MB/sec)
    and SCSI-1 devices will have SCSI-1 performance (4-5 MB/sec).

------------------------------

1.901: How to get your keyboard back after unplugging it from the 6000
From: Mickey Coggins and Anne Serre and L. Mark Larsen

When you unplug your keyboard from a running system, and plug it back
in, the key mapping is wrong.  For example, keys like Caps Lock and Ctrl
don't work as designed.

Solution: Type at the command line

        /usr/lpp/diagnostics/da/dkbd

Your screen goes black, you hear a few beeps, and your keyboard is reset.
It works with any environment, Xwindows, hft, NLS...

For Models 220, 230 and M20, use the following commands:

/usr/lpp/diagnostics/da/dkbd
/usr/lpp/diagnostics/da/dkbdsal   (for the 220)

After running the keyboard diagnostics to reset keyboard mappings, the
repeat rate is also reset to some slow value (11, according to the man
page).  If the user is in X, you need to open an hft window.  Do this
with "xopen /bin/csh".  Once you have an hft window, run "chhwkbd -r30".

------------------------------

1.902: How do I set up pcsim, the DOS emulator?

[Editor's Note: this product does not exist in AIX 4.x.]

You must have a bootable DOS diskette to install pcsim. Either DOS 3.3, 
4.x, or 5.0 will work. IBM do not officially support DOS 5.0 for pcsim
but I have no problems with it. Just don't try to be fancy with the UMB 
and memory manager stuff.

With a bootable DOS disk in the drive, do:
$touch /u/dosdrive (this is the AIX file for DOS emulation)
$pcsim -Adiskette 3 -Cdrive /u/dosdrive
You would now get an A prompt. Type:
A> fdisk
Create the virtual C drive of whatever size you choose. Make it large 
enough for your needs since you cannot enlarge it later.
A> format c: /s (to format the virtual C drive)
Now exit from pcsim with ESCpcsim (Esc key followed by pcsim).

Now create a simprof file. Following is a starter:

Adiskette   : 3
Cdrive      :/u/dosdrive
lpt1        : name of printer queue
refresh     : 50
dmode       : V
mouse       : com1

You can now start pcsim anytime by typing pcsim. Make sure no floppies
are in the drive. For further information, refer to publication
SC23-2452, Personal Computer Simulator/6000 Guide and Reference.
       
------------------------------

1.903: How do I transfer files between AIX and DOS disks?

In one of the bos extensions are commands for transferring files between
DOS diskettes and AIX. The commands are dosread, doswrite, dosdir, dosdel,
and dosformat. Many users have mentioned that the mtools package from
prep.ai.mit.edu is better than the native AIX programs.


------------------------------

1.904: Where is the crypt program?

The crypt *program* (as opposed to the crypt subroutine) has been
deleted, probably to conform to U.S. law regarding export of
cryptographic technology.

Other programs such as PGP are available,  but their use and/or
possesion may be subject to local laws and regulations.

If anyone has a better answer to this question,  feel free to
contribute it.

------------------------------

1.905: How do I play audio CDs?
From: woan@austin.ibm.com (Ronald S. Woan)

Get xmcd by anonymous FTP from ftp.x.org in /contrib/applications/xmcd/
<URL:ftp://ftp.x.org/contrib/applications/xmcd/>

------------------------------

1.906: How can I get the mouse back after unplugging it?

/usr/lpp/diagnostics/da/dmousea

------------------------------

1.907: Where can I get source code to the operating
                system binary xxxxx?

AIX source code is not generally available.  Two other UNIX OS' do
make their source available, Linux & freeBSD.  Check
<ftp://ftp.uu.net/systems/unix/bsd-sources/> and
<ftp://ftp.uu.net/systems/unix/linux/>

------------------------------

1.908: What's the difference between the POWER and
                POWERPC architectures?

Read the POWERPC FAQ at
<http://www.mot.com/SPS/PowerPC/library/ppc_faq/ppc_faq.html>

------------------------------

1.909: Will there be date rollover problems in the year 2000?
From: mbrown@austin.ibm.com (Mark Brown)

IBM has a major corporate-wide push for *all* of its software products
to be "safe" in this regard by the end of 1996.

<http://www.software.ibm.com/year2000/paper.html> is the general-purpose
[Year 2000] URL for IBM.

As far as AIX is concerned, we had to fix three things in AIXv4.1.4
(some logging commands handled date ranges wrong) as PTFs, but other
than that, we are there.

...and we handle the leap year issue correcly. also.

------------------------------

1.910: How can I build an "installp format" file?

Jim Abbey <jim@systelecom.com> has a tool called "lppbuild".
It is now available from "aixpdslib.seas.ucla.edu"
in either of

/pub/lppbuild/RISC/3.2/src/lppbuild.1.0.tar.Z
/pub/lppbuild/RISC/4.1/src/lppbuild.1.0.tar.Z

Both are identical and the procedures also work on 4.2.

Ciaran Diegnan <C.Diegnan@frec.bull.fr> has built a tool called
"mklpp".  You can retrieve a copy (along with many other
smit-installable freeware packages) from <http://www-frec.bull.com/>.

------------------------------

1.911: Is there a generic SCSI driver for AIX?
From: Rogan Dawes <rdawes@jhbelec.co.za>

Yes. Matthew Jacob (mjacob@feral.com) has written a generic SCSI driver
for AIX 4.1.  It can be found at <ftp://ftp.feral.com/pub/aix/gsc.tar.gz>.
------------------------------

2.00: C/C++

Contrary to many people's belief, the C environment on the RS/6000 is
not very special.  The C compiler has quite a number of options that can
be used to control how it works, which "dialect" of C it compiles, how
it interprets certain language constructs, etc.  InfoExplorer includes a
Users Guide and a Reference Manual.

The compiler can be invoked with either xlc for strict ANSI mode and cc
for RT compatible mode (i.e. IBM 6150 with AIX 2).  The default options
for each mode are set in the /etc/xlc.cfg file, and you can actually add
another stanza and create a link to the /bin/xlc executable.

The file /usr/lpp/xlc/bin/README.xlc has information about the C
compiler, and the file /usr/lpp/bos/bsdport (AIX 3 only) contains useful
information, in particular for users from a BSD background.

The file /etc/xlc.cfg also shows the symbol _IBMR2 that is predefined,
and therefore can be used for #ifdef'ing RS/6000 specific code.

------------------------------

2.01: I cannot make alloca work

A famous routine, in particular in GNU context, is the allocation
routine alloca().  Alloca allocates memory in such a way that it is
automatically free'd when the block is exited.  Most implementations
does this by adjusting the stack pointer.  Since not all C environments
can support it, its use is discouraged, but it is included in the xlc
compiler.  In order to make the compiler aware that you intend to use
alloca, you must put the line

#pragma alloca

before any other statements in the C source module(s) where alloca is
called.  If you don't do this, xlc will not recognize alloca as anything
special, and you will get errors during linking.

For AIX 3.2, it may be easier to use the -ma flag.

------------------------------

2.02: How do I compile my BSD programs?

The file /usr/lpp/bos/bsdport contains information on how to port
programs written for BSD to AIX 3.  This file may be very useful for
others as well.

A quick cc command for most "standard" BSD programs is:
  
  $ cc -D_BSD -D_BSD_INCLUDES  -o [loadfile] [sourcefile.c] -lbsd

If your software has system calls predefined with no prototype
parameters, also use the -D_NO_PROTO flag.

------------------------------

2.03: Isn't the linker different from what I am used to?

Yes.  It is not at all like what you are used to:

- The order of objects and libraries is normally _not_ important.  The
  linker reads _all_ objects including those from libraries into memory
  and does the actual linking in one go.  Even if you need to put a
  library of your own twice on the ld command line on other systems, it
  is not needed on the RS/6000 - doing so will even make your linking slower.

- One of the features of the linker is that it will replace an object in
  an executable with a new version of the same object:

  $ cc -o prog prog1.o prog2.o prog3.o		# make prog
  $ cc -c prog2.c				# recompile prog2.c
  $ cc -o prog.new prog2.o prog			# make prog.new from prog
						# by replacing prog2.o
  
- The standard C library /lib/libc.a is linked shared, which means that
  the actual code is not linked into your program, but is loaded only
  once and linked dynamically during loading of your program.

- The ld program actually calls the binder in /usr/lib/bind, and you can
  give ld special options to get details about the invocation of the
  binder.  These are found on the ld man page or in InfoExplorer.

- If your program normally links using a number of libraries (.a files),
  you can 'prelink' each of these into an object, which will make your
  final linking faster.  E.g. do:

  $ cc -c prog1.c prog2.c prog3.c
  $ ar cv libprog.a prog1.o prog2.o prog3.o
  $ ld -r -o libprog.o libprog.a
  $ cc -o someprog someprog.c libprog.o

This will solve all internal references between prog1.o, prog2.o and
prog3.o and save this in libprog.o Then using libprog.o to link your
program instead of libprog.a will increase linking speed, and even if
someprog.c only uses, say prog1.o and prog2.o, only those two modules
will be in your final program.  This is also due to the fact that the
binder can handle single objects inside one object module as noted above.

If you are using an -lprog option (for libprog.a) above, and still want
to be able to do so, you should name the prelinked object with a
standard library name, e.g. libprogP.a (P identifying a prelinked
object), that can be specified by -lprogP.  You cannot use the archiver
(ar) on such an object.

You should also have a look at section 3.01 of this article, in
particular if you have mixed Fortran/C programs.

Dave Dennerline (d.dennerline@bull.com) claims that his experiences
in prelinking on AIX does not save much time since most people have
separate libraries which do not have many dependencies between them,
thus not many symbols to resolve.

------------------------------

2.04: How do I statically link my program?

  cc -o prog -bnoso -bI:/lib/syscalls.exp obj1.o obj2.o obj3.o

will do that for a program consisting of the three objects obj1.o, etc.

[Editor's note: You should never link programs statically that are
supposed to leave your local environment, e.g. intended for
distribution. Statically linked programs may fail to work after
installing a new AIX version or even after installing a PTF.]

From: Marc Pawliger (marc@sti.com)

As of AIX 3.2.5, you can install a speedup for AIXwindows called
Shared Memory Transport.  To static link an X application after the
SMT PTF has been installed, you must link with
-bI:/usr/lpp/X11/bin/smt.exp and the executable will NOT run on a
machine where SMT is not installed.  See /usr/lpp/X11/README.SMT
Newsgroups: comp.unix.aix,comp.answers,news.answers
Path: news.univie.ac.at!aconews.univie.ac.at!newscore.univie.ac.at!fu-berlin.de!news-ber1.dfn.de!news-ham1.dfn.de!newsserver.rrzn.uni-hannover.de!baghira.han.de!jum
From: jum@anubis.han.de
Approved: news-answers-request@mit.edu
Followup-To: comp.unix.aix
Supersedes: <aix-faq-4-886305604@anubis.han.de>
Reply-To: jum@anubis.han.de (Jens-Uwe Mager)
Keywords: AIX RS/6000 questions answers
Sender: jum@baghira.han.de (Jens-Uwe Mager)
Expires: Sun, 5 Apr 1998 05:01:07 GMT
Organization: At Home
Message-ID: <aix-faq-4-888724807@anubis.han.de>
References: <aix-faq-1-888724807@anubis.han.de> 
Date: Sun, 1 Mar 1998 04:00:24 GMT
         and their answers.  AIX is IBM's version of Unix.
Lines: 1806
Xref: news.univie.ac.at comp.unix.aix:125562 comp.answers:29712 news.answers:39490

Posted-By: auto-faq 3.3 (Perl 4.035)
Archive-name: aix-faq/part4
Posting-Frequency: monthly


------------------------------

2.05: How do I make my own shared library?

To make your own shared object or library of shared objects, you should
know that a shared object cannot have undefined symbols.  Thus, if your
code uses any externals from /lib/libc.a, the latter MUST be linked with
your code to make a shared object.  Mike Heath (mike@pencom.com) said it
is possible to split code into more than one shared object when externals
in one object refer to another one.  You must be very good at
import/export files.  Perhaps he or someone can provide an example. 

Assume you have one file, sub1.c, containing a routine with no external
references, and another one, sub2.c, calling stuff in /lib/libc.a.  You
will also need two export files, sub1.exp, sub2.exp.  Read the example
below together with the examples on the ld man page. 

---- sub1.c ----
    int addint(int a, int b)
    {
      return a + b;
    }
---- sub2.c ----
    #include <stdio.h>

    void printint(int a)
    {
      printf("The integer is: %d\n", a);
    }
---- sub1.exp ----
    #!
    addint
---- sub2.exp ----
    #!
    printint
---- usesub.c ----
    main()
    {
      printint( addint(5,8) );
    }

The following commands will build your libshr.a, and compile/link the
program usesub to use it.  Note that you need the ld option -lc for
sub2shr.o since it calls printf from /lib/libc.a.  [Note that you can leave
out the "-T512 -H512" on AIX 4. -- Ed.]

  $ cc  -c sub1.c
  $ ld -o sub1shr.o sub1.o -bE:sub1.exp -bM:SRE -T512 -H512 
  $ cc  -c sub2.c
  $ ld -o sub2shr.o sub2.o -bE:sub2.exp -bM:SRE -T512 -H512  -lc
  $ ar r libshr.a sub1shr.o sub2shr.o
  $ cc -o usesub usesub.c -L: libshr.a
  $ usesub
  The integer is: 13
  $

------------------------------

2.06: Linking my program fails with strange errors.  Why?

Very simple, the linker (actually called the binder), cannot get the
memory it needs, either because your ulimits are too low or because you
don't have sufficient paging space.  Since the linker is quite different
>from normal Unix linkers and actually does much more than these, it also
uses a lot of virtual memory.  It is not unusual to need 10000 pages (of
4k) or more to execute a fairly complex linking.

If you get 'BUMP error', either ulimits or paging is too low, if you get
'Binder killed by signal 9' your paging is too low.

First, check your memory and data ulimits; in korn shell 'ulimit -a' will
show all limits and 'ulimit -m 99999' and 'ulimit -d 99999' will
increase the maximum memory and data respectively to some high values. 
If this was not your problem, you don't have enough paging space.

If you will or can not increase your paging space, you could try this:

- Do you duplicate libraries on the ld command line? That is never
  necessary.

- Do more users link simultaneously? Try having only one linking going
  on at any time.

- Do a partwise linking, i.e. you link some objects/libraries with the
  -r option to allow the temporary output to have unresolved references,
  then link with the rest of your objects/libraries.  This can be split
  up as much as you want, and will make each step use less virtual memory.

  If you follow this scheme, only adding one object or archive at a
  time, you will actually emulate the behavior of other Unix linkers.

If you decide to add more paging space, you should consider adding a new
paging space on a second hard disk, as opposed to just increasing the
existing one.  Doing the latter could make you run out of free space on
your first harddisk. It is more involved to shrink a paging space
but easier to delete one.

------------------------------

2.07: Why does it take so long to compile "hello world" with xlc?

Some systems have experienced delays of more than 60 seconds in
compiling "#include <stdio.h> int main () {printf ("Hello world");}"
The problem is with the license manager contact IBM to make sure
you've got the latest PTF.

------------------------------

2.08: What's with malloc()?
 
malloc() uses a late allocation algorithm based on 4.3 BSD's malloc()
for speed.  This lets you allocate very large sparse memory spaces,
since the pages are not actually allocated until they are touched for
the first time.  Unfortunately, it doesn't die gracefully in the face of
loss of available memory.  See the "Paging Space Overview" under
InfoExplorer, and see the notes on the linker in this document for an
example of an ungraceful death.

If you want your program to get notified when running out of memory, you
should handle the SIGDANGER signal.  The default is to ignore it. 
SIGDANGER is sent to all processes when paging space gets low, and if
paging space gets even lower, processes with the highest paging space
usage are sent the SIGKILL signal.

malloc() is substantially different in 3.2, allocating memory more
tightly.  If you have problems running re-compiled programs on 3.2,
try running them with MALLOCTYPE=3.1.

Early Page Space Allocation (EPSA) added to AIX 3.2: see
/usr/lpp/bos/README.PSALLOC - IX38211 / U422496 Allows setting of
early allocation (vs. default late allocation) on a per-process basis.

------------------------------

2.09: Why does xlc complain about 'extern char *strcpy()'

The header <string.h> has a strcpy macro that expands strcpy(x,y) to
__strcpy(x,y), and the latter is then used by the compiler to generate
inline code for strcpy.  Because of the macro, your extern declaration
contains an invalid macro expansion.  The real cure is to remove your
extern declaration but adding -U__STR__ to your xlc will also do the
trick, although your program might run a bit more slowly as the compiler
cannot inline the string functions any more.

------------------------------

2.10: Why do I get 'Parameter list cannot contain fewer ....'

This is the same as above (2.9).

------------------------------

2.11: Why does xlc complain about
               '(sometype *)somepointer = something'

Software that is developed using gcc may have this construct. However,
standard C does not permit casts to be lvalues, so you will need to
change the cast and move it to the right side of the assignment. If you
compile with 'cc', removing the cast completely will give you a warning,
'xlc' will give you an error (provided somepointer and something are of
different types - but else, why would the cast be there in the first place?)

------------------------------

2.12: Some more common errors

Here are a few other common errors with xlc:

305 |     switch((((np)->navigation_type) ? (*((np)->navigation_type)) :
      ((void *)0)))
      .a...........  
a - 1506-226: (S) The second and third operands of the conditional
operator must be of the same type.

The reason for this is that xlc defines NULL as (void *)0, and it does
not allow two different types as the second and third operand of ?:. 
The second argument above is not a pointer and the code used NULL
incorrectly as a scalar. NULL is a nil pointer constant in ANSI C and
in some traditional compilers.

You should change NULL in the third argument above to an integer 0.


------------------------------

2.13: Can the compiler generate assembler code?

Starting with version 1.3 of xlc and xlf the -S option will generate a
.s assembly code file prior to optimization. The option -qlist will
generate a human readable one in a .lst file.

There is also a disassembler in /usr/lpp/xlc/bin/dis include with the
1.3 version of xlc (and in /usr/lpp/xlC/bin/dis with the 2.1 version
of xlC) that will disassemble existing object or executable files.

------------------------------

2.14: Curses

Curses based applications should be linked with -lcurses and _not_ with
-ltermlib. It has also been reported that some problems with curses are
avoided if your application is compiled with -DNLS.

Peter Jeffe <peter@ski.austin.ibm.com> also notes:

>the escape sequences for cursor and function keys are *sometimes*
>treated as several characters: eg. the getch() - call does not return
>KEY_UP but 'ESC [ C.'

You're correct in your analysis: this has to do with the timing of the
escape sequence as it arrives from the net. There is an environment
variable called ESCDELAY that can change the fudge factor used to decide
when an escape is just an escape. The default value is 500; boosting
this a bit should solve your problems.

Christopher Carlyle O'Callaghan <asdfjkl@wam.umd.edu> has more comments
concerning extended curses:

1) The sample program in User Interface Programming Concepts, page 7-13
   is WRONG. Here is the correct use of panes and panels.

#include <cur01.h>
#include <cur05.h>

main()
{
PANE *A, *B, *C, *D, *E, *F, *G, *H;
PANEL *P;

initscr();

A = ecbpns (24, 79, NULL, NULL, 0, 2500, Pdivszp, Pbordry, NULL, NULL);
D = ecbpns (24, 79, NULL, NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
E = ecbpns (24, 79, D,    NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
B = ecbpns (24, 79, A, D, Pdivtyh, 3000, Pdivszp, Pbordry, NULL, NULL);
F = ecbpns (24, 79, NULL, NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
G = ecbpns (24, 79, F,    NULL, 0, 5000, Pdivszp, Pbordry, NULL, NULL);
H = ecbpns (24, 79, G,    NULL, 0, 3000, Pdivszp, Pbordry, NULL, NULL);
C = ecbpns (24, 79, B, F, Pdivtyh, 0, Pdivszf, Pbordry, NULL, NULL);
P = ecbpls (24, 79, 0, 0, "MAIN PANEL", Pdivtyv, Pbordry, A);

ecdvpl (P);
ecdfpl (P, FALSE);
ecshpl (P); 
ecrfpl (P);
endwin();
}

2) DO NOT include <curses.h> and any other <cur0x.h> file together.
   You will get a bunch of redefined statements.

3) There is CURSES and EXTENDED CURSES. Use only one or the other. If the
   manual says that they're backwards compatible or some other indication 
   that you can use CURSES routines with EXTENDED, don't believe it. To 
   use CURSES you need to include <curses.h> and you can't (see above).

4) If you use -lcur and -lcurses in the same link command, you will get
   Memory fault (core dump) error. You CANNOT use both of them at the same
   time. -lcur is for extended curses, -lcurses is for regular curses.

5) When creating PANEs, when you supply a value (other than 0) for the
   'ds' parameter and use Pdivszf value for the 'du' parameter, the 'ds'
   will be ignored (the sample program on page 7-13 in User Interface
   Programming Concepts is wrong.) For reasons as yet undetermined,
   Pdivszc doesn't seem to work (or at least I can't figure out how to
   use it.)

6) If you're running into bugs and can't figure out what is happening,
   try the following:
   include -qextchk -g in your compile line
	-qextchk will check to make sure you're passing the right number of
  	 parameters to the functions
	-g enables debug

7) Do not use 80 as the number of columns if you want to use the whole
   screen. The lower right corner will get erased.  Use 79 instead.

8) If you create a panel, you must create at least 1 pane, otherwise you
   will get a Memory fault (core dump).

9) When creating a panel, if you don't have a border around it, any title
   you want will not show up.

10) to make the screen scroll down:
    wmove (win, 0, 0);
    winsertln (win)

11) delwin(win) doesn't work in EXTENDED WINDOWS

    To make it appear as if a window is deleted, you need to do the following:
    for every window that you want to appear on the screen
	touchwin(win)
	wrefresh(win)

    you must make sure that you do it in the exact same order as you put
    them on the screen (i.e., if you called newwin with A, then C, then B,
    then you must do the loop with A, then C, then B, otherwise you won't
    get the same screen back).  The best thing to do is to put them into
    an array and keep track of the last window index.

12) mvwin(win, line, col) implies that it is only used for viewports and
    subwindows. It can also be used for the actual windows themselves.

13) If you specify the attribute of a window using wcolorout(win), any
    subsequent calls to chgat(numchars, mode) or any of its relatives
    will not work. (or at least they get very picky.)

------------------------------

2.15: How do I speed up linking

Please refer to sections 2.03 and 2.06 above.

From: losecco@undpdk.hep.nd.edu (John LoSecco) and
      hook@chaco.aix.dfw.ibm.com (Gary R. Hook)

From oahu.cern.ch in /pub/aix3 you can get a wrapper for the existing
linker called tld which can reduce link times with large libraries by
factors of 3 to 4.

------------------------------

2.16: What is deadbeef?

When running the debugger (dbx), you may have wondered what the
'deadbeef' is you occasionally see in registers.  Do note, that
0xdeadbeef is a hexadecimal number that also happens to be some kind
of word (the RS/6000 was built in Texas!), and this hexadecimal number
is simply put into unused registers at some time, probably during
program startup.


------------------------------

2.17: How do I make an export list from a library archive?
From: d.dennerline@bull.com (Dave Dennerline)

[ This script has been moved to section 8.10 ]

------------------------------

2.19: Building imake, makedepend
From: crow@austin.ibm.com (David L. Crow)

[Editor's note: if you have AIX 4.x,  you need the X11.adt.imake LPP
and probably most if not all of the X11.adt.* LPPs.  Imake, xmkmf and
other utilities are delivered precompiled.]

    You need X11dev.src release 1.2.3.0 (ie the R5 release) [on AIX 3.2].


     Unless you have an R5 release of AIXwindows, there is no xmkmf.
  These are the steps that I use to make imake, makedepend and all
  of it's config files, and then install them in the working tree
  (ie not the Xamples) for daily use:
  
      cd /usr/lpp/X11/Xamples
      make Makefile
      make SUBDIRS="config util" Makefiles
      make SUBDIRS="config util" linklibs
      make SUBDIRS="config util" depend
      make SUBDIRS="config util" 
      make SUBDIRS="config util" install
      
  Then redo the steps everytime you apply an X11 update.

------------------------------

2.20: How can tell what shared libraries a binary is linked with?

Use "dump -H <execfilename>" and see if anything other than /unix is
listed in the loader section (at the bottom).  The first example is
/bin/sh (statically linked) and the second example is
/usr/local/bin/bash (shared).

INDEX  PATH                          BASE                MEMBER              
0      /usr/lib:/lib                                                         
1      /                             unix                                    

INDEX  PATH                          BASE                MEMBER              
0      ./lib/readline/:./lib/glob/:/usr/lib:/lib               
1                                    libc.a              shr.o               
2                                    libcurses.a         shr.o               

The freeware tool "ldd" lists all the shared libraries needed
by an executable, including those recursively included by other
shared libraries. See question 2.27 "Where can I find ldd for AIX?".

------------------------------

2.21: Can I get a PTF for my C/C++ compiler from the net?

<http://service.software.ibm.com/>  contains pointers to most PTFs, including
compilers.  You'll need the fixdist program (see 1.142) to retrieve them.

------------------------------

2.22: Why does "install"ing software I got from the net fail?

Note that the RS/6000 has two install programs, one with System V flavor
in the default PATH (/etc/install with links from /usr/bin and /usr/usg),
and one with BSD behavior in /usr/ucb/install.

------------------------------

2.23: What is Linker TOC overflow error 12?

There is a hard coded limit in the AIX 3.2.5 linker that is fixed in
AIX 4.1.  A kind soul donated the following information to help people
get the 3.2.5 fix

    The LPS (paperwork) 
      AIX TOC Data Binder/6000 #P91128
      Version 1.1
      Program Number 5799-QDY
      Reference No. GC23-2604-00, FC 5615
    Pre Reqs listed were AIX 3.2.5
      IBM C Set++ V2 (5765-186)

The above is not available any longer, see section 1.006.

You could also put some of the application code into shared libraries
or, in the case of gcc, use -mminimal-toc.

------------------------------

2.24: What is the limit on number of shared memory segments
               I can attach?

Each process has 16 segments.  One is used for private code, one for
stack, one for heap; those, if memory serves, are segments 0, 1, and
2.  (If you look in sys/shm.h, you'll see that SHMLOSEG is 3 -- the
lowest segment, in number and in the process' virtual address space,
available to shmat.)

SHMHISEG, the highest segment you can attach to (also defined in
sys/shm.h), is 12.  Segments 3 through 12 are available to shmat,
giving the 10 segments your program used successfully.  (NSHMSEGS in
sys/shm.h will give you this value, though it's of limited use, since
most platforms that I've seen don't define it.)

Segment 13 is used by shared code your program has attached to;
I think one of the others might be for kernel-mode data.

See also mmap.

------------------------------

2.25: I deleted libc.a by accident --- how do I recover?
From: Ed Ravin <eravin@panix.com>

You can recover from this without rebooting or reinstalling, if you
have another copy of libc.a available that is also named "libc.a".  If
you moved libc.a to a different directory, you're in luck -- do the
following:

export LIBPATH=/other/directory


And your future commands will work.  But if you renamed libc.a, this
won't do it.  If you have an NFS mounted directory somewhere, you can
put libc.a on the that host, and point LIBPATH to that directory as
shown above.

Failing that, turn off your machine, reboot off floppies or other
media, and get a root shell.  I don't think you should do "getrootfs"
as you usually do when accessing the root vg this way -- AIX may start
looking for libc.a on the disk, and you'll just run into the same
problem.  So do an importvg, varyonvg, and then mount /usr somewhere,
then manually move libc.a back or copy in a new one from floppy.

------------------------------

2.26: Where can I find dlopen, dlclose, and dlsym for AIX?

An implementation of these dynamic code loading functions was written by
Jens-Uwe Mager <jum@anubis.han.de> and can be found at
<ftp://anubis.han.de/pub/aix/dlfcn.shar>

From: Gary R. Hook <hook@austin.ibm.com>

Starting with AIX 4.2 a dlopen et. al. are included in the base OS in
the libdl.a library. Under AIX 4.1 this is available as SLHS (Shared
Library Hookable Symbols) as APAR IX IX71849 for the runtime package and
APAR IX IX72973 for the development tools.

------------------------------

2.27: Where can I find ldd for AIX?
From: Jens-Uwe Mager <jum@anubis.han.de>

Try <ftp://anubis.han.de/pub/aix/ldd.c>. Also the "aix.tools"
package from <http://www-frec.bull.com>

------------------------------

2.28:  How do I make my program binary executable on the
                POWER, POWER2, and POWERPC architecures?

AIX will emulate those instructions not available in POWERPC processors, but
you can avoid this emulation and consequent performance degradtation by
using only the common to all.

If you are using IBM's xlc (cc) compiler, the default is to use the common
instruction set.  If you want to be explicit, use the -qarch=com option.

The option -mcpu=common makes GCC use the common instruction set.  Please
note that (unlike xlc) this is *not* the default with GCC on AIX.

------------------------------

2.29: How do I access more than 256 Megabytes of memory?

By default each program gets one segment register (see 2.24) for its
data segment. As each segment register covers 256 MB, any calls to
malloc more will fail. Also programs that declare large global or static
arrays may fail to load. To allocate more segment registers to your
program, use the linker option -bmaxdata to specify the number of bytes
you need in the data segment as follows:

cc -o myprog -bmaxdata:0x20000000 myprog.c

The example above would allocate an additional segment register to allow
for 512MB of data.

------------------------------

2.30: How do I use POSIX threads with gcc 2.7.x?
From: David Edelsohn <dje@watson.ibm.com>

The code generated by GCC is compatible with threads, but gcc-2.7 
was released so long ago that it did not provide an option to perform
the extra link steps necessary to support threads:

1) Compile all source files with "-D_THREAD_SAFE" macro defined.
2) Link with "-L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a"
   to obtain the pthreads support 
   and add "-nostartfiles /usr/lib/crt0_r.o" to the beginning of the
   link command line (using gcc to link!) to initialize threads.

------------------------------

3.00: Fortran and other compilers

This section covers all compilers other than C/C++.  On Fortran, there
seem to have been some problems with floating point handling, in
particular floating exceptions.

------------------------------

3.01: I have problems mixing Fortran and C code, why?

A few routines (such as getenv, signal, and system) exist in both the
Fortran and C libraries but with different parameters. In the recent
past, if you have a mixed program that calls getenv from both C and
Fortran code, you have to link them carefully by specifying the correct
library first on your command line. This is no longer needed starting
with version 1.5 of the compilers.


------------------------------

3.02: How do I statically bind Fortran libraries and dynamically
               bind C libraries?
From: amaranth@vela.acs.oakland.edu (Paul Amaranth)

[ Editor's note: Part of this is also discussed above under the C compiler
  section, but I felt it was so valuable that I have left it all in. 
  I've done some minor editing, mostly typographical. ]

The linker and binder are rather versatile programs, but it is not
always clear how to make them do what you want them to.  In particular,
there are times when you do not want to use shared libraries, but
rather, staticly bind the required routines into your object.  Or, you
may need to use two versions of the same routine (eg, Fortran & C).  Here
are the results of my recent experiments.  I would like to thank Daniel
Premer and Brad Hollowbush, my SE, for hints.  Any mistakes or omissions
are my own and I have tended to interchange the terms "linker" and
"binder".  These experiments were performed on AIX 3.1.2.  Most of this
should be applicable to later upgrades of 3.1.

1)  I have some C programs, I want to bind in the runtime routines.  How
    do I do this? [Mentioned in section 2.04 of this article as well, ed.]

    You can put the -bnso binder command on the link line.  You should
    also include the -bI:/lib/syscalls.exp control argument:
      
      $ cc *.o -bnso -bI:/lib/syscalls.exp -o foo

    This will magically do everything you need.  Note that this will bind
    _all_ required routines in.  The -bI argument tells the linker that
    these entry points will be resolved dynamically at runtime (these are
    system calls).  If you omit this you will get lots of unresolved 
    reference messages.

2)  I want to statically bind in the Fortran runtime so a) my customers 
    do not need to buy it and b) I don't have to worry about the runtime
    changing on a new release.  Can I use the two binder arguments in
    1) to do this?

    You should be able to do so, but, at least under 3002, if you do
    you will get a linker error referencing getenv.  In addition, there
    are a number of potential conflicts between Fortran and C routines.
    The easy way just does not work.  See the section on
    2 stage linking for C and Fortran on how to do this.  The getenv
    problem is a mess, see the section on Comments & Caveats for more.

    From: Gary R. Hook <hook@austin.ibm.com>

    The xlf runtime is a no-charge feature, you can download and install
    it without having to buy it. This change was made >2 years ago.

3)  I have a mixture of C and Fortran routines, how can I make sure
    that the C routines reference the C getenv, while the Fortran routines
    reference the Fortran getenv (which has different parameters and, if
    called mistakenly by a C routine results in a segmentation fault)?

    From Mike Heath (mike@pencom.com):

    Use -brename:symbol1,symbol2 when pre-linking the modules from one
    of the languages. It does not matter which one you choose.

4)  I have C and Fortran routines.  I want to bind in the xlf library, while
    letting the rest of the libraries be shared.  How do I do this?

    You need to do a 2 stage link.  In the first stage, you bind in the
    xlf library routines, creating an intermediate object file.  The
    second stage resolves the remaining references to the shared libraries.

    This is a general technique that allows you to bind in specific system
    routines, while still referencing the standard shared libraries.

    Specifically, use this command to bind the xlf libraries to the Fortran
    objects:

       $ ld -bh:4 -T512 -H512 <your objects> -o intermediat.o \
         -bnso -bI:/lib/syscalls.exp -berok -lxlf -bexport:/usr/lib/libg.exp \
         -lg -bexport:<your export file>

    The argument -bexport:<your export file> specifies a file with the
    name of all entry points that are to be visible outside the intermediate 
    module.  Put one entrypoint name on a line.  The -bI:/lib/libg.exp line 
    is required for proper functioning of the program.  The -berok argument 
    tells the binder that it is ok to have unresolved references, at least 
    at this time (you would think -r would work here, but it doesn't seem to).  
    The -bnso argument causes the required modules to be imported
    into the object.  The -lxlf, of course, is the xlf library.

    Then, bind the intermediate object with the other shared libraries in
    the normal fashion:

       $ ld -bh:4 -T512 -H512 <C or other modules> intermediate.o \
         /lib/crt0.o -lm -lc

    Note the absence of -berok.  After this link, all references should
    be resolved (unless you're doing a multistage link and making another
    intermediate).

    NOTE THE ORDER OF MODULES.  This is extremely important if, for example,
    you had a subroutine named "load" in your Fortran stuff.  Putting the
    C libraries before the intermediate module would make the C "load"
    the operable definition, rather than the Fortran version EVEN THOUGH 
    THE FORTRAN MODULE HAS ALREADY BEEN THROUGH A LINK AND ALL REFERENCES 
    TO THE SYMBOL ARE CONTAINED IN THE FORTRAN MODULE.  This can
    be extremely difficult to find (trust me on this one :-)  Is this
    a bug, a feature, or what?
    
    [As mentioned in section 2.03 of this article, it is a feature that you
    can replace individual objects in linked files, ed.]

    The result will be a slightly larger object than normal.  (I say slightly
    because mine went up 5%, but then it's a 2 MB object :-)


Comments & Caveats:

   From the documentation the -r argument to the linker should do what
   -berok does.  It does not.  Very strange results come from using the
   -r argument.  I have not been able to make -r work in a sensible manner
   (even for intermediate links which is what it is supposed to be for).

       Note from Mike Heath (mike@pencom.com):

       'ld -r' is essentially shorthand for 'ld -berok -bnogc -bnoglink'.
       Certainly, using -berok with an export file (so garbage collection
       can be done) is preferable to ld -r, but the latter is easier.

   When binding an intermediate module, use an export file to define the
   entry points you want visible in the later link.  If you don't do this,
   you'll get the dreaded "unresolved reference" error.  Import files name
   entry points that will be dynamically resolved (and possibly where).

   If you are in doubt about what parameters or libraries to link, use the
   -v arg when linking and modify the exec call that shows up into 
   an ld command.  Some thought about the libraries will usually yield an
   idea of when to use what.  If you don't know what an argument is for,
   leave it in.  It's there for a purpose (even if you don't understand it).

   Watch the order of external definitions (ie, libraries) when more than
   one version of a routine may show up, eg "load".  The first one defined
   on the ld command line is the winner.  

   The getenv (and system and signal) problem is a problem that started out
   minor, got somewhat worse in 3003 and, eventually will be correctly fixed.
   Basically, you should extract the 3002 version of these three routines
   from xlf.a before doing the update and save them away, then link these
   routines in if you use these Fortran system services.  


------------------------------

3.03: How do I check if a number is NaN?
From: sdl@glasnost.austin.ibm.com (Stephen Linam)

NaN is "Not a Number".  It arises because the RISC System/6000 uses
IEEE floating point arithmetic.

To determine if a variable is a NaN you can make use of the property
that a NaN does not compare equal to anything, including itself.
Thus, for real variable X, use

	IF (X .NE. X) THEN	! this will be true if X is NaN

Floating point operations which cause exceptions (such as an overflow)
cause status bits to be set in the Floating Point Status and Control
Register (FPSCR).  There is a Fortran interface to query the FPSCR, and
it is described in the XLF Fortran manuals -- I don't have the manuals
right here, but look for FPGETS and FPSETS.

The IBM manual "Risc System/6000 Hardware Technical Reference - General
Information" (SA23-2643) describes what floating point exceptions can
occur and which bits are set in the FPSCR as a result of those exceptions.


------------------------------

3.04: Some info sources on IEEE floating point.

1. ANSI/IEEE STD 754-1985 (IEEE Standard for Binary Floating-Point
   Arithmetic) and ANSI/IEEE STD 854-1987 (IEEE Standard for
   Radix-Independent Floating-Point Arithmetic), both available from IEEE. 

2. David Goldberg, "What Every Computer Scientist Should Know About
   Floating-Point Arithmetic", ACM Computing Surveys, Vol. 23, No. 1,
   March 1991, pp. 5-48.

------------------------------

3.05: Why does it take so long to compile "hello world" with xlf? 

[read 2.07]

------------------------------

4.00: GNU and Public Domain software

GNU software comes from the Free Software Foundation and various other
sources. A number of ftp sites archive them. Read the GNU license for 
rules on distributing their software.

Lots of useful public domain software have been and continue to be ported
to the RS/6000. See below for ftp or download information.

------------------------------

4.01: How do I find sources?
From: jik@GZA.COM (Jonathan Kamens)

There is a newsgroup devoted to posting about how to get a certain
source, comp.sources.wanted.  An archive of information about sources,
including FTP sites is available from

------------------------------

4.02: Are there any ftp or WWW sites?

SMIT-installable precompiled packages of popular freeware for AIX 4.x at
<http://www-frec.bull.com/>.  Download the ".exe" files with your WWW
browser. These are auto-uncompressing files, just like on PCs (it uses
similar technology to PKZIP). Mark the file as executable (chmod +x),
then execute it to generate a .bff file. The .bff file can then be
installed using "smit install_latest". For more information
read the INSTALL.txt file on the server.

There are mirrors of this site at http://www.bull.de/ and
http://ftp.univie.ac.at/aix/.

The package explicitly referenced below are ones Ciaran consideres
"solid."  That is, the binary has been "tested by lots of people."

Bull provides many other freeware packages as well.  If you use the
service,  be sure and thank Ciaran and Bull.

Below are some ftp sites that are supposed to have RS/6000 specific
software.  I haven't verified all the entries.

US sites:
<ftp://aixpdslib.seas.ucla.edu/pub/>		128.97.2.211
<ftp://aix.boulder.ibm.com/>
<ftp://software.watson.ibm.com/>

European sites:
<ftp://nic.funet.fi/pub/unix/AIX/RS6000/>		128.214.6.100
<ftp://iacrs1.unibe.ch/pub/>			130.92.11.3
<ftp://ftp.zrz.TU-Berlin.DE/pub/aix/>		130.149.4.50
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>	129.104.3.60
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>		129.69.8.13

The first one is dedicated to software running on AIX.  It might not
always be the latest versions of the software, but it has been ported
to AIX (normally AIX version 3 only).  Please use the European sites
very sparingly.  They are primarily to serve people in Europe and most
of the software can be found in the US sites originally.

The remaining sites are simply ones that archie indicated contained
AIX related materials.

<ftp://ibminet.awdpa.ibm.com/>	#IBM announcements, oem hardware
<ftp://cac.toronto.ibm.com/>	#marketing-info
<ftp://ftp.egr.duke.edu/>
<ftp://straylight.acs.ncsu.edu/>
<ftp://alpha.gnu.ai.mit.edu/rs6000>
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>
<ftp://iacrs2.unibe.ch/pub/aix/>
<ftp://ftp.u.washington.edu/pub/RS6000/>
<ftp://aixive.unb.ca/>
<ftp://ftp.ans.net/pub/misc/>
<ftp://uvaarpa.virginia.edu/pub/misc/>
<ftp://ux1.cts.eiu.edu/pub/rs6000/>
<ftp://ftp.bsc.nopub/Src/>
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>
<ftp://aix1.segi.ulg.ac.be/pub/aix/>
<ftp://byron.u.washington.edu/pub/aix/>
<ftp://cunixf.cc.columbia.edu/aix/>
<ftp://files1zrz.zrz.tu-berlin.de/pub/aix/>
<ftp://ftp.rz.uni-augsburg.de/pub/aix/>
<ftp://fyvie.cs.wisc.edu/pub/aix/>
<ftp://solaria.cc.gatech.edu/pub/aix/>
<ftp://spot.colorado.edu/aix/>
<ftp://swdsrv.edvz.univie.ac.at/unix/systems/aix/>
<ftp://switek.uni-muenster.de/pub/aix/>
<ftp://wuarchive.wustl.edu/systems/aix/>
<ftp://cs.nyu.edu/pub/AIX/>
<ftp://karazm.math.uh.edu/pub/AIX/>
<ftp://minnie.zdv.uni-mainz.de/pub0/pub/AIX/>
<ftp://oersted.ltf.dth.dk/pub/AIX/>
<ftp://rs3.hrz.th-darmstadt.de/pub/incoming/AIX/>
<ftp://aeneas.mit.edu/pub/rs6000/>
<ftp://cameron.egr.duke.edu/rs6000/>
<ftp://ifi.informatik.uni-stuttgart.de/pub/rs6000/>
<ftp://metropolis.super.org/pub/rs6000/>
<ftp://ramses.cs.cornell.edu/pub/rs6000/>
<ftp://server.uga.edu/pub/rs6000/>
<ftp://uvaarpa.virginia.edu/pub/rs6000/>
<ftp://wayback.cs.cornell.edu/pub/rs6000/>
<ftp://alice.fmi.uni-passau.de/pub/RS6000/>
<ftp://byron.u.washington.edu/pub/aix/RS6000/>
<ftp://milton.u.washington.edu/pub/RS6000/>
<ftp://pascal.math.yale.edu/pub/RS6000/>
<ftp://uxc.cso.uiuc.edu/pub/RS6000/>

------------------------------
4.03: Why does "install"ing software I got from the net fail?

This answer was moved to section 2.22

------------------------------

4.04: GNU Emacs

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

If you get a segmentation fault in GNU EMACS 19.* during hilit19 use,
you can set locale to C (export LC_ALL=C) to get around the AIX bug.

Version 18.57 of GNU Emacs started to have RS/6000 support.  Use
s-aix3-2.h for AIX 3.2. Emacs is going through rapid changes recently.
Current release is 19.x.

Emacs will core-dump if it is stripped, so don't strip when you install
it.  You can edit a copy of the Makefile in src replacing all 'install -s' 
with /usr/ucb/install.

------------------------------

4.05: gcc/gdb

GNU C version 2.0 and later supports the RS/6000, and compiles straight
out of the box.  You may, however, experience that compiling it requires
large amounts of paging space.

Compiling gcc and gdb on AIX 3.2 requires a patch to the 'as' assembler.  Call
IBM software support and request patch for apar IX26107 (U409205).

gcc has undergone many changes lately and the current version is 2.7.x.
gdb is at 4.1x.

If your machine crashed when trying to run gdb 4.7, call software support
and request ptf U412815.

------------------------------

4.06: GNU Ghostscript 

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

The PostScript interpreter GNU Ghostscript Version 2.3 and later supports
the RS/6000 and can be found on various ftp sites. Current version is 2.6.1.

Compile time problems:
  Compile idict.c and zstack.c _without_ optimization, add the following
  to the Makefile:

  idict.o: idict.c
        $(CC) -c idict.c

  zstack.o: zstack.c
        $(CC) -c zstack.c

Run time problems:
  Running ghostview-1.5 with ghostscript-2.6.1, I get 
   gs: Malformed ghostview color property.
  Solution: replace buggy version of ghostscript-2.6.1 X11 driver
  with at least 2.6.1pl4 

------------------------------

4.07  TeX - Document processing
From: "Patrick TJ McPhee" <ptjm@ican.net>

TeX can be retrieved via ftp from the comprehensive TeX archive
network (CTAN). The principle sites are
ftp.tex.ac.uk (UK)
ftp.dante.de  (Deutschland)
ftp.tug.org  (USA)
but there are many mirrors. finger ctan@ftp.tex.ac.uk for a list.

------------------------------

4.08  Perl - Scripting language

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

If you want the source code, <http://www.perl.com/perl/> is good place
to start.

------------------------------

4.09: X-Windows

AIX 4.x ships with X11R5 and Motif 1.2.

On AIX 3.2 the base version has X11R4 and Motif 1.1 and the extended
version has X11R5 as AIXwindows 1.2.3.  See question 1.500 for more
information about determining your revision.

AIXwindows version 1.2.0 (X11rte 1.2.0) is X11R4 with Motif 1.1
AIXwindows version 1.2.3 (X11rte 1.2.3) is X11R5 with Motif 1.1
'lslpp -h X11rte.motif1.2.obj' should tell you if you are
running Motif 1.2.

------------------------------

4.10  Bash - /bin/ksh alternative from FSF

Bash is an alternative to ksh and is availible from prep.ai.mit.edu
and places that mirror the GNU software.  /etc/security/login.cfg
needs to be modified if this will be used as a default shell.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

------------------------------

4.11: Elm

A very nice replacement for mail. Elm should be pretty straightforward,
the only thing to remember is to link with -lcurses as the only
curses/termlib library. You may also run into the problem listed under
point 2.13 above.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

------------------------------

4.12: Oberon 2.2
From: afx@muc.ibm.de (Andreas Siegert)

Oberon is Wirth's follow on to Modula-2, but is not compatible. A free
version of Modula-3 is available from DEC/Olivetti at
gatekeeper.dec.com. This is not a Modula-2 replacement but a new
language. There are currently two M2 compilers for the 6000 that I
know of. One from Edinburgh Portable Compilers, +44 31 225 6262 (UK)
and the other from Gardens Point is availible through A+L in
Switzerland (+41 65 520311) or Real Time Associates in the UK
(info@rtal.demon.co.uk).

Oberon can be obtained via anonymous ftp from neptune.inf.ethz.ch
(129.132.101.33) under the directory Oberon/RS6000 or gatekeeper.dec.com
(16.1.0.2).

------------------------------

4.13: Kermit - Communications
From: Frank da Cruz <fdc@watsun.cc.columbia.edu>

Available for all versions of AIX on RS/6000, PowerPC, PS/2, RT PC,
and 370-Series mainframes.  For complete information on Kermit software
for AIX and hundreds of other platforms, visit the Kermit Web site:

  <http://www.columbia.edu/kermit/>

C-Kermit 6.0 was announced November 30, 1996:

  <http://www.columbia.edu/kermit/ck60.html>

The nonprofit Kermit Project is funded primarily by manual sales.
For C-Kermit 6.0 the manual is the new second edition of "Using C-Kermit":

  <http://www.columbia.edu/kermit/ck60manual.html>

For RS/6000 and PowerPC with AIX 3.x or 4.x:

  <ftp://kermit.columbia.edu/kermit/archives/cku192.tar.Z> (or .gz)

Uncompress, untar (tar xvf cku192.tar) then:

  make rs6aix32c  <--  For AIX 3.x
  make rs6aix41c  <--  For AIX 4.x

This produces an exutable called "wermit".  Before installing, read the
instructions in ckuins.doc from the tar file.

If you don't have a C compiler, you can get binaries at:

  <http://www.columbia.edu/kermit/ck60ubin.html>

Send questions to kermit-support@columbia.edu.

------------------------------

4.14: Gnu dbm
From: doug@cc.ysu.edu (Doug Sewell)

Here's the fixes for RS/6000's:

apply this to testgdbm.c:
158c158
<   char opt;
---
>   int opt;
166c166
<   while ((opt = getopt (argc, argv, "rn")) != -1)
---
>   while ((opt = getopt (argc, argv, "rn")) != EOF)

Apply this to systems.h:
111a112,114
> #ifdef RS6000
> #pragma alloca
> #else
112a116
> #endif

To compile, edit the Makefile.  Set CC to bsdcc (see /usr/lpp/bos/bsdport
if you don't have 'bsdcc' on your system) and set CFLAGS to -DRS6000 and
whatever options (-g, -O) you prefer.  Don't define SYSV.

------------------------------

4.15  tcsh - an alternative shell
From: cordes@athos.cs.ua.edu (David Cordes)

tcsh is available from <ftp://ftp.deshaw.com/pub/tcsh>
Compiles with no problems. You must edit /etc/security/login.cfg to
permit users to change to this shell (chsh), adding the path where the
shell is installed (in my case, /usr/local/bin/tcsh).

>From: "A. Bryan Curnutt" <bryan@Stoner.COM>

Under AIX 3.2.5, you need to modify the "config.h" file, changing
    #define BSDSIGS
to
    #undef BSDSIGS

------------------------------

4.16: Kyoto Common Lisp

The sources are available from cli.com. The kcl package is the needed
base; also retrieve the latest akcl distribution. akcl provides a
front-end that "ports" the original kcl to a number of different
platforms. The port to the 6000 worked with no problems. However, you
must be root for make to work properly with some memory protection
routines.

------------------------------

4.17  Tcl/Tk - X-Windows scripting

Current versions: Tcl 8.0b2 and Tk 8.0b2.  They are available from
<ftp://ftp.sunlabs.com/pub/tcl/>. The Tcl/Tk web page is at
<http://sunscript.sun.com/>.

Prebuilt installp (smit) installable packages for several versions of Tcl and
Tk are available from <http://www-frec.bull.com/>.

------------------------------

4.18: Expect
From: Doug Sewell <DOUG@YSUB.YSU.EDU>
   
To build the command-interpreter version, you must have the tcl library
built successfully. The expect library doesn't require tcl.  Note:
Expect and its library are built with bsdcc, so applications using
the library probably also need to be developed with bsdcc.

I ftp'd expect from ftp.cme.nist.gov.

You need to change several lines in the makefile.  First you need
to customize source and target directories and files:
#
TCLHDIR = /usr/include
TCLLIB = -ltcl
MANDIR = /usr/man/manl               (local man-pages)
MANEXT = l
BINDIR = /u/local/bin
LIBDIR = /usr/lib
HDIR = /usr/include
...
Next set the compiler, switches, and configuration options:
#
CC = bsdcc
CFLAGS = -O
...
PTY_TYPE = bsd
...
INTERACT_TYPE = select
...
Then you need to make these changes about line 90 or so:
comment out CFLAGS = $(CLFLAGS)
un-comment these lines:
CFLAGS = $(CLFLAGS) $(CPPFLAGS)
LFLAGS = ($CLFLAGS)

Then run 'make'.

You can't run some of the examples without modification (host name,
etc).  I don't remember if I ran all of them or not, but I ran enough
that I was satisfied it worked.

------------------------------

4.19: Public domain software on CD
From: mbeckman@mbeckman.mbeckman.com (Mel Beckman)

The Prime Time Freeware CD collection is a package of two CD's and docs
containing over THREE GIGABYTES of compressed Unix software. It costs $69
>from Prime Time Freeware, 415-112 N. Mary Ave., Suite 50, Sunnyvale, CA
94086. Phone 408-738-4832 voice, 408-738-2050 fax. No internet orders as
far as I can tell.

I've extracted and compiled a number of the packages, and all have worked
flawlessly so far on my 220. Everything from programming languages to 3D
solid modeling is in this bonanza!

[Ed: The O'Reilly book, Unix Power Tools, also contains a CD-ROM with lots
of useful programs compiled for the RS/6000, among other platforms.]

------------------------------

4.20: Andrew Toolkit

From: Gary Keim <gk5g+@andrew.cmu.edu>

The Andrew Toolkit Consortium of Carnegie Mellon University's School of
Computer Science has released new versions of the Andrew User
Environment, Andrew Toolkit, and Andrew Message System.

The Andrew User Environment (AUE) is an integrated set of applications
beginning with a 'generic object' editor, ez, a help system, a system
monitoring tool (console), an editor-based shell interface (typescript),
and support for printing multi-media documents. 

The Andrew Toolkit (ATK) is a portable user-interface toolkit that runs
under X11. It provides a dynamically-loadable object-oriented
environment wherein objects can be embedded in one another. Thus, one
could edit text that, in addition to containing multiple fonts, contains
embedded raster images, spreadsheets, drawing editors, equations, simple
animations, etc. These embedded objects can also be nested.

The Andrew Message System (AMS) provides a multi-media interface to mail
and bulletin-boards. AMS supports several mail management strategies
and implements many advanced features including authentication, return
receipts, automatic sorting of mail, vote collection and tabulation,
enclosures, audit trails of related messages, and subscription
management. It has interfaces that support ttys, personal computers, 
and workstations.

Release 5.1 of Andrew contains many bug fixes and updates. There is now
support for the new Internet MIME (Multipurpose Internet Mail Extensions)
standards for multipart, and multimedia mail. For more information on
MIME, please see the CHANGES files in the ftp directory on
emsworth.andrew.cmu.edu.

This release can be obtained as follows. The sources are available via
anonymous ftp from export.lcs.mit.edu (18.30.0.238) in the
./contrib/andrew tree. For details, see ./contrib/andrew/README.

PATCH for AIX3.2: A patch to the AUIS 5.1 sources can be ftp'ed from
emsworth.andrew.cmu.edu (128.2.45.40) in ./aixpatch. For those without
internet access, a 3.5" diskette can be ordered for a nominal fee of $10
by sending, or faxing, a purchase order to the Consortium address below.

Andrew, as well as a variety of other CMU software, can also be ftp'ed
>from emsworth.andrew.cmu.edu (128.2.30.62). Those with AFS access look
at /afs/andrew.cmu.edu/itc/sm/releases/X.V11R5/ftp.

Remote Andrew Demo Service 

This network service allows you to run Andrew Toolkit applications
without obtaining or compiling the Andrew software. You need a host
machine running X11 on the Internet. A simple "finger" command will let
you experience ATK applications firsthand. You'll be able to compose
multimedia documents, navigate through the interactive Andrew Tour, and
use the Andrew Message System to browse through CMU's three thousand
bulletin boards and newsgroups.

To use the Remote Andrew Demo service, run the following command:

    finger help@atk.itc.cmu.edu 

The service will give you further instructions.

Information Sources

Your bug reports are welcome; kindly send them to
info-andrew-bugs@andrew.cmu.edu and we will periodically post a status
report to the mailing list info-andrew@andrew.cmu.edu. To be added to
the mailing list or make other requests, send mail to
info-andrew-request@andrew.cmu.edu.

We also distribute the following related materials:

ATK and AMS sources and binaries on CDROM. Binaries are available
for the following system types: 

        	IBM RiscSystem/6000 
		Sun SparcStation 
		HP 700 Series 
		DECstation 

ATK and AMS sources on QIC and Iotamat tapes Hardcopies of the
documentation for ATK and AMS. Introductory video tape: Welcome to
Andrew: An Overview of the Andrew System. Technical video tape: The
Andrew Project: A Session at the Winter 1988 Usenix Conference.

More information about these materials is available from:

    Information Requests
    Andrew Toolkit Consortium
    Carnegie Mellon University
    4910 Forbes Avenue, UCC 214
    Pittsburgh, PA 15213-3890
    USA
    phone: +1-412-268-6710
    fax: +1-412-621-8081
    info-andrew-request@andrew.cmu.edu

There is also a netnews distribution list, comp.soft-sys.andrew, which
is identical to the info-andrew list except that it does not support the
multi-media capabilities of info-andrew.

------------------------------

4.21: sudo


Sudo (superuser do) allows a system administrator to give certain users (or
groups of users) the ability to run some (or all) commands as root while
logging all commands and arguments. Sudo operates on a per-command basis, it
is not a replacement for the shell. 

The latest version of sudo is cu-sudo v1.5.  There is a web page for sudo at
<http://www.courtesan.com/courtesan/products/sudo/sudo.html>.  The program
itself can be obtained from <ftp://ftp.courtesan.com/pub/sudo/>.  Sudo's
author, Todd Miller < Todd.Miller@courtesan.com> reports that sudo works on
both AIX 3.2.X and 4.1.X. 


------------------------------

4.22: Flexfax/HylaFax and other fax software

From: Christian Zahl <czahl@cs.tu-berlin.de>

Sam Leffler has released a new version of FlexFax called HylaFax.  It
is availible from <ftp://sgi.com/sgi/fax/>.  There is a HlyaFax web
page at <http://www.vix.com/hylafax/>.  Version V3.0pl1
supported many types of Class 1/2 fax modems and several UNIX systems
including AIX 3.2.3 or greater.  There is also a fax modem review
document at the same site as <ftp://sgi.com/pub/fax/bakeoff>. The FlexFax
related files on sgi.com are replicated on ftp.bsc.no as well.

>From: michael@hal6000.thp.Uni-Duisburg.DE (Michael Staats)

We're using mgetty+sendfax for the basic modem I/O, I wrote a printer
backend for the modem so that users can send faxes as easy as they print
postscript. I also wrote a little X interface composer to generate a
fax form that makes sending faxes very easy. You can find these
programs at hal6000.thp.Uni-Duisburg.DE under /pub/source.

program				comment

mgetty+sendfax-0.14.tar.gz	basic modem I/O, needs hacking for AIX
X11/xform-1.1.tar.gz	     	small and simple X interface composer
				with an example fax form. Needs
				libxview.a incl. headers.
faxiobe.tar.gz			fax backend, needs configuring for
				your local site

If you need a binary version of libxview.a and the headers you'll find
them under /pub/binaries/AIX-3-2/lxview.tar.gz.

------------------------------

4.23: lsof - LiSt Open Files

From: abe@vic.cc.purdue.edu (Vic Abell)

Q. How can I determine the files that a process has opened?
Q. How can I locate the process that is using a specific network address?
Q. How can I locate the processes that have files open on a file system?

A. Use lsof (LiSt Open Files).
>From: "Juan G. Ruiz Pinto" <jgruiz@cyber1.servtech.com>

Lsof is available via anonymous ftp from vic.cc.purdue.edu
(128.210.15.16) in /pub/tools/unix/lsof/lsof.tar.Z (for the
most current version). The most current version is 4.14. There
are binary distributions in the "binary" directory.

Lsof supports AIX 4.1 since version 3.09.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>. The installation scripts in this package
automatically creates a group "kmem" during the install
and uses "acledit" to allow the kmem group to read /dev/mem and /dev/kmem.
This configuraqtion is reccomended by Vic Abell <abe@cc.purdue.edu>, the
author of lsof.

------------------------------

4.24: popper - POP3 mail daemon


The POP server is available via anonymous ftp from 
ftp.qualcomm.com:/quest/unix/servers/popper
  The makefile supports AIX
ftp.CC.Berkeley.EDU (128.32.136.9, 128.32.206.12).
  There are two versions in the pub directory: a compressed tar file
  popper-version.tar.Z and a Macintosh StuffIt archive in BinHex format
  called MacPOP.sit.hqx.

Problems building some versions of popper can sometimes be resolved by
compiling with bsdcc or -D_BSD.

The pine 3.95 package on <http://www-frec.bull.com/> contains "plug
and play" support for both POP3 and IMAP mail reading protocols.  You
can also get a compiled version of qpopper 2.2 there also.

------------------------------

4.26: mpeg link errors version 2.0

From: Nathan Lane <nathan@seldon.foundation.tricon.com>

.XShmCreateImage
.XShmDetach
.XShmAttach
.XShmGetEventBase
.XShmPutImage
.XShmQueryExtension

... are for the Shared Memory extension of the X server.
You can either choose to build it with shared memory or without.  I
always do it without the performance increase is not really
incredible, except on something like a 2x0 machine with the local bus
graphics adapter.  Just take out "DSH_MEM" in the CFLAGS in the
makefile for mpeg_play.  There is more information about shared memory
link errors in section 1.513.

Also, in the module "video.c" for mpeg_play it will complain about not
having enough memory to fully optimize one of the loops.  You can get
around that by specificying "qmaxmem=8000" in your cflags line, BUT,
the extra optimization does little good in my tests.

------------------------------

4.27: NNTP, INN


Link errors compiling nntp may occur because your machine lacks the
"patch" command.  Patch can be obtained from GNU repositories.  See question

4.29 for more information on patch.


------------------------------

4.28: Zmodem - File transfer

RZSZ is Chuck Forsberg's script for Z-modem. It is available by ftp at
<ftp://oak.oakland.edu/pub/unix-c/xyzmodem/rzsz9305.tar.Z> or
directly from Forsberg at Omen Technology BBS at 503-621-3746.

Hints:
0. Build with "make posix"
1. Use an 8-bit clean version of rlogin or telnet (Note: below)
2. Set the system to be transparent, I use "terminal download" 
3. Ensure hardware flow-control

Note, carlson@xylogics.com (James Carlson) suggests: Rlogin is
"slightly" unclean -- if an FF FF 73 73 appears in the datastream, it
can be ripped out by rlogind as a 'window size change' request.

[Ed note: The important part is using an 8-bit clean application,
since there are several implemenations of rlogin and telnet availible
you may need to try both and hunt down manuals to find the right flags
for your system]

------------------------------

4.29: Patch - automated file updates


AIX 3.2.5 does not ship with patch, a utility to apply the differences
between two files to make them identical.  This tool is often used to
update source code.

<ftp://ftp.x.org/pub/R6untarred/xc/util/patch/>
<ftp://prep.ai.mit.edu/pub/gnu/patch-2.1.tar.gz>

------------------------------

4.30: XNTP - network time protocol, synchronizes clocks

From: Joerg Schumacher <schuma@ips.cs.tu-bs.de>

   AIX 4:   xntpd in bos.net.tcp.client
   source:  ftp://ftp.udel.edu/pub/ntp/
   WWW:     http://www.eecis.udel.edu/~ntp/


------------------------------

4.31: GNU Screen and AIX 4.1.x


Once again,  binaries can be had from <http://www-frec.bull.com/>.

------------------------------

4.32: PINT -- SCSI scanner software

From: Kenneth Stailey <kstailey@leidecker.gsfc.nasa.gov>

<http://www.dol-esa.gov/~kstailey/pint>
<ftp://uniwa.uwa.edu.au:/pub/pint>
<ftp://ftp.gwdg.de:/pub/misc/scanner>
<ftp://alpha.gnu.ai.mit.edu:/pub/pint-0.5d.tar.gz>

------------------------------

4.33: Pager/Paging software


There is information on Paging, Paging programs and  listing of the
Archive sites to download at the web site:
<ftp://ftp.airnote.net:/pub/paging-info/ixo.faq>.

HylaFAX (see 4.22) supports sending messages to alphanumeric pagers.

Commercially there is: AlphaPage(r) MD2001 from Information Radio
Technology, Inc. in Cleveland, OH. 

------------------------------

4.34: JAVA Development Kit

From: Curt Finch <curt@tkg.com>

<http://ncc.hursley.ibm.com/javainfo/>

------------------------------

4.35: Sendmail


<ftp://ftp.sendmail.org/sendmail/>

If you want to use SRC to start and stop BSD sendmail,  do the following 
after installing it:

chssys -s sendmail -S -n 15 -f 9 -a -d99.100

This tells SRC that sendmail may be stopped with signals 15 and 9.  It also
arranges for sendmail not to daemonize itself,  since it will run under SRC.

------------------------------

4.2 already has a similar feature.


------------------------------

1.149 How to install LPPs on a shared disk?
From: Ciaran Deignan <C.Deignan@frec.bull.fr>

I have an LPP that I want to install on all my AIX machines (for
example the "perl" freeware), but I want to minimize the disk-space
used on the network of machines. Can I selectively mount part of /usr
on another machine?

In general it is not possible to share an LPP with several machines.
Sometimes it is possible to use a dedicated filesystem to install
freeware which can then be shared.

However for anything packaged as an LPP it is possible to use
a script that replaces /usr/sbin/inurest, and that redirects files
delivered by the LPP to the shared disk.

One script that does this is called Ninstallp, and it is available
(with instructions) from
http://www.geocities.com/ResearchTriangle/5428/ninstallp.html

------------------------------

1.150 How can I reduce the size of /var/adm/wtmp ?

The file /var/adm/wtmp grows with each login, but is never reduced.
The contents of wtmp is used (only?) by the command "last",
which shows, in reverse order, all the logins and reboots that
happened since the start of the wtmp file.

The file should not be deleted, but the contents can be discarded using
the following command:
# > /var/adm/wtmp

Alternatively the freeware utility "tidysys" can remove all the entries
from wtmp that are older than (say) 15 days. Tidysys was written by
Terry Murray <terry@weavel.demon.co.uk> for AIX 3.2 and is available
from ftp://ftp.frontiernet.net/pub/aix/tsys220.tar.

Tidysys was ported to AIX 4.1 by C. Deignan and is available from
<http://www-frec.bull.com/>.

------------------------------

1.151: How do I start local daemons at system startup?

AIX does neither use the BSD style rc.local file nor the System V style
/etc/rc*.d startup files directories. To add local daemons to the system
startup sequence in a BSD rc.local style use the following command to
create an /etc/inittab entry:

# mkitab -i rcnfs "rclocal:2:wait:/etc/rc.local >/dev/console 2>&1"
# touch /etc/rc.local
# chmod 700 /etc/rc.local

Then put the command lines to start the daemons in /etc/rc.local.

------------------------------

1.200: Some info about tape backups
From: Craig Anderson

The following supplements the information on rmt devices in
InfoExplorer. It is based on my own personal experience with IBM tape
drives running on AIX 3.1. No warranty is expressed or implied.

CONFIGURING THROUGH SMIT:
    BLOCK size (0=variable length)		(ALL)
	Sets the tape block size.  When reading, the block size must be
	set to the block size set when the tape was written.  When
	using some commands, tapes written with ANY block size can be
	read if the block size is set to 0 (variable length) (see
	"BLOCK SIZES" below).

    Use DEVICE BUFFERS during writes		(ALL)
	Set to yes, the device will buffer data internally on writes.
	This greatly improves performance, but under certain cases may
	be undesirable since the data is not written to tape before
	returning a good indication.

    Use EXTENDED file marks			(8mm only)
	Extended file marks take up much more space than short (or
	non-extended) file marks.  But extended file marks can be
	overwritten, allowing data not at the beginning of tape to be
	overwritten (see "FILE MARKS" below).

    RETENSION on tape change or reset		(1/4" only)
	If set to "no" then the tape will not be retentioned
	automatically when the tape is inserted.  Note that this will
	take effect only after the device is used.


FILE MARKS:
     Tape devices support multiple tape files.  Tape files are the
     result of a backup/cpio/tar/dd type command, where the device is
     opened, written to, and closed.  Because tapes allow large
     quantities of data to be written on a single tape, several backups
     (that is, tape files), may be combined on one physical tape.
     Between each tape file is a "tape file mark" or simply "file
     mark".  These file marks are used by the device driver to indicate
     where one tape file ends and another begins.

                              B       E
                   <-------   O       O   ------->
                              T       T
     physical | \            |       |      \             |physical
     beginning|  \           | tape  |       \            | end
       of     |   \          | file  |        \           |  of
      tape    |    \         | mark  |         \          | tape
              |_____\________|_______|__________\_________|
 
     Note that there is a distinction between the beginning of tape
     (BOT) side of a file mark and the end of tape (EOT) side of a file
     mark.  If the head is on the BOT side of a file- mark, "tctl fsf
     1" command will move only to the EOT side of the same file mark.

     With the 1/4" tape drive, writing can only take place
     sequentially, or after blank tape has been detected.  You cannot
     write over data on the tape (except at BOT).  If you wish to add
     data to a tape which has been written and then rewound you should
     space forward file mark until an error occurs.  Only then can
     you start writing again.

     With an 8mm tape drive, writing can only take place before blank
     tape, an EXTENDED file mark, or at BOT.  Thus if several backups
     have been made on one tape and you wish to overwrite one of the
     backups, position the tape to the place you wish to start writing
     and issue the following commands:
	tctl bsf 1
	tctl eof 1
     The first command skips back to the BOT side of the same file
     mark.  The second command rewrites the file mark (writing is
     allowed before extended file marks).  The erase head will erase
     data ahead of the write head, so that after writing the file mark
     the head will be positioned before blank tape.  Only after this
     may you start writing over data in the middle of the tape.  (All
     data beyond where you are currently writing will be lost).  Note
     that you cannot write over short file marks.  In order for this to
     work, the tape must have been written with extended file marks
     (use smit to change this).

     With the 9-track drive writing can take place anywhere on the
     tape although overwriting single blocks of data is not supported.

     On the 8mm drive extended filemarks use 2.2 megabytes of tape and
     can take up to 8.5 seconds to write.  Short filemarks use 184K
     and take up to 1.5 seconds to write.

BLOCK SIZES:
     When data is written to tape it is written in blocks.  The blocks
     on a tape are separated by inter-record gaps.  It is important to
     understand the structure of the written tape in order to
     understand the problems which can occur with changing block
     sizes.

     In fixed block size mode all blocks on the tape are the same
     size.  They are the size of the block size set in the device
     configuration.  All read()s and write()s to the tape drive must be
     a multiple of the fixed block size.

     In fixed block mode a read() will return as many blocks as needed
     to satisfy the read() request.  If a file mark is encountered
     while reading the tape only the data up until the file mark will
     be returned.

     It is not possible for the tape drive to read a tape whose block
     size is not the same as the block size in the device
     configuration.  (Unless the device configuration is in variable
     size blocks.)

     In variable block size (0) mode, the blocks written on the tape
     are the size of the read() and write() requests to the device
     driver.  In this case, the actual block sizes on the tape can be
     changed using the options to the backup commands (tar -C, cpio -C,
     backup -C).

     In variable mode, read() requests greater than size of the block
     on the tape will return only the data from the next block on the
     tape.  It is this feature that allows tapes written in any block
     size (fixed or variable) to read with the dd command (the output
     from the dd command may be piped to restore, tar, or cpio for
     example.)  Note that backup, tar, and cpio cannot read all tapes
     by using a large block size because they assume there is an error
     if they get a short read().
		dd ibs=128k obs=16k if=/dev/rmt0 | ...

     The tape head is always positioned at an inter-record gap, file
     mark, or blank tape after reading or writing.

     With the 8mm tape drive, using a fixed block size which is not a
     multiple of 1K is inefficient.  The 8mm tape drive always writes
     internally in 1K blocks.  It simulates the effect of variable
     block sizes, but, for example, using a fixed block size of 512
     bytes (or using variable block size and write()ing 512 bytes at a
     time) wastes one half of the tape capacity and gives only one half
     the maximum transfer rate.

     To figure out a tape's actual block size try:

     1). Set the tape to variable block size.
     2). "dd if=<tape> of=/tmp/dummy bs=128k count=1"
     3). "ls -l /tmp/dummy"
     4). The number of bytes in "/tmp/dummy" is the physical block size.

EXCHANGING DATA WITH NON-UNIX AND OTHER VENDORS MACHINES:
     Many tape drives support both variable and fixed block sizes.

     Variable block mode writes block sizes the size of the write
     command issued (tar and backup specify this with the -b option). 
     In fixed mode, block sizes are fixed and all writes must be a
     multiple of the fixed block size.

     Unix often internally chops larger reads and writes up into
     manageable pieces (often 65535, 65534, or 65532 bytes) before
     doing the actual reads and writes.  This means reads and writes of
     64K bytes are often broken up into a 65535 byte record and a 1
     byte record (In fixed mode the write will fail).  Block sizes >=
     64K (-C128 and greater) should be avoided for this reason.  AIX
     does not break up read and write requests, but be aware of the
     situation on other machines.

     If the tape is written in an unknown block size then set the
     device configuration in smit to use variable size blocks, use the
     "dd" command with a large input block size, and pipe it to the
     restore command.  For example:
	  chdev -l rmt0 -a block_size=0
	  dd if=/dev/rmt0 ibs=128k obs=16k | tar -tvf-
Newsgroups: comp.unix.aix,comp.answers,news.answers
From: jum@anubis.han.de
Approved: news-answers-request@mit.edu
Followup-To: comp.unix.aix
Supersedes: <aix-faq-2-886305604@anubis.han.de>
Reply-To: jum@anubis.han.de (Jens-Uwe Mager)
Keywords: AIX RS/6000 questions answers
Sender: jum@baghira.han.de (Jens-Uwe Mager)
Expires: Sun, 5 Apr 1998 05:01:07 GMT
Organization: At Home
Message-ID: <aix-faq-2-888724807@anubis.han.de>
References: <aix-faq-1-888724807@anubis.han.de> 
Date: Sun, 1 Mar 1998 04:00:18 GMT
         and their answers.  AIX is IBM's version of Unix.
Path: news.univie.ac.at!aconews.univie.ac.at!newscore.univie.ac.at!newsfeed.nacamar.de!uni-erlangen.de!uniol!news.rz.uni-hildesheim.de!baghira.han.de!jum
Lines: 1311
Xref: news.univie.ac.at comp.unix.aix:125558 comp.answers:29709 news.answers:39487

Posted-By: auto-faq 3.3 (Perl 4.035)
Archive-name: aix-faq/part2
Posting-Frequency: monthly


------------------------------

1.201: How do I do remote backup?

There seems to be several ways of doing this.  The first approach is a
one-liner to allow tar to reference another machine's device.  The
second is more complete but uses a similar approach.  The latest
addition to this section claims to be able to support mksysb on a
remote machine.  Thanks to all the contibutors.

  tar -b1 -cf - . | rsh REMOTEHOST "dd ibs=512 obs=1024 of=/dev/TAPEDEVICE"

[Ed.: The usave.sh script has been moved to section 8.06.  I've verified
this script works fine. However, it may be slow for large filesystems
since it creates a temp file of filenames in /tmp.]

There are also several commercial solutions.  One is IBM's SYSBACK/6000
product.  See Question 1.209 for more information.

Open Microsystems sells a product called DistribuTAPE which supports
mksysb to a remote tape drive under AIX 3.2, 4.1 and 4.2.  DistribuTAPE
supports remote tape drives by placing a pseudo tape driver on the
client system, and a server daemon on the server.  More information at
http://www.openmic.com/

------------------------------

1.202: How do I backup a multi-disk volume group?
From: pack@acd.ucar.edu (Daniel Packman)

[ Ed.: I have not verified this procedure. I would actually recommend
  NOT to have one volume group span multiple disks unless you really
  need such big logical volumes. ]

  1. If you have a set of three or more disks in a volume group
     (typically 3 for 5xx machines with three internal drives;
     with only two, the procedures outlined here have to be modified
     to ignore the fact that you don't have a quorum in the volume group)

  2. If one drive has failed (usually only one fails at a time :-) )

It is possible to go through a service boot (the volume group is called
rootvg and one of the 2 good disks on it is called hdisk0):

  importvg -y rootvg hdisk0
  varyonvg -f -n -m1 rootvg

These commands will work, but give error messages. If you wish to mount
a user filesystem, say /u on logical volume /dev/lv00, then

  mount -f /dev/lv00 /v

will work only if jfslog, the journaled file system log device, is not
on the damaged disk. If it is, you must (and can in any case) mount the
filesystem read-only:

  mount -f -r /dev/lv00 /v

This crucial and rather obvious point baffled several level 3 support
personnel at Austin as well as myself for almost a week. Once the file
system(s) of interest are available, they can be saved to tape for
restoration later. Of course, one can expect only about two thirds of a
filesystem to be recoverable if it spans all 3 physical disks. One
other point to remember is that the standard boot procedure from floppy
includes the restore command but does not include the backup command.

*****************************************************************************
* If you do not have other RS6000 machines at your site it is imperative    * 
* that you either build a bootable tape which includes either restore or    * 
* tar or cpio (a bootable floppy set will not have enough space) or at the  *
* very least copy onto a spare floppy backup, cpio, or tar.  The floppy     *
* should be created with backup -ivq so that its contents can be read into  *
* the memory resident system after booting.                                 *
*****************************************************************************

All is not lost if tar, cpio or backup are available on an undamaged
disk that can be mounted. Since tar and cpio are in /bin, they may both
very well be unavailable.

It is a very good idea for those who have tape devices to build a
bootable tape with their desired extra commands in it. Follow the
instructions from IBM but add your desired commands to the following
three files:

    /usr/lpp/bosinst/tape2
    /usr/lpp/bosinst/diskette/boot2
    /usr/lpp/bosinst/diskette/inslist

If you have anything other than a minimum memory configuration, you
should be able to add many commands.

------------------------------

1.203: How do I put multiple backups on a single 8mm tape?
From: kerm@mcnc.org (Cary E. Burnette)

There are two possible solutions to this, both of which use /dev/rmt0.1
which is non-rewinding.

SOLUTION #1
-----------

To put multiple backups on a single tape, use /dev/rmt0.1, which is a
no-rewind device, using either rdump or backup (both by name & inode
work). Using rdump or backup "byinode" both generate the message that
the tape is rewinding but actually do not. This is an example that
works on my system:

# rsh remote1 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
# rsh remote2 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
# tctl -f /dev/rmt0.1 rewind       # rewinds the tape

where I am implementing the command from host.

# restore -f /dev/rmt0.1 -s1 -tv

where the -s1 flag tells restore to go to the first record on the tape. 
Type the exact command again to get the second record. The -s(Number)
means go to Number record from this spot. It works pretty well.


SOLUTION #2
-----------
Steve Knodle, Educational Resources Center, Clarkson University

I use:
------------------- Dump.sh --------------------
CONTENTSFILE=`date |dd conv=lcase |sed -e 's/19//' |awk '{print $6 $2 $3}'`
set -x
LEVEL=$1
shift

backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /
backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /usr
backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /u
tctl -f /dev/rmt0 rewind

touch /usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /usr" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /u" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
tctl -f /dev/rmt0 rewind

I process the table-of-contents first by a little program that does
common prefix encoding, and then compress.

is reused.


Solution #3
-----------
   mount | grep jfs | cut -c27- | cut -d" " -f1 | \
     xargs -i backup -${LEVEL} -u -f /dev/rmt1.1 {} > ${DATE}.backup 2>&1

------------------------------

1.204: How can I make an exact duplicate of a tape over the network?

The challenge here is not to have to create a temporary file (disk space
limitation) and work across heterogeneous networks.

This script might work:

LOCAL=/dev/tape_dev
REMOTE=/dev/tape_dev
dd if=$LOCAL ibs=64k obs=512 | rsh remote_host dd ibs=512 obs=64k of=$REMOTE


From: pack@acd.ucar.edu (Daniel Packman)

Daniel provides the following perl script to convert from the known
world's function codes to AIX for compatibility.

#!/bin/perl
# Wrapper to convert input rmt requests to
# AIX 3.2 ioctl numbers.  We pass on all commands we don't understand
# I0 MTWEOF -> I10  STWEOF write and end-of-file record
# I1 MTFSF  -> I11  STFSF  forward space file
# I2 MTBSF  -> I12  STRSF  reverse space file
# I3 MTFSR  -> I13  STFSR  forward space record
# I4 MTBSR  -> I14  STRSR  reverse space record
# I5 MTREW  -> I6   STREW  rewind
# I6 MTOFFL -> I5   STOFFL rewind and unload tape
# I7 MTNOP  -> I0   (no-op? should ignore following count)
# I8 MTRETEN-> I8   STRETEN retension tape, leave at load point
# I9 MTERASE-> I7   STERASE erase tape, leave at load point
#I10 MTEOM (position to end of media ... no ibm equivalent?)
#I11 MTNBSF  (backward space file to BOF ... no ibm equivalent?)
@iocs = (10,11,12,13,14,6,5,0,8,7);
open(RMT,"|/usr/sbin/rmt") || die "Can't open pipe to rmt\n";
select(RMT);
$| = 1;
while (<STDIN>) {
  s/(^I)(\d$)/I$iocs[$2]/;
  exit 0 if $_ =~ /^[Qq]/;
  print RMT $_ ; }
exit 0;

------------------------------

1.205: What is tape block size of 0?
From: benson@odi.com (Benson I. Margulies)

Tape devices are generally split into two categories: fixed block and
variable block.  1/4" tape is the fixed block, and 8mm is variable.

On a fixed block size device, the kernel always sends data to the device
in suitable block size lumps, and varying the size passed to write(2)
(e.g., via the bs option to dd) gives the kernel more data to stream. 
On a variable block size device, the kernel writes to the device
whatever passed to it. On an 8mm, it had better be a multiple of 1024
to get efficient tape usage.

AIX has the World's Only Variable Block Size 1/4" tape drive. If you
use SMIT to set the block size to a nonzero value, AIX treats the device
as fixed block size, whether it is or not. By default, 8mm drives are
set to the same size as 1/4", 512 bytes. This is wasteful, but
otherwise mksysb and installp would fail.

If you set the block size to 0, the device is treated as variable block
size, and the size passed to write becomes the physical block size. 
Then if you use a sensible block size to dd, all should be wonderful.

------------------------------

1.206: Resetting a hung tape drive
From: Craig_Anderson@kcbbs.gen.nz (Craig Anderson)

A process accesses the tape drive. The process stops, exits, or whatever,
but still hold on to the drive. When this happens, the process cannot be
killed by any signal and the tape drive cannot be used by any other
process until the machine is rebooted.

The following should help:

RESET:

AIX, like most UNIX systems has no reset function for tape drives. You
can however send a Bus Device Reset (a standard SCSI message) to the
tape drive using the following piece of code. If the tape drive does
not respond to the BDR, then a SCSI Bus Reset will be sent (and this
will reset every device on the SCSI Bus). SCSI Bus resets are rather
extreme so you should refrain from using this program unnecessarily. 
But there are times (like after you've inserted a jammed/old/bad tape in
an 8mm drive), when there's no other way to reset the device other than
to shutdown and reboot (obviously you can power down and up an external
drive to reset it - and this would be the better choice).

This is actually documented in info, but can be hard to find and
there's no complete program.

/* taperst: resets the tape drive by sending a BDR to the drive. */
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/scsi.h>

int main(int argc, char **argv)
{
         /* This can be run only by root */

         if (argc != 2) {
             fprintf(stderr, "Usage: %s /dev/rmt#\n", argv[0]);
             return 1;
         }

         if (openx(argv[1], O_RDONLY, 0, SC_FORCED_OPEN) < 0) {
             perror(argv[0]);
             return 2;
         }
         return 0;
}

------------------------------

1.207: How do I read a mksysb tape with tar?
From: Marc Pawliger (marc@sti.com)

To recover specific files from a backup made with mksysb, try
$ tctl fsf 3
$ tar xvf/dev/rmt0.1 ./your/file/name


------------------------------

1.208: How do I read a 5Gbyte tape on a 2Gbyte drive?
Posted by: bobmet@clam.com (Robert Metcalf)

To read a 5Gbyte tape on a 2Gbyte drive, the
tape needs to have been created with a density setting of 20.

The following is from IBM's electronic ASKSUPPORT repository:
  
   R: The 7208 011 5 GB tape drive has various density settings which are
      as follows:
  
     +-------+--------------------------+
     | DENSIT| DESCRIPTION              |
     | SETTIN|                          |
     +-------+--------------------------+
     | 140   | Writes in 5.0GB mode and |
     |       | will enable data com-    |
     |       | pression; also, to do    |
     |       | compression you must use |
     |       | "DATA COMPRESSION = yes" |
     +-------+--------------------------+
     | 21    | Writes in 5.0GB mode and |
     |       | will NOT do data com-    |
     |       | pression                 |
     +-------+--------------------------+
     | 20    | Writes in 2.3GB mode and |
     |       | will NOT do data com-    |
     |       | pression                 |
     +-------+--------------------------+
     | 00    | Factory power-on default |
     |       | for 5.0GB data com-      |
     |       | pression mode            |
     +-------+--------------------------+
  
     The density setting of the 7208 011 must be 20 for it to make a tape
     that is readable by the 7208 001.


------------------------------

1.209: What can Sysback do for me?
From: johnsont@austin.ibm.com (Tony Johnson)

Sysback provides the flexibility of restoring onto the same system in
the exact same manner, or onto a completely different system with
differnet disk configuration, platform type, kernel, etc, while
reporting any inconsistencies and allowing you to adjust to fit. For
instance, you will get warnings if a particular volume group cannot be
created because the original disks to not exist, or that mirroring
cannot be accomplished because there is no longer enough disk space
because the disks are smaller. You can then select the disks for each
volume group, reduce or add space to filesystems and LVs, exclude
entire VGs or filesystems, etc.  You can even add and delete mirrors,
stripe or un-stripe logical volumes, etc.

In addition, all of the Sysback functions can be performed across the
network, including network boot and network install, and you can
perform striped backups across multipel tape drives, use sequential
tape autoloaders, and perform unattended multi-volume backups with
cron.

ON AIX 3.2, mksysb does not retain paging space config, disk LV
placement, mirroring, etc.

On AIX 4.1, it does these on an EXACT same configuration, but does not
allow any flexibility, and still does not retain non-rootvg volume
groups (although you can now use additional commands to backupa nd
restore these).  mksysb also does not allow you to clone onto
different platforms (i.e.  rspc -> rs6k -> rs6ksmp).


------------------------------

1.210: How can I get my HP 4mm DAT to work?

For HP25470/80A DDS:
   MRS disabled: Set switches 3,6,7,8=0 and 1,2,4,5=1
   MRS enabled:  Set switches 3,6,7=0 and 1,2,4,5,8=1

------------------------------

1.211: How do I copy DAT tapes?

If you have two drives try tcopy(1).  Otherwise the traditional UNIX
approach is ( dd if=/dev/rmt0 bs=1024b | dd of=/dev/rmt1 bs=1024b )
Put that in a while loop using a non-rewinding device to do multiple
files.  To use drives from two different machines either get the GNU
dd (bundled with GNU tar) or use something like.

  $ dd if=/dev/rmt0 bs=1024b | rsh hostname dd of=/dev/rmt0 bs=1024b


------------------------------

1.212: How do I speed up backups to DLT tapes?

DLT tapes need high data rates to stay in streaming mode. To achieve
higher data rates, use a variable length block size by setting the fixed
length block size to zero. Also use a buffer size of about 64KB for
backup (128 blocks for tar).

------------------------------

1.300: Some info about the memory management system
From: Michael Coggins (MCOG@CHVM1.VNET.IBM.COM).

1. Does AIX use more paging space than other unix systems?

Under many scenarios, AIX requires more paging space than other unix
systems. The AIX VMM implements a technique called "early allocation of
paging space". When a page is allocated in RAM, and it is not a
"client" (NFS) or a "persistent" (disk file) storage page, then it is
considered a "working" storage page. Working storage pages are commonly
an application's stack, data, and any shared memory segments. So, when
a program's stack or data area is increased, and RAM is accessed, the
VMM will allocate space in RAM and space on the paging device. This
means that even before RAM is exhausted, paging space is used. This
does not happen on many other unix systems, although they do keep track
of total VM used.

Example 1: 
Workstation with 64mb RAM is running only one small application that
accesses a few small files. Everything fits into RAM, including all
accessed data. On AIX, some paging space will already be used. On
other unix systems, paging space will be 100% free. Clearly, this is an
example that shows where we use more paging space than the other machines.

Example 2:

Same machine as above, except we are in an environment where many
applications are running with inadequate RAM. Also, the system is
running applications that are started, run, left idle, and not in
constant use. A session of FRAME running in a window, for example. 
What happens is that eventually (theoretically) all applications will be
paged out at least once. On the AIX system and the other systems the
total paging requirements will be the same (assuming similar malloc
algorithm). The major difference is that the AIX system allocated the
paging space pages before they were actually needed, and the other
systems did not allocate them until they were needed. However, most
other systems have an internal variable that gets incremented as virtual
memory pages are used. AIX does not do this. This can cause the AIX
system to run out of paging space (virtual memory), even though malloc()
continues to return memory. This "feature" allows sparse memory
segments to work, but requires that all normal users of malloc()
(sbrk()) know how much virtual memory will be available (actually
impossible), and to handle a paging space low condition. A big problem. 
There are some pretty obvious pros and cons to both methods of doing
Virtual Memory.

2. How much paging space do I need?

Concerning the rule of thumb of having 2 times RAM for paging space:
this is rather simplistic, as are most rules of thumb.  If the machine
is in a "persistent storage environment", meaning that they have a few
small programs, and lots of data, they may not need even as much as 1
times RAM for paging space.  For example, a 1GB database server running
on a 6000 with 256MB of RAM, and only running about 50MB of "working"
storage does not need 512MB of paging space, or even 256MB.  They only
need the amount of paging space that will allow all their working
storage to be paged out to disk.  This is because the 1GB database is
mostly "persistent storage", and will require little or no paging space. 
Excessive paging space may simply mean wasted disk space.  However,
avoid insufficient paging space.  Tip: Don't have more than one paging
space per disk.  Tip: Put lots of RAM in your system - it will use it.

3. Why does vmstat show no free RAM pages?

AIX uses RAM as a possibly huge disk buffer.  If you read a file in the
morning, that file is read into RAM, and left there.  If no other
programs need that RAM, that file will be left in RAM until the machine
is halted.  This means that if you need the file again, access will be
quick.  If you need that RAM, the system will simply use the pages the
file were using. The pages were flushed back to disk earlier.  This
means that you can get a huge speedup in disk access if you have enough
RAM.  For example, a 200MB database will just ease into RAM if you have
a 256MB system.

4. Since vmstat shows no free RAM pages, am I out of RAM?

Probably not. Since disk files will be "mapped" into RAM, if vmstat
shows lots of RAM pages FREE, then you probably have too much RAM (not
usual on a RISC System/6000)!

5. Shouldn't the "avm" and the "fre" fields from vmstat add up to something?

No. The "avm" field tells you how much "Active Virtual Memory" AIX
thinks you are using. This will closely match the amount of paging
space you are using. This number has *ABSOLUTELY* nothing to do with
the amount of RAM you are using, and does *NOT* include your mapped
files (disk files).  The amount of RAM can be determined with
/usr/sbin/bootinfo -r

6. Why does the "fre" field from vmstat sometimes show lots of free
   RAM pages?

This will happen after an application that used a lot of RAM via
"working" storage (not NFS storage, and not disk file or "persistent"
storage) exits. When RAM pages that were used by working storage (a
program's stack and data area) are no longer needed, there is no need to
leave them around. AIX completely frees these RAM pages. The time to
access these pages versus a RAM page holding a "sync'd" mapped file is
almost identical. Therefore, there is no need to periodically "flush" RAM.

7. Is the vmstat "fre" field useful?

The vmstat "fre" field represents the number of free page frames.  If
the number is consistently small (less than 500 pages), this is normal. 
If the number is consistently large (greater than 4000 pages), then you
have more memory than you need in this machine.

------------------------------

1.301: How much should I trust the ps memory reports?
From: chukran@austin.VNET.IBM.COM

Using "ps vg" gives a per process tally of memory usage for each running
process.  Several fields give memory usage in different units, but these
numbers do not tell the whole story on where all the memory goes.

First of all, the man page for ps does not give an accurate description
of the memory related fields.  Here is a better description:

RSS - This tells how much RAM resident memory is currently being used
for the text and data segments for a particular process in units of
kilobytes.  (this value will always be a multiple of 4 since memory is
allocated in 4 KB pages).

%MEM - This is the fraction of RSS divided by the total size of RAM for
a particular process.  Since RSS is some subset of the total resident
memory usage for a process, the %MEM value will also be lower than actual.

TRS - This tells how much RAM resident memory is currently being used
for the text segment for a particular process in units of kilobytes. 
This will always be less than or equal to RSS.

SIZE - This tells how much paging space is allocated for this process
for the text and data segments in units of kilobytes.  If the executable
file is on a local filesystem, the page space usage for text is zero. 
If the executable is on an NFS filesystem, the page space usage will be
nonzero.  This number may be greater than RSS, or it may not, depending
on how much of the process is paged in.  The reason RSS can be larger is
that RSS counts text whereas SIZE does not.

TSIZ - This field is absolutely bogus because it is not a multiple of 4
and does not correlate to any of the other fields.

These fields only report on a process text and data segments.  Segment
size which cannot be interrogated at this time are:

       Text portion of shared libraries (segment 13)

       Files that are in use. Open files are cached in memory as
       individual segments.  The traditional kernel cache buffer
       scheme is not used in AIX 3.

       Shared data segments created with shmat.

       Kernel segments such as kernel segment 0, kernel extension
       segments, and virtual memory management segments.

Speaking of kernel segments, the %MEM and RSS report for process zero
are totally bogus for AIX 3.1.  The reason why RSS is so big is that the
kernel segment zero is counted twice.  For AIX 3.2, this has been
changed, but the whole story is still not known.  The RSS value for
process 0 will report a very small number of the swapper private data
segment.  It does not report the size of the kernel segment 0, where the
swapper code lives.

In summary, ps is not a very good tool to measure system memory usage. 
It can give you some idea where some of the memory goes, but it leaves
too many questions unanswered about the total usage.

------------------------------

1.302: Which simms do RS6000's use?

This answer is under construction... I'm trying to collect details
about compatable simms.

RS/6000 220,230 USE 2 pair 70ns PS/2 style simms
RS/6000 250,C10 USE 4 pair 70ns PS/2 style simms

------------------------------

1.303: What is kproc?

kproc (always PID 514 on AIX 3 and PID 516 on AIX 4) is the kernel's
idle process.

------------------------------

1.304: How do I create a RAM disk in AIX?
From: Jeff Wang <hjiwa@nor.chevron.com>

You can't create a RAM disk in AIX.  The closest related functionality
the operating system gives you is the RAM disk buffer. Read 1.300
sub-section 3.

------------------------------

1.305: How much RAM (real memory) does my machine have?
From: Michael Abel/resnova
	<Michael_Abel/resnova%RESNOVAD@notesgw.compuserve.com>

As     root:  bootinfo -r
As any user:  lsattr -E -l sys0 -a realmem

lsattr -C -c memory

shows all memory adapters.  On MCA systems one may add up the values
displayed for each memory card in order to sum up to the amount of
total memory.  On PCI systems only one item (mem0) is
displayed. Additional information may be displayed with

lsattr -E -lmem0

These commands were tested on various IBM systems running AIX relases
3.2.5 and 4.1.4

------------------------------

1.306: Why do PIDs run non-sequentially?
From: Julianne F. Haugh <jfh@austin.ibm.com>

The answer (I was there, consider me an authority ...) is that the
PIDs needed to be somewhat unpredictable.  This is because AIX was
originally designed with a number of C2 and B1 features, and one of those
is the notion of covert channel analysis.  Sequential PIDs are a covert
channel (assuming the system has one PID namespace ...) since the value
of the "next" PID is shared by all currently running processes.  So if I
want to sneak some of my classified data out to your co-operating
non-classified program, I can do it by carefully controlling the value
of the "next" PID.

------------------------------

1.400: How do I make an informative prompt in the shell?

In the Korn Shell (ksh), the PS1 variable is expanded each time it is
printed, so you can use:

$ export myhost=`hostname`
$ PS1='$LOGNAME@$myhost $PWD \$ '

to get, e.g. 

bengsig@ieibm1 /u/bengsig $

In the C-shell, use:

% set myhost=`hostname`
% alias cd 'chdir \!* > /dev/null; set prompt="$LOGNAME@$myhost $cwd % "'
% cd

to get, e.g.

bengsig@dkunix9 /u/bengsig/aixfaq %

There is no easy solution in the Bourne Shell.  Use the Korn Shell instead.

------------------------------

1.401: How do I set up ksh for emacs mode command line editing?

The ksh has an undocumented way of binding the arrowkeys to the emacs
line editing commands. In your .kshrc, add:

alias __A=`echo "\020"`   # up arrow = ^p = back a command
alias __B=`echo "\016"`   # down arrow = ^n = down a command
alias __C=`echo "\006"`   # right arrow = ^f = forward a character
alias __D=`echo "\002"`   # left arrow = ^b = back a character
alias __H=`echo "\001"`   # home = ^a = start of line

Type "set -o emacs" or put this line in your .profile.

Also, you MUST have PTF U406855 for this to work in AIX 3.2.  The APAR #
for the problem is IX25982, which may have been superseded.

------------------------------

1.402: Listing files with ls causes a core dump
From: Julianne F. Haugh <jfh@austin.ibm.com>

Scenario: a directory that is shared by N users (N >= 200).
Run 'ls -l' in that directory.  It goes for a while, then
Seg fault(coredump)!

It only occurs when the usernames are displayed (almost every file is
owned by a different person).  The -g and -n options work fine; only -l
and -o (which shows owner and not group) cause it. 

I believe that this problem was corrected by U407548.  If you have that
many users that you are having core dump problems (it took over 200),
you might also want to look into getting the PTF that fixes IX31403. 
That APAR deals with large numbers of accounts and performance problems
associated with looking them up.

------------------------------

1.403: How do I put my own text into InfoExplorer?

With AIX 3.1, you cannot do it.  AIX 3.2 has a product called
InfoCrafter that allows you to do that.

------------------------------

1.404: InfoExplorer ASCII key bindings 
From: mycroft@hal.gnu.ai.mit.edu (Charles Hannum)

If you just press 'Return' when it starts up, with 'Basic Screen
Operations' highlighted, you'll get some help.

If you look long enough, you'll find a page named 'Using Keys and Key
Sequences in the InfoExplorer ASCII Interface'.  It describes the key
sequences and actions.  Here are a few to get you started.

Keys       Action

Ctrl-W     Moves between the Navigation screen and the Reading screen.
If the Navigation screen is displayed, you can press Ctrl-W to display
the Reading screen.  If the Reading screen is displayed, you can press
Ctrl-W to display the Navigation screen.

Ctrl-O     Makes the menu bar active or inactive.  If your text cursor is
located in the text area of the screen, you can press Ctrl-O to make the
menu bar active.  If the menu bar is already active, you can press
Ctrl-O to make it inactive, which moves the text cursor to the text area.

Tab     Moves to the next menu bar option in the menu bar.  If a pull-down
menu is not displayed and you press the Right Arrow key, the next menu
bar option is displayed in reverse video.
 
------------------------------

1.405: How can I add new man pages to the system?
From: horst@faui63.informatik.uni-erlangen.de (Horst Luehrsen)

Put the man pages in /usr/man, e.g. /usr/man/man1/tcsh.1 for the tcsh
man page.  Under AIX 3.1.10, /usr/lib/makewhatis can be used to update
the makewhatis-database /usr/man/whatis so apropos and whatis know about
the added manpages.  /usr/lib/makewhatis should be available on all 3.2
versions.

For AIX 4.x, you can store the man pages in the /usr/share/man hierarchy.
/usr/lib/makewhatis is still there.

------------------------------

1.406: Why can't I read man pages?  Where is nroff?

Nroff and troff aren't in the base installation.  It is shipped as
part of AIX 3.2.5 but may not be installed.  Use smit to install a
software package called txtfmt.tfs.obj from your 3.2.5 distribution
media.

In AIX 4.x, you need bos.txt.tfs.

------------------------------

1.407: Why is my environment only loaded once?

The .profile file is only loaded once (for your login shell) subsequent
shells should be initialized by setting ENV=$HOME/.kshrc (for ksh).

Bash users can use $HOME/.bash_profile for the login shell environment
and $HOME/.bashrc.

------------------------------

1.408: Where is the 'nawk' command on my AIX system?
From: Jeff Wang <hjiwa@nor.chevron.com>

The /bin/nawk that exists on many UNIX flavors is a superset of the
'awk' command, revised by the same original authors to include added
functionality.  All the extra options normally associated with 'nawk'
on other UNIXes have been incorporated into the AIX version of 'awk';
the AIX 'awk' InfoExplorer or man pages include nawk-specific features
such as the "-v" command line option and atan2(), rand(), srand(),
match(), sub(), gsub(), system(), close(), getline functions.

If your AIX version is missing /bin/nawk (as are most AIX 3.x
versions), the simplest way to get around this and maintain script
portability between UNIX platforms is to make a /bin/nawk link to
/bin/awk (as root, of course).  If you do not have root privilege or
do not want to create a /bin/nawk link, to make the script work on
different UNIXes, you may have to test `uname` first and set all
'nawk' references on AIX runs to /bin/awk.  If your script is to only
run on AIX systems, you can just change all references of 'nawk' to
'awk' and everything should still work okay...but check the AIX awk
script on test data prior to making actual runs.

[Editor's note: AIX 4.x already contains a link from /usr/bin/nawk
to /usr/bin/awk.]

------------------------------

1.409: How do I copy InfoExplorer (manpages and more) to my hard drive?
From: David Alexander <unilink@online.rednet.co.uk>

[Editor's note: While this is documented in one of the AIX manuals
and covered in /usr/lpp/bos/bsdadm (AIX 3 only), it comes up often
enough I thought I would include it here.]

Not all the Info databases are required, so do not copy them all unless the 
customer specifically requests them, or has asked for the software they 
refer to.  These instructions assume you have enough space on /usr.

	Install and mount the InfoExplorer CD-ROM as for use of Info 
	from CD-ROM.

	Log in as Root
	umount /usr/lpp/info/lib/$LANG
	mkdir /mnt/$LANG
	mount -v cdrfs -r /dev/cd0 /mnt/$LANG

	cd /
	cd /mnt/$LANG
	cp -r aix /usr/lpp/info/lib/$LANG
	cp -r aix2 /usr/lpp/info/lib/$LANG
	cp -r compnav /usr/lpp/info/lib/$LANG
	cp -r hardware /usr/lpp/info/lib/$LANG
	cp -r nav /usr/lpp/info/lib/$LANG
	cp -r prog /usr/lpp/info/lib/$LANG
	cp -r uiprog /usr/lpp/info/lib/$LANG

	Other sections can be copied if required:
	Section						Size
	cp -r ada /usr/lpp/info/lib/$LANG		7.2  Mb
	cp -r assemb /usr/lpp/info/lib/$LANG		5.23 Mb
	cp -r cxx /usr/lpp/info/lib/$LANG		6.52 Mb
	cp -r dce /usr/lpp/info/lib/$LANG		3.8  Mb
	cp -r encina /usr/lpp/info/lib/$LANG		2.67 Mb
	cp -r fortran /usr/lpp/info/lib/$LANG		6.85 Mb
	cp -r graph /usr/lpp/info/lib/$LANG		9.75 Mb
	cp -r graph2 /usr/lpp/info/lib/$LANG		4.1  Mb
	cp -r pascal /usr/lpp/info/lib/$LANG		3.23 Mb

	umount /mnt/$LANG
	eject the CD-ROM

------------------------------

1.410: Why can't I set my default shell to one we've just installed?

When adding new shells to the system, add them to the "shells=" line
in /etc/security/login.cfg so they can be used during ftp and rlogin
by users who use them as their default shell.

------------------------------
 
1.411: Why do I get the "Unable to connect socket: 3"
                starting Info-Explorer?

It's a bug in the way infod sets the initial permission on the            
/tmp/.info-help socket. Do a chmod 777 on /tmp/.info-help and the
message will go away. (Charlie McGuire, mcguire@cs.umt.edu)

This problem was fixed by APAR IX43230, PTF U432315
(Paul Sitz, psitz@empros.com)

------------------------------

1.412: Why can't I write a setuid shell script?
From: mww@microfocus.com (Michael Wojcik)

AIX, as of about the first release of 3.2.5* does not allow SUID scripts.
(It ignores the SUID and SGID bits on scripts.)  They're a huge security
hole.

If you really want to run a script SUID, you can create a small C program
that does a setuid(0) and then system()'s your script.  (Actually, the
setuid() call isn't necessary on all Unixes; IIRC, it's not on AIX 3.2.5,
but YYMV.)  Make the program SUID.  Be very careful.

There are other similar solutions.  You might also want to look into
sudo, which handles this sort of thing in a somewhat more controlled
manner

* Julianne Frances Haugh (jfh@tab.com) writes:

I raised an objection to set-ID shell scripts before AIX 3.1 was
golden.  ... it was finally done in the 3009 PTF for AIX 3.1.

------------------------------

1.500  Which release of X11 do I have?

AIX 4.x includes X11 R5 and Motif 1.2.

On AIX 3, Run 'lslpp -h X11rte.obj'.
If your output has a line similar to:

            01.02.0000.0000 COMPLETE   COMMIT     03/04/93   02:05:11 root

you have X11 R4. If your output has a line similar to:

    U491068 01.02.0003.0000 COMPLETE   COMMIT     07/28/93   12:50:42 root

you have X11 R5. Some people also call these AIXwindows 1.2.0 and
1.2.3.  'lslpp -h X11rte.motif1.2.obj' should tell you if you are
running Motif 1.2.


------------------------------

1.501: How to prevent ctrl-alt-backspace from killing the X session

Start X with 'xinit -T' to disable ctrl-alt-backspace from stopping X.

------------------------------

1.502: Who has a termcap/terminfo source for the HFT console?

The console used on the RISC System/6000, PS/2 and RT can be used as a
terminal on another system with the termcap below.  You can find this
and other termcaps in /lib/libtermcap/termcap.src, including IBM
specific ones.  The terminfo sources are stored in /usr/lib/terminfo/*.ti.
This termcap can also be used from an aixterm window.

hf|hft|hft-c|ibm8512|ibm8513|IBM_High_Function_Terminal:\
	:co#80:li#25:am:ht:\
	:cm=\E[%i%d;%dH:ti=\E[25;1H:te=\E[20h:\
	:nd=\E[C:up=\E[A:do=^J:ho=\E[H:\
	:bs:sf=\E[S:ec=\E[%dX:\
	:cl=\E[H\E[J:cd=\E[J:ce=\E[K:\
	:AL=\E[%dL:DL=\E[%dM:al=\E[L:dl=\E[M:\
	:im=\E[4h:ei=\E[4l:mi:\
	:dm=\E[4h:ed=\E[4l:\
	:so=\E[7m:se=\E[m:ul=\E[4m:ue=\E[m:\
	:md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:\
	:as=^N:ae=^O:sc=\E[s:rc=\E[u:\
	:kl=\E[D:kb=^H:kr=\E[C:ku=\E[A:kd=\E[B:kh=\E[H:\
	:kn#10:k1=\E[001q:k2=\E[002q:k3=\E[003q:k4=\E[004q:k5=\E[005q:\
	:k6=\E[006q:k7=\E[007q:k8=\E[008q:k9=\E[009q:k0=\E[010q:\
	:is=\Eb\E[m^O\E[?7h:rs=\Eb\E[m^O\E[?7h\E[H\E[J:

------------------------------

1.503: How can I look at PostScript files?  Why is "dpsexec" so lousy?
From: Marc Pawliger <marc@sti.com>

showps comes with the 1.2.3 (X11R5) version of the X11rte.ext.obj LPP.
Very nice PS file previewer from Adobe.  Replaces xpsview which came
with pre-1.2.3 Installed as /usr/lpp/DPS/showps/showps

From: VRBASS@ATLVMIC1 (Vance R. Bass)

You can look at PostScript files using either "xpreview" (in the
optionally installable text formatting services) or you can get
Ghostscript and Ghostview from a comp.sources.x server and build it
yourself.

>From the "xpreview" man page:
The xpreview command is an AIXwindows 1.2- and Motif 1.1-based
application that displays output from the troff command on an AIXwindows
display.  The troff command output file must be prepared for any one of
the devX100, devX100K or devpsc devices.  The xpreview command also
displays PostScript language files that begin with %!.

"dpsexec" is NOT intended to be a full-service document browser, but
rather a simple DPS code debugger.  If you insist on using it, you can
edit your PS code to remove the "showpage" (which will reset dpsexec
and clear the window) to view single-page files.  It does not handle
multi-page files gracefully.

------------------------------

1.504: unix:0 vs `hostname`:0

1.) Is there any way to get the machine to check its local host table
    first without renaming resolv.conf?

[AIX 3.2 only]
PTF U412845 implements an environment variable to set the resolver
time out in AIX 3.2.  This allows you to set RES_TIMEOUT to the number
of seconds before it times out, a failing a DNS query the machine will
consult /etc/hosts.  

2.) How do you tell X applications where you are if the console display 
    is unix:0?

From: David L. Crow <crow@waterloo.austin.ibm.com>

  I would suggest that if you have R5, use ":<display>.<screen>".  I do
  not believe that R4 clients will understand :0, so I would suggest
  unix:0 for them.

  Without specifying unix or the hostname, you will get the fastest
  transport mechanism.  While currently there are only two transport
  methods in the AIXwindows X server (Unix sockets and TCP sockets),
  many vendors are looking at using shared memory as a transport method. 
  If you use :0 (or :0.0 or :1, etc.), then you should get the best
  performance regardless of the available transport methods.

From: Marc Pawliger <marc@sti.com>

  Using "unix:0" or "hostname:0" when the X11 Shared Memory Transport
(SMT) is installed as part of the 1.2.3 X11rte.obj (X11R5) will incur
a penalty vs. using ":0" See /usr/lpp/X11/README.SMT

3.) Is there a significant performance penalty incurred by using
    `hostname`:0 as DISPLAY?

  Yes! Using unix:0, you are using Unix sockets.  These are much faster
  than their TCP socket counterparts.

------------------------------

1.505: VT100 key bindings for aixterm
From: haedener@iac.unibe.ch <Konrad Haedener>

Add this to your .Xdefaults file and start your VAX session with
'aixterm -v -name vt100 -e telnet MYVAXHOST'

-----
vt100.vt102: true
vt100.fullcursor: false
vt100.translations:    <Key>F1: string(0x1b) string("OP") \n\
                       <Key>F2: string(0x1b) string("OQ") \n\
                       <Key>F3: string(0x1b) string("OR") \n\
                       <Key>F4: string(0x1b) string("OS") \n\
                       <Key>KP_0: string(0x1b) string("Op") \n\
                       <Key>KP_1: string(0x1b) string("Oq") \n\
                       <Key>KP_2: string(0x1b) string("Or") \n\
                       <Key>KP_3: string(0x1b) string("Os") \n\
                       <Key>KP_4: string(0x1b) string("Ot") \n\
                       <Key>KP_5: string(0x1b) string("Ou") \n\
                       <Key>KP_6: string(0x1b) string("Ov") \n\
                       <Key>KP_7: string(0x1b) string("Ow") \n\
                       <Key>KP_8: string(0x1b) string("Ox") \n\
                       <Key>KP_9: string(0x1b) string("Oy") \n\
                       <Key>KP_Divide: string(0x1b) string("OQ") \n\
                       <Key>KP_Multiply: string(0x1b) string("OR") \n\
                       <Key>KP_Subtract: string(0x1b) string("OS") \n\
                       <Key>KP_Add: string(0x1b) string("Om") \n\
                       <Key>KP_Enter: string(0x1b) string("OM") \n\
                       <Key>KP_Decimal: string(0x1b) string("On") \n\
                       <Key>Next: string(0x1b) string("Ol") \n\
                       <Key>Left: string(0x1b) string("OD") \n\
                       <Key>Up: string(0x1b) string("OA") \n\
                       <Key>Right: string(0x1b) string("OC") \n\
                       <Key>BackSpace : string(0x7f) \n\
                       <Key>Down: string(0x1b) string("OB")

You should also add

XENVIRONMENT=$HOME/.Xdefaults
export XENVIRONMENT

to your .profile.

------------------------------

1.506: Is there a screen saver that does not use excessive CPU?
From: Don Buchholz <buchholz@ese.ogi.edu>

Try using xlock with these options:

	xlock -mode life -count 1500 -nice 20 -root


From: pranav@evolving.com (Pranav Vakil)

Use mlock -hide to hide the background. You can also modify the mlock
(/usr/local/tools/mlock) code to allow the standard X screen saver to
take effect. The timeout value is originally set to 0 which means the
screen saver is off. Modify this to be 120 (2 minutes) and set the
interval time to be 60 (1 minute). Using these intervals, I have found
that over a 24 hour period, it uses only .3 cpu minutes.

------------------------------

1.507: Where are the colors, available for an X session, listed.

/usr/lpp/x_st_mgr/bin/rgb.txt and on AIX 4.2, the file is
/usr/lpp/X11/lib/X11/rgb.txt

------------------------------

1.508: Why does my app hang the X server but not an X station?
From: Bjorn P. Brox <brox@corena.no>

/usr/lpp/X11/README.SMT X client/server communication uses a 64k
buffer by default.  The size of this buffer is controled by the
X_SHM_SIZE environment variable increasing the size of the buffer has
been used to prevent some applications from hanging the X server :)

------------------------------

1.509: How do I switch the control and caps lock key bindings?

If you are running the X window system, you can put the following into
.xmodmaprc

  remove Lock = Caps_Lock
  remove Control = Control_L
  keysym Control_L = Caps_Lock
  keysym Caps_Lock = Control_L
  add Lock = Caps_Lock
  add Control = Control_L

Hidden Hint: Use (xmodmap -e "pointer = 3 2 1") to make the mouse
lefty friendly.

------------------------------

1.510: Missing fonts?

If your Xserver supports X11R5 try running a font server (edit
/usr/lib/X11/fs/config and run fsconf && startsrc -s fs) Consult your
Xserver instructions on how to include a font server in your font
path.

------------------------------

1.511: What's the termcap entry for an IBM 3151 look like?

#
# Written by Aleksandar Milivojevic, alex@srce.hr
# 24.09.1994
#
I2|ibm3151|3151|IBM 3151 terminal:\
	:am:mi:cr=^M:sf=^J:co#80:li#24:cd=\EJ:ce=\EI:cm=\EY%+\040%+\040:\
	:cl=\EH\EJ:dc=\EQ:dl=\EO:do=\EB:le=\ED:mb=\E4$a:md=\E4(a:\
	:me=\E4@\E>B:mr=\E4!a:nd=\EC:se=\E4>b:so=\E4!a:ue=\E4=b:up=\EA:\
	:us=\E4"a:kb=^H:kd=\EB:kh=\EH:kl=\ED:kr=\EC:ku=\EA:\
	:k1=\Ea\r:k2=\Eb\r:k3=\Ec\r:k4=\Ed\r:k5=\Ee\r:\
	:k6=\Ef\r:k7=\Eg\r:k8=\Eh\r:k9=\Ei\r:k0=\Ej\r:\
	:ti=\E>B:te=\E>B:ms:ho=\EH:bl=^G:al=\EN:ta=^I:

------------------------------

1.512: Errors starting X11 application binaries from aixpdslib.
From: <URL:ftp://aixpdslib.seas.ucla.edu/pub/README_X11R5_Stuff>

We have been aware of the problem people have with dynamic links
when running the prebuilt of X-stuffs from this library.

The typical error messages will be:

    Could not load program [program_name]
    Member shr4.o not found or file not an archive
    Member shr4.o not found or file not an archive
    Could not load library libXt.a[shr4.o]
    Error was: No such file or directory

It's because that we built the programs using X11 libraries of MIT
which are not compatible with those of IBM.  If this is the case,
then please get the compressed tarred file of the source code instead,
and recompile them on your system using your libraries.

------------------------------
1.513: .XShm*, .sm* (Shared memory) Link errors building 
                 Xwindows applications.

Link errors that refer to .XShm* often times are a result of compiling
applications to take advantage of the Shared Memory extension of the X
server.  You may either compile without shared memory or load the
shared memory extensions. (see /usr/lpp/X11/README and README.SMT) A
script for rebuilding your X server with the shared memory can be found
in /usr/lpp/X11/Xamples/server.

------------------------------

1.514: How do I set my DISPLAY when I login to another machine?

Though this is not a question specific to AIX, it appears often enough
to warrant an answer here.  There are lots of approaches, some of which
are described in the X Windows FAQ.  Most involve a little login shell
programing to parse the output of `who` or `who am i`.
<URL:ftp://boogle.uchicago.edu/pub/aix/src/hostwhence.tar.Z> by
e-siebert@uchicago.edu will help if you are willing/able to install it
suid.  See the X Windows FAQ and newsgroup for more information.

Hostwhence is also availabile in the "lsof" smit-installable package on
www-frec.bull.com. The installation scripts use ACLs to allow hostwhence to
read /dev/kmem without being set-uid-root.

------------------------------

1.515:  Why doesn't Netscape work?
From: "Gary R. Hook" <hook@austin.ibm.com>

The problem is that Netscape has statically linked libc into 
Mozilla.  When the AIX 3 libc code (setlocale()) tries to
load an AIX 4 locale, the two are incompatible and a core
dump ensues.  AIX 4 locales have to be loaded by AIX 4 libc.
Using LANG=C causes a lot of locale code to be bypassed, allowing
the application to avoid loading a non-C locale, and to continue
execution.

>From: Colin <apollo@randomc.com>
Here is a shell script that works around Netscape's problems by
setting the LANG and CLASSPATH environment variables.

#!/bin/sh
LANG=C
CLASSPATH=/path/to/java_30
export LANG CLASSPATH
if [ $# -eq 0 ]; then
   /path/to/netscape http://your.home.page &
else
   /path/to/netscape $* &
fi

------------------------------

1.600: My named dies frequently, why?
From: jpe@ee.egr.duke.edu (John P. Eisenmenger)

Running on 3.2, named dies frequently on network's primary name server.


Try the following:

     stopsrc -s named		# stop running named
     setenv MALLOCTYPE 3.1	# use 3.1 memory allocation algorithm
     /etc/named ...		# don't use smit to start named

You might be able to use startsrc/smit after setting MALLOCTYPE and get
the same effect, but I'm not sure.

[According to John, the problem is malloc() in the named code. He
 also suggests using Berkeley's bind, which he has ported and can be
 ftp'ed from ftp://ftp.egr.duke.edu/archives/bind-4.8.3.tar.gz. -ed]

Two ptfs should fix this problem. Get U412332 and U414752.

Christophe Wolfhugel <Christophe.Wolfhugel@grasp.insa-lyon.fr> reports
that bind 4.9 works fine on AIX 3.2 and without MALLOCTYPE=3.1.

------------------------------

1.601: How do I trace ethernet packets on an AIX system?
From: afx@muc.ibm.de (Andreas Siegert)

Do the following:

     iptrace -i en0 /tmp/ipt

The iptrace backgrounds.  Find its process id and kill it when you are
ready.  Then run

     ipreport -rns /tmp/ipt >/tmp/ipr

and look at the output.  The current version of Info does not document
the r, n and s options but they are quite useful for layering the output.

------------------------------

1.602 What is the authorized way of starting automount at boot time?
From: curt@ekhadafi.austin.ibm.com (Curt Finch)

I put this in my /etc/inittab:

automount:2:once:/usr/etc/automount -T -T -T -v >/tmp/au.se 2>&1

I hereby dub it authorized.

Jim Salter <jsalter@netscape.com> writes: You can also use the command:
'mkitab "automount:2:once:/usr/etc/..."' to avoid editing the file by hand.

------------------------------

1.603: How do I set a tty port for both dial-in and dial-out?

Set the mode of the tty to be either 'shared' or 'delayed'. 

------------------------------

1.604: How to move or copy whole directory trees across a network

The following command will move an entire directory tree across a network 
while preserving permissions, uids and gids.

      $rsh RemoteHost "cd TargetDir; tar -cBf - ." | tar -xvBf -

Explanation:

The tar-create is rsh'd to the remote system and is written to
stdout (the pipe).

The local system is extracting the tar that is being read from
stdin (the pipe).

From: abeloni <abeloni@hstern.com.br>

Another method is:

	rcp -rp host1:/dir host2:/dir

------------------------------

1.605: How can I send mail to hosts that cannot be pinged?
From: jupiter.sun.csd.unb.ca!dedourek (John DeDourek)

AIX 3.2 as shipped is configured to only send mail to mail addresses
which include a host name.  Many organizations use a mail address whose
"host name" part is not a host name (technically an MX name).  To change
the configuration of the AIX mailer, login as root.  Then edit the file
/etc/sendmail.cf to remove the comment marker ("# ") at the beginning of
the line which reads:
    # OK MX

Now rebuild the machine readable form of the configuration with
    sendmail -bz

and finally restart signal sendmail to load the new configuration by one
of the following:
     reboot
or
     stopsrc -s sendmail
     startsrc -s sendmail
or 
     kill -1 `cat /etc/sendmail.pid`

Newsgroups: comp.unix.aix,comp.answers,news.answers
From: jum@anubis.han.de
Approved: news-answers-request@mit.edu
Followup-To: comp.unix.aix
Supersedes: <aix-faq-3-886305604@anubis.han.de>
Reply-To: jum@anubis.han.de (Jens-Uwe Mager)
Keywords: AIX RS/6000 questions answers
Sender: jum@baghira.han.de (Jens-Uwe Mager)
Expires: Sun, 5 Apr 1998 05:01:07 GMT
Organization: At Home
Message-ID: <aix-faq-3-888724807@anubis.han.de>
References: <aix-faq-1-888724807@anubis.han.de> 
Date: Sun, 1 Mar 1998 04:00:22 GMT
         and their answers.  AIX is IBM's version of Unix.
Path: news.univie.ac.at!aconews.univie.ac.at!newscore.univie.ac.at!fu-berlin.de!news-ber1.dfn.de!news-lei1.dfn.de!news-nue1.dfn.de!uni-erlangen.de!uniol!news.rz.uni-hildesheim.de!baghira.han.de!jum
Lines: 1621
Xref: news.univie.ac.at comp.unix.aix:125559 comp.answers:29710 news.answers:39488

Posted-By: auto-faq 3.3 (Perl 4.035)
Archive-name: aix-faq/part3
Posting-Frequency: monthly


------------------------------

1.606: How to configure dialup SLIP

IBM's WWW page <http://www.ibm.com/> can lead you to a helpful document
<http://www.austin.ibm.com/pub/www/services/aix_service/faxes/SLIP.DOC.zap>

From: marvin@tornado.oche.de (Christian Bode)

If you don't have problems with slattach you should have PTF 
bos.obj 3.2.0.0.U411505 installed.  I assume that you did the right
ifconfig commands to setup your slip-device (for example sl0).

1. Create a group called slip.

2. Create a user slip with smit like this:
                                                     [Entry Fields]
* User NAME                                          [slip]
  ADMINISTRATIVE User?                                true
  User ID                                            []
  LOGIN user?                                         true
  PRIMARY group                                      [slip]
  Group SET                                          [slip]
  ADMINISTRATIVE groups                              [system]
  SU groups                                          [slip]
  HOME directory                                     [/home/slip]
  Initial PROGRAM                                    [/bin/sh]
  User INFORMATION                                   [SLIP-Dialup]
  Another user can SU to user?                        false
  User can RLOGIN?                                    true
  TRUSTED PATH?                                       nosak
  Valid TTYs                                         [/dev/tty1]
  AUDIT classes                                      []
  PRIMARY authentication method                      [SYSTEM]
  SECONDARY authentication method                    [NONE]
  Max FILE size                                      [2097151]
  Max CPU time                                       [-1]
  Max DATA segment                                   [262144]
  Max STACK size                                     [65536]
  Max CORE file size                                 [2048]
  Max physical MEMORY                                [65536]
  File creation UMASK                                [022]
  EXPIRATION date (MMDDhhmmyy)                       [0]

3. Create a tty with getty on it:
                                   Add a TTY
                                               [Entry Fields]
  TTY type                                     tty
  TTY interface                                rs232
  Description                                  Asynchronous Terminal
  Parent adapter                               sa0
* PORT number                                  [s1]
  BAUD rate                                    [38400]
  PARITY                                       [none]
  BITS per character                           [8]
  Number of STOP BITS                          [1]
  TERMINAL type                                [dumb]
  STATE to be configured at boot time          [available]
  DMA                                          on
  Read Trigger                                 0,1,2,3
  Transmit buffer count                        [16]
  Name of initial program to run               [/etc/getty]

  Note: The following attributes are only applicable if /etc/getty is
        specified as the initial program to run.

  Enable program?                              respawn
  Run level                                    2
  Enable LOGIN                                 share
  TIME before advancing to next port setting   [0]
  STTY attributes for RUN TIME                 [hupcl,cread,brkint>
  STTY attributes for LOGIN                    [hupcl,cread,echoe,>
  RUN shell activity manager                   no
  Optional LOGGER name                         []

4. Change the hardware characteristics so that it uses NO XON/XOFF handshake
   section 1.613 also talks about tty flow control.

5. A (new) .profile template for slip accounts is provided in section
   8.07.  The author, David Migliavacca, writes, "I would also like to
   assert that, to my experience, it is NOT required that the SLIP user
   be made "administrative" or member of "system" as other parts of the
   FAQ (and the original script) say.  At least on my machine 8-).  I now
   create SLIP users as members of group slip, it being the ONLY group;
   allowed ttys are set to the available modem lines only; their home
   directory is owned by root and the .profile is only readable by group
   slip.

Here's another scenario:
From: oosten@angelo.ee.ualberta.ca (Brian Oostenbrink)

Operating System: IBM AIX 3.2.1 and 3.2.3

Configuring two RS6000s via a Serial Line Interface Protocol (SLIP) 
connection over two US Robotics Sportster 14,400 modems.

The AIX implementation of SLIP is slightly different from most others. 
The ifconfig command is used to bring up a serial interface, and the
slattach command is used to connect the interface to the serial port
used for the connection.  Dialer device commands can also be issued when
invoking the slattach command, using UUCP chat syntax.

The following describes a connection between two machines:

     local.j.k.l
         ethernet IP address 129.128.127.21
         slip interface IP address 129.1.2.1

     remote.a.b.c
         ethernet IP address 129.11.22.44
         slip interface address 129.11.22.1

1. Interface configuration

Each machine must have a separate IP address dedicated to the SLIP
interface. On remote.j.k.l, start the SLIP interface with:

         ifconfig sl0 129.11.22.1 129.128.127.1  up

and on local.a.b.c:

         ifconfig sl0 129.128.127.1 129.11.22.1  up

It is important in later versions of AIX 3.2.3+ to use the same SLIP
interface # as the ptty port #, ie. if you use tty12, use ifconfig sl12
instead of sl0.

At this point the interfaces are ready to be connected.

2. tty configuration
   The tty ports on both machines were configured in an identical manner
   using smit.
                                                 [Entry Fields]
 TTY type                                           tty
 TTY interface                                      rs232
 Description                                        Asynchronous Terminal
 Parent adapter                                     sa0
 PORT number                                        []                       +
 BAUD rate                                          [38400]                  +
 PARITY                                             [none]                   +
 BITS per character                                 [8]                      +
 Number of STOP BITS                                [1]                      +
 TERMINAL type                                      [dumb]
 STATE to be configured at boot time                [available]              +
 DMA                                                on                       +
 Read Trigger                                       0,1,2,3
 Transmit buffer count                              [16]                      #
 Name of initial program to run                     [etc/getty]

 Note: The following attributes are only applicable if /etc/getty is specified
 as the initial program to run.

 Enable program?                                    respawn
 Run level                                          2
 Enable LOGIN                                       disable                  +
 TIME before advancing to next port setting         [0]                      +#
 STTY attributes for RUN TIME                       [hupcl,cread,brkint,icr>
 STTY attributes for LOGIN                          [hupcl,cread,echoe,cs8,>
 RUN shell activity manager                         no                       +
 Optional LOGGER name                               []

On older versions of AIX, we encountered some problems disabling getty, and
resorted to changing the /etc/inittab file directly. For example, change

   tty0:2:respawn:/etc/getty /dev/tty0
to
   tty0:2:off:/etc/getty /dev/tty0

This will disable getty from running. After creating the SLIP tty device,
you will need to change its hardware configuration to disable Xon/Xoff
flow control. Software flow control should not be used for SLIP. Type
'smit chtty', and then select sub item 2: Hardware settings.

Most of the parameters in the tty configuration are the defaults.

3. Modem Configuration

   The modems were configured as follows:

   RTS/CTS flow control enabled.
   Xon/Xoff software flow control disabled. Usually this is automatic if
      RTS/CTS is enabled.
   Data rate, terminal to modem = fixed.
      This is the baud rate from the tty port to the modem. We used a
      fixed modem-port transfer rate, set to the fastest speed supported
      by both the tty port and the modem. Newer modems can use a higher
      transfer rate between the modem and serial port than the modem to
      modem rate, which is necessary to use data compression effectively.  
      In our setup, we used 14.4 kBaud modems with a port speed of 38.4
      kBaud. If your modem supports this feature, use it, otherwise set
      the port speed equal to the modem connection rate. On the USR
      Sportster at&b1 fixes the serial port rate to that of the last
      AT command. The speed parameter of the slattach command can be
      used to ensure that this rate is that set in the tty configuration.
   Error Correction enabled - not mandatory, but a good idea
   Data Compression - not required, but it helps, especially for text
      transfers.
   Auto Answer - If the SLIP connection is to be initiated from either
      machine, both modems should be set to auto answer, otherwise, just
      the answering modem.

   It is a good idea to configure the modem and then save the settings
   to NVRAM, so that the correct settings can always be restored by the
   slattach command.

4. UUCP configuration files

   /usr/lib/uucp/Devices
   /usr/lib/uucp/Dialers

   The Devices file must contain an entry with the tty and serial port
   speed used for the interface. In our example,
      Direct tty0 38400 slipdialer

   The keyword 'slipdialer' is merely an index into the Dialers file.
   For our purposes, the slipdialer entry in the Dialers file is simply:

      slipdialer

   This entry can also contain UUCP chat commands, or the chat commands
   can be included in the slattach command.

5. slattach invocation

   slattach connects the device on the tty port to the SLIP interface
   created by ifconfig, and sends any commands to the tty device if
   needed. For our example, remote.j.k.l would never initiate a call,
   only answer incoming calls. Therefore we execute:

         slattach tty0 38400 '"" ATZ OK ""'

   which connects the tty at 38400 baud. We could also simply run

         slattach tty0

   ie. without any modem commands, but the modem to port speed may not
   be correctly set this way. In addition, the ATZ command ensures the
   modem is set to the NVRAM settings.

   On local.a.b.c type:

         slattach tty0 38400 '"" ATZ OK \pATDT4925871 BIS ""' 4

   This establishes the link at 38400 baud, and executes the dial string
   as shown. The dial string is a UUCP chat string and are configured
   in an expect send expect send ... format. The string:

         '"" ATZ OK \pATDT4925871 BIS ""'

   is interpreted as:
   expect "" (null string) from modem
   send   ATZ              to modem
   expect OK               from modem
   send   \pATDT4925871    to modem
   expect BIS              from modem

   BIS is the end of the CONNECT STRING. You could use any portion of
   the string returned by the modem upon a connection as the expect
   string. It may be wiser to simply expect CONNECT since all
   connections should return this string.
   The null strings are necessary because the first parameter of the
   UUCP is an expected string from the modem, which can only be a null
   string until the modem has been given a command.

   The last parameter (4) of the slattach command is the debug level. 
   A debug level of 4 displays the UUCP chat strings, which is useful
   for checking the modem status.

6. Routing
   ifconfig is sufficient if all you want to do is talk between the
   two hosts.  If you are running SLIP so that you can talk to more
   than just that one other host you have to advertise your address.
   
   1) arp -s 802.5 iago 10:00:5a:b1:49:d8 pub
        where 802.5 is a token-ring network the hardware address can
        be obtained with `netstat -v` and iago was the SLIP client (My
        PC at home :)  pub is the important part it means "published"
        You may want to run this at boot time. 

   Routing through the SLIP link is similiar to routing of any gateway. 
   Invoking the ifconfig command automatically sets up a route between
   the two SLIP machines. An entry in /etc/hosts or the named database
   should be made, with the same machine name used for the SLIP address
   as the ethernet address on each machine. For example, in /etc/hosts
   on remote.a.b.c (and any other machine on remote.a.b.c ethernet):

     129.11.22.44 remote.a.b.c # ethernet address
     129.11.22.1  remote.a.b.c # slip address

   It is preferable to place the ethernet address in the hosts file
   before the SLIP address so remote.a.b.c will resolve to the
   ethernet address. When using named, it is important to have both
   addresses in the reverse file with the same name. We experienced
   difficulties with NFS mounting over the slip link, owing to some
   machine interpreting NFS requests from one of the two SLIP machines
   as coming from the SLIP address, while the SLIP machine believed it
   was sending the request from the ethernet address. This problem was
   eliminated by having both addresses reverse resolve to the same name.

7. Performance
   At a modem speed of 14.4 kBaud and a port speed of 38.4 kBaud, we
   realized a transfer rate through ftp of about 3.5 kB/s for text
   files, and 1.3 kB/s for compressed files.

------------------------------

1.607: Where is DCE discussed?

DCE is the Distributed Computing Environment, which is roughly a
flexible client-server architecture for heterogenous platforms.
For more information, take a look in comp.soft-sys.dce.


------------------------------

1.608: How do I make /var/spool/mail mountable?
From: petersen@pi1.physik.uni-stuttgart.de (Joerg Petersen)

In our cluster we share a /usr/local disk. We have a directory
/usr/local/spool/mail and /var/spool/mail is soft-linked to it.

From: fred@hal6000.thp.Uni-Duisburg.DE (Fred Hucht)

Several problems has been reported on sharing the mail directory via
NFS. The problems may occur when two or more sendmail daemons and/or
mail readers access a user's mail file simultanously, because of NFS'
file locking mechanism.

We use another method here: Every user has one line in his/her
$HOME/.forward file that reads

xxx@mainserver.domain.name

where xxx is the user node and mainserver.domain.name is the full
hostname of one of the machines. Then all incoming mail to all machines
is forwarded to mainserver, while mainserver ignores this line.


1.609: getty spawning too rapidly 
From: aslam@abaseen.lums.edu.pk (Sohail Aslam)

The problem can occur due a number of modem settings. The most
frequent is that the echo is not disabled on modems that are to
accept incoming calls. In hayes language, ATE0 disables echo.
If echo is enabled, the login prompt sent by the DTE (computer)
is echoed back to it. It then issues "password:" prompt which
the modem conveniently echoes back again. And the cycle goes on.

Another setting to check is the Q registers which controls the
modem's response to the DTE. The hayes command ATQ0 enables
results codes. The Q register in conjunction with the X and
the V registers, reports back to the DTE the status of the incoming
or outgoing call, and the type of connection established. For
outgoing calls, one would want to enable result codes but not
for incoming calls. If codes are enabled (via ATQ0), when a
call comes in, the modem will send strings (if ATV1 and ATX4 set)
"RINGING", "CONNECTED" etc. to the local DTE. The getty will think
some one is trying to login. It will send password prompt. Trouble
again. Telebit and other intelligent modems has ATQ2 setting
which says "reports codes only when calling out." For others,
you will need to disable it (ATQ1) and enable when calling out.

The DSR setting can be a source of problem. Ideally, modem should
raise DSR only when CD is detected and modem raises CTS. Computer,
such as the VAX, wait 30 seconds after the modem raises DSR. If
CD is not on by that time, the computer will drop DTR causing the
modem to reset. The DSR should be set to be raised only when
carrier has been detected. The hayes setting is AT&S1.

The DCD setting should be such that it reflects the true nature of
the carrier. The CD can be forced on at all times (AT&C0). This
is not good. Set it to AT&C1.

Most modems can reload saved settings from non-volatile memory
on a DTR transition. This is useful for resetting the modem
when a call drops. Use AT&D3 to get this effect. 

For dial in, thus, set AT E0 Q1 &C1 &D3 &S1 &W. The &W stores the
settings in memory. They will be reloaded due to &D3.


------------------------------

1.610: Does AIX support Compressed SLIP (CSLIP)?

No.  That means no VJ compression either :)  See PPP in section 5.07 
if you want more than standard SLIP.


------------------------------
1.611: How do I setup anonymous ftp on my AIX system?

(stolen from Peter Klee <klee@dhdibm1.bitnet> posting)

Have a look at '/usr/lpp/tcpip/samples/anon.ftp'. It is a shell script
and will set up a anonymous ftp site on your local RS/6000.  Note: the
ftpd that comes with AIX does not support the display messages every
time a user changes a directory or even when they login.

------------------------------

1.612: Talk, getting notification.

If you are not getting notification (that someone wants to talk to
you), use (swcons `tty` && mesg y) in one window.

There are many variations of 'talk' and finding compatible versions
for multiple operating systems can be tricky.


------------------------------

1.613: Disabling software flow control; using RTS/CTS.

Different versions of AIX 3.2.5 respond differently to attempts to
enable flow control (RTS/CTS signals).  This section is an attempt to
compile a list of different approaches.

The most straight forward is:
   chdev -l ttyxx -a rts=yes
   [ Note: ix40410 for AIX 3.2.5 should give you this functionality.  
   PTF U426113 and numerous other superceding ptfs should provide this.]

If carrier signal is high (its connected) you can try
   stty add rts </dev/ttyxx 

There is also a program that I first saw on the 800-IBM-4FAX number,
also found in INFO that will remedy the situation in some cases.  Note
that this code ignores the return code from ioctl (which on my machine
is <0 :)

------------------------------

1.614: NIS security
Ole.H.Nielsen@fysik.dtu.dk (Ole Holm Nielsen)

SUMMARY: AIX 3.2.4 and above includes support for a more secure setup
of the ypserv NIS daemon.  You can prevent any random host on the
entire Internet from reading your NIS maps, as is possible with the
default AIX setup.
 
The details:
------------
After starting the ypserv daemon, I noticed in the syslog the following line:
Jan 17 12:01:18 zeise syslog: /usr/etc/ypserv: no /var/yp/securenets file 
This indicates that ypserv is looking for the mentioned configuration
file, but did not find it, and hence will deliver the NIS maps to
anyone on the net who can guess the NIS domainname.  I installed the
/var/yp/securenets file and restarted ypserv, and it works !  Any
illegal attempt to read NIS maps will result in the following getting
logged to syslog (example):
Jan 18 13:37:27 zeise syslog: ypserv: access denied for 129.142.6.79 

How to enable this NIS security option:  
Install the /var/yp/securenets file, for example:

# /var/yp/securenets file
#
# The format of this file is one of more lines of
# netmask netaddr
# Both netmask and netaddr must be dotted quads.
#
# Note that for a machine with two Ethernet interfaces (i.e. a gateway
# machine), the IP addresses of both have to be in /var/yp/securenets.
#
# for example:
#255.255.255.0 128.185.124.00
# Loopback interface
255.255.255.255 127.0.0.1

Uncommenting the last line would limit access to hosts on the
128.185.124.*  net, only.  The loopback interface must be included, as
shown above.

To log violations, have a /etc/syslog.conf file containing the proper
events.  We use this line:

*.err;kern.debug;auth.notice;user.none          /var/adm/messages

Caveat emptor:  This works for us, and you will have to verify it at
your own installation.  Don't complain to us if you have troubles.  
I do not know what PTF level our AIX 3.2.4 is at.  Our ypserv daemon 
looks like this:

zeise> strings /usr/lib/netsvc/yp/ypserv | head -2
@(#)16
1.12  com/cmd/usr.etc/yp/ypserv.c, cmdnfs, nfs325, 9334325a 5/4/93 19:44:41

If your AIX doesn't have securenets support, ask your support centre
for the PTF which includes APAR IX32328.  That seems to have included
the securenets support.


------------------------------

1.615: Why can't non-anonymous users login using WU-FTP?
From: swcxt@boco.co.gov (Shane Castle)

You must create a file named /etc/shells (this is the real /etc not a
subdirectory of your false root), that contains all the shells that
are defined on your system.  Get the list from
/etc/security/login.cfg.  Also, if having proper group authentication
is important to you, apply the following patch:

--- ftpd.c.dist	Wed Apr 13 15:17:18 1994
+++ ftpd.c	Tue Jan 17 13:29:58 1995
@@ -1153,7 +1153,13 @@
        setgroups(NULL, NULL);
        if (setpriv(PRIV_SET|PRIV_INHERITED|PRIV_EFFECTIVE|PRIV_BEQUEATH,
                    &priv, sizeof(priv_t)) < 0 ||
-           setuidx(ID_REAL|ID_EFFECTIVE, (uid_t)pw->pw_uid) < 0 ||
+           initgroups(pw->pw_name, (gid_t)pw->pw_gid) < 0 ||
+           setgidx(ID_REAL|ID_EFFECTIVE, (gid_t)pw->pw_gid) < 0 ||
+           setegid((gid_t)pw->pw_gid) < 0) {
+               reply(550, "Can't set gid (AIX3).");
+               goto bad;
+       }
+       if (setuidx(ID_REAL|ID_EFFECTIVE, (uid_t)pw->pw_uid) < 0 ||
            seteuid((uid_t)pw->pw_uid) < 0) {
                reply(550, "Can't set uid (AIX3).");
                goto bad;

------------------------------

1.616: NIS users can't login, do I need '*' in /etc/passwd?
From: ohnielse@fysik.dtu.dk (Ole Holm Nielsen)

Aparently at least one version of AIX InfoExplorer suggests
administrators use "+:*:0:0:::" as the last entry in the /etc/passwd
file of NIS clients for security reasons.  If the configuration SMIT
is done using SMIT it will actually append "+::0:0:::" which works and
does not compromise security.  Using the '*' in the passwd field
actaully prevents NIS users from logging in.

"+::0:0:::" should not allow you to login as user "+" and without a
password even when NIS is disabled, but it never hurts to double
check.

------------------------------
1.617: HP JetDirect cards and virtual printers?  mkvirprt problems?

(stolen from many)

Since the release of AIX 3.2.5 adding a queue for JetDirect cards is as
easy as creating a virtual printer using "smit mkvirprt" or mkvirprt.
If the command hangs make sure you are using an HFT, aixterm or vt100
terminal.  The entire procedure is available from the IBM FAX
"Information Line" (800 IBM-4-FAX).

From: Mark Bergman <mark.bergman@syseca.co.uk>

SMIT complains that some required software is not present on the system.
It turns out that this software, "printers.hpJetDirect.attach (4.1.3.0)"
is on the installation CD.

HOWEVER, there is some bug somewhere, whereby the software may actually
be already installed, but the system cannot see it.  (Or maybe the bug
is that the software is actually NOT installed, but the system in one
place thinks it is! - I'm not sure).  Therefore, use smit to look at
Installed Software ("Software Installation and Maintenance", "Maintain
Installed Software", "List Installed Software" and look at all software,
then search through for "jet".  If it finds it (i.e. it thinks that it
is installed) - you must remove it (under smit's "Maintain Installed
Software" level), and then reinstall from the CD!

------------------------------

1.618: How can I hack libc.a to alter how hostnames are resolved?
From: <mlarsen@ptdcs2.intel.com> "L. Mark Larsen"

[ 
  Editors note:  The implications of corrupting libc.a should not be
  understated.  While recovering from a corrupt libc.a should be a
  matter of booting from floppy I wouldn't wish that on anyone with a 
  supervisor or users to support :)

  Before you attempt this,  you might want to read 2.07 first for
  advice on recovering from a destroyed or corrupted libc.a.
  Remember:  backups are a VERY GOOD IDEA.

  enough of the weak kneed quivering...
]

Nate Itkin (a colleague) is the individual who did the initial work.
I suspect he would rather not be troubled with any questions you may
have in this area and I can probably answer them just as easily.  The
motivation for this was to use DNS for MX records (we are using IDA
sendmail) but NIS for most hostname lookups.

Secondly, warnings:  IBM has not given any sort of stamp of approval on what
we have done (though they appear to have integrated resolv+ into AIX 4 based
on some release notes I saw).  While we have been using it successfully for
about one year and have seen no problems, we can't and won't promise the same
for you.  This procedure plays around with libc.a which, as you probably know,
is an XCOFF shared library under AIX and hence a critical part of the running
system.  You assume all the risk if you try to install this.  All the usual
disclaimers about liability, etc. apply - there is no warranty associated with
any of this.

Furthermore, know that any PTF you subsequently install that updates/replaces
libc.a implies that you have to execute most of these procedures again.

The details on how to use resolv+ under AIX 3 (it's only tested under
3.2.5 but should work for all point releases), have been moved to
section 8.09.

------------------------------

1.619: What modem settings do I need?

ATQ2  - result codes in originate only
AT&C1 - CD follows state of carrier 
AT&D2 - hangup on DTR drop


------------------------------
1.620: NIS slave server config with master on different subnet?
From: msidler@metronet.com (Mike Sidler)

Assuming AIX 3.2.5,the master server up and running and the hosts file
has the master name defined. On slave do:

    1) domainname <domain_name that matches master>
    2) startsrv -s ypserv
    3) startsrv -s ypbind (ypwhich should return "loopback")
    4) (/usr/sbin/)ypset -d <domainname> <master_server_name>
       (ypwhich should return "<master_server_name>"
    5) (/usr/sbin/)ypinit -s <master_server_name>
    6) Put "+::0:0:::" in /etc/passwd after last local login. 
       Note: InfoExplorer has this entry INCORRECT in some versions.
    7) Other cfg files (group, etc) may need configuring but this will
       get ypserv and ypbind running on the slave looking at the right stuff.


------------------------------

1.621: Why does my 64 port concentrator loose data and drop the queue?
[From: as@mynet.no (Arild Sletvold)]

This problem has been associated with upgrading machines to 3.2.5.
Try changing the values for the "Transmit buffer count" parameter in
the printer/plotter setup in smit. You need to experiment with this
parameter, to see which value that makes the printer print as fast as
possible.  If the value is too high, the printers will loose some of
the data, and the queue will be disabled.  If the value is too low,
the printers will print very slowly.

------------------------------

1.622: Netscape FastTrack server won't install on AIX 3.2.5 or 4.1.
From: Cameron Ferstat <cferstat@austin.ibm.com>

Before installing FastTrack on an AIX 3.2.5 or 4.1 system, you must 
first install the AIX Shared Library Hookable Symbols/6000 Version 
1.1.5.0, Reference RPQ No. P91153.  (Note:  This software should *not*
be installed on an AIX 4.2 system!)

If you try to install FastTrack on an AIX 3.2.5 or 4.1 system, without 
first installing the Hookable Symbols PRPQ, you will get the following 
error:

   > ./ns-setup
     0509-037 System error - error data is: ./ns-setup
     0509-022 Cannot load library libsvld.a[shr.o].
     0509-026 System error: A file or directory in the path name does not exist.

You can download the installp image by anonymous ftp from
<ftp://ftp.software.ibm.com/aix/products/netscape/tools/slhs.rte.inst_image>.

There is also an associated README.slhs file in that directory.

------------------------------

1.623: How can I share files/printers with Windows 95?

The freeware solution is Samba,  available from <http://www-frec.bull.com/>.

Commercial solutions include Fusion95 from Performance Technology
<http://www.perftech.com/> and Syntax <http://www.syntax.com/>.

------------------------------

1.700: Free LVM lecture slides.
From: shieh@austin.ibm.com

If you want free LVM documentation (lecture notes) from the
SHARE conference in San Franciso where I presented last March
just:
 
 mail -s "S_basics.ps" shieh@austin.ibm.com < /dev/null
 mail -s "S_limits.ps" shieh@austin.ibm.com < /dev/null
 mail -s "S_lvm_extra.ps" shieh@austin.ibm.com < /dev/null

[Editor's note: Jens-Uwe Mager converted the slides to PDF format.  They
are available as <ftp://anubis.han.de/pub/aix/lvm.pdf>.]

------------------------------

1.701: How do I shrink /usr?
From: mike@bria.UUCP (Michael Stefanik) and Richard Hasting

FOR AIX 3.1
-----------

 1) Make a backup of /usr

        find /usr -print | backup -ivf /dev/rmt0 (or appropriate device)

 2) shutdown to maintenance mode

        shutdown -Fm
 
 3) export LANG=C
 
 4) remove the filesystem and the logical volume
    ignore an error about the "dspmsg" command not found

        umount /usr
        rmfs /usr

 5) make a new logical volume hd2 and place it on rootvg with desired size

        mklv -yhd2 -a'e' rootvg NNN 

   where NNN is the number of 4 meg partitions

 6) create a filesystem on /dev/hd2

        crfs -vjfs -dhd2 -m'/usr' -Ayes -p'rw'

 7) mount the new /usr filesystem and check it

        /etc/mount /usr
        df -v

 8) restore from the tape; system won't reboot otherwise

        restore -xvf/dev/rmt0

 9) Sync and reboot the system; you now have a smaller /usr filesystem

FOR AIX 3.2
-----------

 0)  Experiences posted to comp.unix.aix lead me to suggest that
     many administrators find the following piece of information 
     useful after completing this procedure.  I thought some of you
     might like to read it BEFORE getting yourself into this
     predicament.  

     Call 1-800-IBM-4FAX and request document 2503 dated 1/26/94.  
     Title is "How to recover if all files are owned by root after
     restoration from a mksysb tape".

 1) Remove any unneeded files from /usr.

 2) Make sure all filesystems in the root volume group are mounted. If
    not, they will not be included in the re-installed system.

 3) Type mkszfile. This will create /.fs.size that contains a list of
    the active filesystems in the root volume group that will be
    included in the installation procedure.

 4) Edit .fs.size. Change the size of /usr to what you want.

    Example: This .fs.size file shows /usr to be 40MB.

	rootvg 4 hd2 /usr 10 40 jfs

    The 10 is the number of physical partitions for the filesystem and
    the 40 is 40 MB. Most systems have a physical partition size of 4 MB.
    Therefore, the second number (40) will always be 4 times the
    previous number (10). Note, however, that a model 320 with a 120 MB
    drive will have a physical partition size of only 2 MB, and the
    total MB is twice the number of physical partitions. The first
    number (4) in the .fs.size file represents the PP size.

    If you want to reduce the size of /usr from 40 MB to 32 MB, edit the
    /usr entry to:

        rootvg 4 hd2 /usr 8 32 jfs

    IMPORTANT: Make sure that you DO NOT enter a value which is less
    than the size of the filesystem required to contain the current
    data. Doing so will cause the re-installation procedure to fail.

 5) chdev -l rmt0 -a block=512 -T

 6) Unmount all filesystems that are NOT in the root volume group.
 
 7) Varyoff all user-defined volume groups, if any

        varyoffvg VGname

 8) Export the user-defined volume groups, if any

        exportvg VGname

 9) With a tape in the tape drive, type

        mksysb /dev/rmt0

     This will do a complete system backup, which will include
     information (in the .fs.size file) for the installation procedure
     on how large the filesystems are to be created.

 10) Follow the instructions in the Installation Kit under "How to
     Install and perform maintenance from Diskettes" (reportedly now 
     called "BOS Installation from a System Backup") using the
     diskettes and tape that you created in the previous steps.

     [ pre AIX 325: DO NOT select the option "Reinstall AIX with
     Current System Settings". Instead use "Install AIX with Current
     System Settings" for the logical volume size changes to take affect. ]

     [ w/ AIX 325: Select "Install from a mksysb image" ]

 11) When the installation is complete, you may then import any
     user-defined volume groups.

         importvg -y VGname PVname

     where "VGname" is the name of the volume group, and "PVname" is
     the name of any one of the physical volumes in the volume group.

 12) Varyon your user-defined volume groups

         varyonvg VGname

 The reduction of the filesystems is now complete.

COMMERCIAL OPTION
-----------------
There are also commercial tools availible to help you do this more
conviently.  I know of one vendor that can be reached at info@compunix.com

------------------------------

1.702: How do I make a filesystem larger than 2Gb?

AIX 3.2.5 and preceeding versions are limited to 2 Gigabytes per
filesystem.

With AIX 4.1 IBM allows filesystems up to 64Gb (reference:
Individual files are still limited to 2Gb.  AIX 4.2 allows 128Gb
filesystems and 64 Gb files.  (See also question 1.706.)

If you are having trouble creating a file greater than 1Mb it maybe
because that is the default limit for your account, see 'smit users'
or /etc/security/limit.

------------------------------

1.703: Chlv warning.  Is the first 4k of a LV safe?

The first 4k of a raw LV are used to store control block.
Applications that write to the raw disk can overwrite this section
(common applications that do this are Oracle and Sybase).  Commands
that call getlvcb will generate a warning but succeed (since the
control block exists in ODM.  Don't run synclvodm unless you really
want to erase the first 4k and replace it with the info from the ODM.

shieh@austin.ibm.com (Johnny Shieh) has kindly provided the following
explanation:

The logical volume control block (lvcb) is the first 512
bytes of a logical volume.  This area holds important
information such as the creation date of the logical volume,
information about mirrored copies, and possible mount points
in a journaled filesystem.  Certain LVM commands are required
to update the lvcb, as part of completeness algorithms in
LVM.  The old lvcb area is first read and analyzed to see if
it is a valid lvcb.  If the information is verified as valid
lvcb information, then the lvcb is updated.  If the
information is not valid, then the lvcb update is not
performed and the user is given the warning message:

	Warning, cannot write lv control block data

Most of the time, this is a result of database programs
accessing the raw logical volumes (and thus bypassing the
journaled filesystem) as storage media.  When this occurs, the
information for the database is literally written over the lvcb.
Although this may seem fatal, it is not the case.  Once the
lvcb has been overwritten, the user can still:

	1) Extend a logical volume
	2) Create mirrored copies of a logical volume
	3) Remove the logical volume
	4) Create a journaled filesystem with which to mount
		the logical volume (note that this will destroy any
		data sitting in the lvcb area)

However, there is a limitation caused by this deletion of the
lvcb.  The logical volumes with deleted lvcb's face possible,
incomplete importation into other AIX systems.  During an
"importvg", the LVM command will scan the lvcb's of all defined
logical volumes in a volume group for information concerning the
logical volumes.  Surprisingly, if the lvcb is deleted, the
imported volume group will still define the logical volume to
the new AIX system which is accessing this volume group, and
the user can still access the raw logical volume.  However, any
journaled filesystem information is lost and the logical volume
and its associated mount point won't be imported into the new AIX
system.  The user must create new mount points and the availability
of previous data stored in the filesystem is NOT assured.  Also, during
this import of a logical volume with an erased LVCB, some non-jfs
information concerning the logical volume, which is displayed with
the "lslv" command, cannot be found.  When this occurs, the system uses
default logical volume information to populate the logical volume's
ODM information.  Thus, some output from the "lslv" will be inconsistent
with the real logical volume.  If logical volume copies still exist on
the original disks, this information will not be correctly reflected in
the ODM database.  The user should use "rmlvcopy" and "mklvcopy" to
rebuild any logical volume copies and synchronize the ODM.  Finally,
with an erased lvcb, the output from the "lslv" command might be
misleading or unreliable.


------------------------------

1.704: What's the limit on Physical Partitions Per Volume Group?
From: shieh@austin.ibm.com (Johnny Shieh)

1016 Physical Partitions Per Disk in a Volume Group:

     In the design of LVM, each Logical Partition
maps to one Physical Partition.  And, each Physical
Partition maps to a number of disk sectors.  The design
of LVM limits the number of Physical Partitions that LVM
can track PER DISK in a volume group to 1016.  In most cases,
not all the possible 1016 tracking partitions are used by a disk.
The default size of each Physical Partition during a
"mkvg" command is 4 MB, which implies that individual
disks up to 4 GB can be included into a volume group.

     If a disk larger than 4 GB is added to a volume
group (based on usage of the default 4 MB size for
Physical Partition) the disk addition will fail with a
warning message that the Physical Partition size needs
to be increased.*  There are two instances where this
limitation will be enforced.  The first case is when the
user tries to use "mkvg" to create a volume group where
the number of physical partitions on one of the disks in
the volume group would exceed 1016.  In this case, the
user must pick from the available Physical Partition ranges of:

1, 2, (4), 8, 16, 32, 64, 128, 256

Megabytes and use the "-s" option to "mkvg".  The second
case is where the disk which violates the 1016 limitation
is attempting to join a pre-existing volume group with
the "extendvg" command.  The user can either recreate the
volume group with a larger Physical Partition size (which
will allow the new disk to work with the 1016 limitation)
or the user can create a standalone volume group (consisting
of a larger Physical Partition size) for the new disk.

     In AIX 4.1 and 3.2.5, if the install code detects
that the rootvg drive is larger than 4 GB, it will change
the "mkvg -s" value until the entire disk capacity can be
mapped to the available 1016 tracks.**  This install change
also implies that all other disks added to rootvg, regardless
of size, will also be defined at that new Physical Partitions size.

For RAID systems, the /dev/hdiskX name used by LVM in AIX may
really consist of many non-4GB disks.  In this case, the 1016
limitation still exists.  LVM is unaware of the size of the
individual disks that may really make up /dev/hdiskX.  LVM bases
the 1016 limitation on the AIX recognized size of /dev/hdiskX,
and not the real independent physical disks that make up /dev/hdiskX.

The questions asked of this issue are:
1) What are the symptoms of this problem?
2) How safe is my data?  What if I never use mirroring or migratepv?
3) Can I move this volume group between RS/6000 systems and versions
   of AIX?

Here are the answers:
A) What are the symptoms of this problem?
     The 1016 VGSA is used to track the "staleness of mirrors".
     If you are in violation of 1016, you may possibly get a false
     report of a non-mirrored logical volume being "stale" (which
     is an oxymoron) or you may get a false indication that one of
     the your mirror copies has gone stale.  Next, migratepv may
     fail because migratepv briefly uses mirroring to move a logical
     volume from one disk to another.  If the target logical
     partition is incorrectly considered "stale", then the migratepv
     cannot remove the source logical partition and the migratepv
     command will fail in the middle of migration.

B) How safe is my data?  What if I never use mirroring or migratepv?
     The data is as safe (in your mind) as the day before you found
     out about 1016 violations.  The only case where data may be
     lost is if one is mirroring a logical volume and ALL copies go
     bad at the same time and LVM isn't aware of it because the
     copies that go bad are beyond the 1016 tracking range.  However,
     in this case, you would lose data even if you were within the
     1016 range.  If you never mirror or use migratepv, then this
     issue shouldn't concern you.  But, it might be unwise to state
     you'll NEVER use either of those options.

C) Can I move this volume group between RS/6000 systems and versions
   of AIX?
     Yes you can.  The enforcement of this 1016 limit is only
     during mkvg and extendvg.  The "safeness" of the data on the
     volume group on AIX 3.2 is the same as it is on AIX 4.1.


* This bug was fixed in apar ix48926.  Current AIX 3.2.5 and
4.1.1, which do not have this fix on applied, will allow the
creation of volume groups with more than 1016 partitions.  The
implication of this bug allowing more than 1016 physical
partitions is that the user may access all portions of the logical
volume.  However during disk mirroring, the status of partitions
beyond the 1016 limit will not be tracked correctly.  If mirrors
beyond the 1016 range become "stale", LVM will not be aware of
their condition and data consistency may become an issue for
those partitions.  Additionally, the "migratepv" command creates
mirrors and deletes them as a method for moving logical volumes
around within/between disks.  If the 1016 limit is violated,
then the "migratepv" command may not behave correctly.
The user should pick up apar ix51754, which clarifies the error
message when this condition is detected.  Additionally, the user
can read the non-ptf documentation apar ix50874 which is a companion
to ix48926 and ix51754.

** This bug was fixed for AIX 3.2.5 rootvg install in apars
ix46862 and ix46863.  This bug does not exist in AIX 4.1.1.

------------------------------

1.705: Why am I having trouble adding another disk to my VG?
From: shieh@austin.ibm.com (Johnny Shieh)

In some instances, the user will experience a problem adding
a new disk to an existing volume group or in the creation of
a new volume group.  The warning message provided by LVM will
be:

	Not enough descriptor space left in this volume group.
	Either try adding a smaller PV or use another volume group.

On every disk in a volume group, there exists an area called the
Volume Group Descriptor Area (VGDA).  This space is what allows
the user to take a volume group to another AIX system and
"importvg" that volume group into that AIX system.  The VGDA
contains the names of disks that make up the volume group, their
physical sizes, partition mapping, logical volumes that exist in
the volume group, and other pertinent LVM management information.

When the user creates a volume group, the "mkvg" command
defaults to allowing the new volume group to have a maximum
of 32 disks in a volume group.  However, as bigger disks have
become more prevalent, this 32 disk limit is usually not
achieved because the space in the VGDA is used up faster, as
it accounts for the capacity on the bigger disks.  This
maximum VGDA space, for 32 disks, is a fixed size which is
part of the LVM design.  Large disks require more management
mapping space in the VGDA, which causes the number and size
of available disks to be added to the existing volume group
to shrink.  When a disk is added to a volume group, not only
does the new disk get a copy of the updated VGDA, but all
existing drives in the volume group must be able to accept
the new, updated VGDA.

The exception to this description of the maximum VGDA is
rootvg.  In order to provide AIX users more free space, when
rootvg is created, "mkvg" does not use the maximum limit of
32 disks that are allowed into a volume group.  Instead in
AIX 3.2, the number of disks picked in the install menu of
AIX is used as the reference number by "mkvg -d" during the
creation of rootvg.  For AIX 4.1, this "-d" number is 7 for
one disk and one more for each additional disk
picked. i.e. you pick two disks, the number is 8.  you pick
three disks, the number is 9, and so on.....  This limit does
not mean the user cannot add more disks to rootvg in the
post-install phase.  The amount of free space left in a VGDA,
and thus the number of size of the disks added to a volume
group, depends on the size and number of disks already
defined for a volume group.  However, this smaller size
during rootvg creation implies that the user will be able to
add fewer disks to rootvg than compared to a non-rootvg
volume group.

If the customer requires more VGDA space in the rootvg, then
they should use the "mksysb" and "migratepv" commands to
reconstruct and reorganize their rootvg (the only way to
change the "-d" limitation is recreation of the rootvg).

Note:  It is always strongly recommended that users do not place
user data onto rootvg disks.  This separation provides an extra
degree of system integrity.

------------------------------

1.706: What are the limits on a file, filesystem?

There are other limits but these come up most often.  Logical Volumes
do not _have_ to contain Journaled File Systems and therefore can be
larger than 2GB even in 3.2.5.

	File	jfs-Filesystem
3.2.5	2GB	2GB
4.1.x	2GB	64GB
4.2	64GB	128GB

While it *might* be possible to create larger file systems,  the limits
shown here represent values that IBM has supposedly tested.	

------------------------------

1.707:  Hints for Segate 9 GB and other disks larger than 4 GB? 

[read 1.704]


------------------------------

1.708: How do I fix Volume Group Locked?

>From /usr/lpp/bos/README (AIX 3.2.5) and 1.800.IBM.4FAX #2809

If you get '0516-266 publvodm: volume group rootvg is locked, try again'
or something similar, you can use (putlvodm -K `getlvodm -v <vgname>`)

------------------------------

1.709: How do I remove a volume group with no disks?
From: shieh@austin.ibm.com (Johnny Shieh)

This is a very common question about AIX LVM and I thought
I might take some time to explain what is going on.  Within
a volume group is the Volume Group Descriptor Area (VGDA) is
is kinda a "suitcase" of lvm information.  This is what allows
you to pick up your drives and take them to another machine,
importvg them, and get filesystems automatically defined.

What happens is that when you importvg the volume group,
the RS/6000 goes out and reads the VGDA and finds out about
all the logical volumes and filesystems that may exist on the
volume group.  It then checks for clashes (name conflicts, etc..)
on its own machine and then, here is the important part, populates
its own database with information about the new volume group and
its associated logical volumes.  In cases of filesystems, it will
go into the /etc/filesystems file and add the new filesystem entries
that came along with the imported volume group.

Okay, the key point is that you've got this independent volume group
that has "docked" at the new RS/6000.  What keeps the two tethered
to each other is the varyonvg command.  When this is started on the
volume group, a software link is created where you can't separate the
volume group from the AIX operating system unless the volume group
is no longer seen as active by the system.  In very rare cases, a
situation can occur where the VGDA thinks that someone has it (the
volume group) activated, but the operating system doesn't think it has the
volume group opened up.  This is pretty rare.

The main question I see is "I've taken away the disks, but how do
I get rid of the volume group".  The question should really say,
"How do I get rid of the volume group INFORMATION" since that's
all you have on the system.  You've got possible entries in
the /etc/filesystems and definitely entries in the ODM.  Just 
do:
	exportvg <vgname>

It does a reverse importvg, except it doesn't go off and read
the VGDA.  It nukes anything relating to the volume group in
the /etc/filesystems and ODM.  The only time this won't work is
if the system detects that the volume group is varied on.  Then,
it would be like trying to change tires on a moving car, we won't
let you do it!

Some people are concerned that doing an exportvg will somehow damage
the volume group and/or its VGDA. As I said, all it does is affect the
information about the volume group on the RS/6000 box, not on the actual
disk platter itself.  Thus, the volume group you exported is safe to
take to another system.  The only time the VGDA gets overwritten is when
you create a new volume on top of it.

The second most often asked question is "How do I get rid of a disk
that is no longer really in the volume group?"

In this case, you DON'T want to do an exportvg.  What you want to do
is tell the system you want to cut out the memory of the old, bad disk
from the RS/6000 AND from the VGDA of the volume group.  You simply
do:

		reducevg -d -f <vgname> <hdname>

or if the hdname can't be found:

		reducevg -d -f <vgname> <PVID>

Be careful with this command.  Unlike the exportvg command, actions done
with this command WILL affect the VGDA information on the platter.

Hope this clarifies some questions about volume groups.

------------------------------

1.710:  What are the theoritical limits within the LVM?
From: Gerry FitzGerald <G.FitzGerald@uk22p.bull.co.uk>

  -------------------------------------
  LVM Limits within AIX (my perception)
  -------------------------------------
  
  The system may have 1 to 255 Volumes Groups (VG's).
  Each VG may contain 1 to 32 Physical Volumes (PV's).
  Each PV may contain upto 1016 Physical Partitions (PP's).
  Each PP may have a size (square of 2) from 1 to 256MB.
  
  Therefore, if you can get hold of a 260,096 MB disk (one PV with 1016 
  x 256MB PPs), you can install 32 of these in a single VG giving you 
  8,323,072MB per VG. You may have up to 255 VG's in one AIX system so 
  you could (in theory) create the maximum addressable AIX storage area 
  of 2,122,383,360 MB (2,072,640 GB or 2,024 TB or approx. 2 PB). This 
  is based on the current limitations of AIX V4.1.
  
  The limits for file and filesystem sizes are:
  
  AIX V3.2  Max Filesystem size:  2,097,152 bytes (2 GB)
  Max single file size:  2,097,152 bytes (2 GB)
  

  AIX V4.1  Max Filesystem size:  67,108,864 bytes (64 GB)
  Max single file size:  2,097,152 bytes ( 2 GB)  
  
  AIX V4.2  Max Filesystem size:  67,108,864 bytes (64 GB)
  Max single file size:  67,108,864 bytes (64 GB)

------------------------------

1.800: How do I control how hostnames are resolved?
From: <kraem@ibm.de> Frank Kraemer

Information from AIX 4.1.2 Infoexplorer:

The default order can be overwritten by creating the configuration file,
/etc/netsvc.conf and specifying the desired order. Both the default and
/etc/netsvc.conf can be overwritten with the environment variable,
NSORDER. If either the /etc/netsvc.conf file or environment variable,
NSORDER are defined, then at least one value must be specified along with
the option.

examples: 
    echo hosts = local,nis,bind >/etc/netsvc.conf
    NSORDER=local,bind; export NSORDER

------------------------------

Subjet: 1.801: dtlogin ignores /etc/profile?
From: Trevor Bourget (trevor@thomsoft.com)

Read the /usr/dt/bin/Xsession script.  You can add a file to the
/etc/dt/config/Xsession.d and it will get sourced as part of the
startup.  The order is: $HOME/.dtprofile, /etc/dt/config/Xsession.d/*,
/usr/dt/config/Xsession.d/* (backwards, in my opinion, but CDE is a
committee result after all).

>From: Ed Ravin <eravin@panix.com>

If you want your terminal session to automatically read in
/etc/profile and your .profile when they start up, you need to either
invoke them with the "-ls" option (which I couldn't figure out how to
do, perhaps someone else can elaborate), or set up the default X
resources so that they set:

*Dtterm*loginShell:     true

You could always do this with the .Xresources file in your own account,
but that wouldn't fix any other users in the system.  To make this change
globally:

CDE configuration files are kept in /usr/dt/config
 
Those files warn you strenuously not to change them, since AIX upgrades
will overwrite them and lose your changes.  They recommend that you copy
the files to /etc/dt/config and change them there, so:

# cd /usr
# find dt/config -print | cpio -pdvum /etc
... (files get copied)
# cd /etc/dt/config/C
# echo "*Dtterm*loginShell:     true" >> sys.resources
# cd ../en_US
# echo "*Dtterm*loginShell:     true" >> sys.resources

------------------------------

1.802:  Where's the C compiler?

As of AIX 4.1,  the C compiler has been "unbundled."  It's a separate product,
and you must purchase a separate license for it.  IBM does offer free
time limited trial licenses if you want to "try before you buy."

The GNU C compiler is available from various sources.  The most convenient
is probably <http://www-frec.bull.com/>.  <ftp://aixpdslib.seas.ucla.edu/>
is another source.

------------------------------

1.803:  Why doesn't Netscape work?

See question 1.515.

------------------------------

1.900: SCSI-1 and SCSI-2 "interoperability" got you confused?  

A.  SCSI-1 devices are supported on a SCSI-2 adapter.  This
    config will provide SCSI-1 performance.

B.  SCSI-2 devices are supported on a SCSI-1 adapter.  This
    config will provide SCSI-1 performance.

C.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-1
    adapter.  All devices will have SCSI-1 performance.

D.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-2
    adapter.  SCSI-2 devices will have SCSI-2 performance (10 MB/sec)
    and SCSI-1 devices will have SCSI-1 performance (4-5 MB/sec).

------------------------------

1.901: How to get your keyboard back after unplugging it from the 6000
From: Mickey Coggins and Anne Serre and L. Mark Larsen

When you unplug your keyboard from a running system, and plug it back
in, the key mapping is wrong.  For example, keys like Caps Lock and Ctrl
don't work as designed.

Solution: Type at the command line

        /usr/lpp/diagnostics/da/dkbd

Your screen goes black, you hear a few beeps, and your keyboard is reset.
It works with any environment, Xwindows, hft, NLS...

For Models 220, 230 and M20, use the following commands:

/usr/lpp/diagnostics/da/dkbd
/usr/lpp/diagnostics/da/dkbdsal   (for the 220)

After running the keyboard diagnostics to reset keyboard mappings, the
repeat rate is also reset to some slow value (11, according to the man
page).  If the user is in X, you need to open an hft window.  Do this
with "xopen /bin/csh".  Once you have an hft window, run "chhwkbd -r30".

------------------------------

1.902: How do I set up pcsim, the DOS emulator?

[Editor's Note: this product does not exist in AIX 4.x.]

You must have a bootable DOS diskette to install pcsim. Either DOS 3.3, 
4.x, or 5.0 will work. IBM do not officially support DOS 5.0 for pcsim
but I have no problems with it. Just don't try to be fancy with the UMB 
and memory manager stuff.

With a bootable DOS disk in the drive, do:
$touch /u/dosdrive (this is the AIX file for DOS emulation)
$pcsim -Adiskette 3 -Cdrive /u/dosdrive
You would now get an A prompt. Type:
A> fdisk
Create the virtual C drive of whatever size you choose. Make it large 
enough for your needs since you cannot enlarge it later.
A> format c: /s (to format the virtual C drive)
Now exit from pcsim with ESCpcsim (Esc key followed by pcsim).

Now create a simprof file. Following is a starter:

Adiskette   : 3
Cdrive      :/u/dosdrive
lpt1        : name of printer queue
refresh     : 50
dmode       : V
mouse       : com1

You can now start pcsim anytime by typing pcsim. Make sure no floppies
are in the drive. For further information, refer to publication
SC23-2452, Personal Computer Simulator/6000 Guide and Reference.
       
------------------------------

1.903: How do I transfer files between AIX and DOS disks?

In one of the bos extensions are commands for transferring files between
DOS diskettes and AIX. The commands are dosread, doswrite, dosdir, dosdel,
and dosformat. Many users have mentioned that the mtools package from
prep.ai.mit.edu is better than the native AIX programs.


------------------------------

1.904: Where is the crypt program?

The crypt *program* (as opposed to the crypt subroutine) has been
deleted, probably to conform to U.S. law regarding export of
cryptographic technology.

Other programs such as PGP are available,  but their use and/or
possesion may be subject to local laws and regulations.

If anyone has a better answer to this question,  feel free to
contribute it.

------------------------------

1.905: How do I play audio CDs?
From: woan@austin.ibm.com (Ronald S. Woan)

Get xmcd by anonymous FTP from ftp.x.org in /contrib/applications/xmcd/
<URL:ftp://ftp.x.org/contrib/applications/xmcd/>

------------------------------

1.906: How can I get the mouse back after unplugging it?

/usr/lpp/diagnostics/da/dmousea

------------------------------

1.907: Where can I get source code to the operating
                system binary xxxxx?

AIX source code is not generally available.  Two other UNIX OS' do
make their source available, Linux & freeBSD.  Check
<ftp://ftp.uu.net/systems/unix/bsd-sources/> and
<ftp://ftp.uu.net/systems/unix/linux/>

------------------------------

1.908: What's the difference between the POWER and
                POWERPC architectures?

Read the POWERPC FAQ at
<http://www.mot.com/SPS/PowerPC/library/ppc_faq/ppc_faq.html>

------------------------------

1.909: Will there be date rollover problems in the year 2000?
From: mbrown@austin.ibm.com (Mark Brown)

IBM has a major corporate-wide push for *all* of its software products
to be "safe" in this regard by the end of 1996.

<http://www.software.ibm.com/year2000/paper.html> is the general-purpose
[Year 2000] URL for IBM.

As far as AIX is concerned, we had to fix three things in AIXv4.1.4
(some logging commands handled date ranges wrong) as PTFs, but other
than that, we are there.

...and we handle the leap year issue correcly. also.

------------------------------

1.910: How can I build an "installp format" file?

Jim Abbey <jim@systelecom.com> has a tool called "lppbuild".
It is now available from "aixpdslib.seas.ucla.edu"
in either of

/pub/lppbuild/RISC/3.2/src/lppbuild.1.0.tar.Z
/pub/lppbuild/RISC/4.1/src/lppbuild.1.0.tar.Z

Both are identical and the procedures also work on 4.2.

Ciaran Diegnan <C.Diegnan@frec.bull.fr> has built a tool called
"mklpp".  You can retrieve a copy (along with many other
smit-installable freeware packages) from <http://www-frec.bull.com/>.

------------------------------

1.911: Is there a generic SCSI driver for AIX?
From: Rogan Dawes <rdawes@jhbelec.co.za>

Yes. Matthew Jacob (mjacob@feral.com) has written a generic SCSI driver
for AIX 4.1.  It can be found at <ftp://ftp.feral.com/pub/aix/gsc.tar.gz>.
------------------------------

2.00: C/C++

Contrary to many people's belief, the C environment on the RS/6000 is
not very special.  The C compiler has quite a number of options that can
be used to control how it works, which "dialect" of C it compiles, how
it interprets certain language constructs, etc.  InfoExplorer includes a
Users Guide and a Reference Manual.

The compiler can be invoked with either xlc for strict ANSI mode and cc
for RT compatible mode (i.e. IBM 6150 with AIX 2).  The default options
for each mode are set in the /etc/xlc.cfg file, and you can actually add
another stanza and create a link to the /bin/xlc executable.

The file /usr/lpp/xlc/bin/README.xlc has information about the C
compiler, and the file /usr/lpp/bos/bsdport (AIX 3 only) contains useful
information, in particular for users from a BSD background.

The file /etc/xlc.cfg also shows the symbol _IBMR2 that is predefined,
and therefore can be used for #ifdef'ing RS/6000 specific code.

------------------------------

2.01: I cannot make alloca work

A famous routine, in particular in GNU context, is the allocation
routine alloca().  Alloca allocates memory in such a way that it is
automatically free'd when the block is exited.  Most implementations
does this by adjusting the stack pointer.  Since not all C environments
can support it, its use is discouraged, but it is included in the xlc
compiler.  In order to make the compiler aware that you intend to use
alloca, you must put the line

#pragma alloca

before any other statements in the C source module(s) where alloca is
called.  If you don't do this, xlc will not recognize alloca as anything
special, and you will get errors during linking.

For AIX 3.2, it may be easier to use the -ma flag.

------------------------------

2.02: How do I compile my BSD programs?

The file /usr/lpp/bos/bsdport contains information on how to port
programs written for BSD to AIX 3.  This file may be very useful for
others as well.

A quick cc command for most "standard" BSD programs is:
  
  $ cc -D_BSD -D_BSD_INCLUDES  -o [loadfile] [sourcefile.c] -lbsd

If your software has system calls predefined with no prototype
parameters, also use the -D_NO_PROTO flag.

------------------------------

2.03: Isn't the linker different from what I am used to?

Yes.  It is not at all like what you are used to:

- The order of objects and libraries is normally _not_ important.  The
  linker reads _all_ objects including those from libraries into memory
  and does the actual linking in one go.  Even if you need to put a
  library of your own twice on the ld command line on other systems, it
  is not needed on the RS/6000 - doing so will even make your linking slower.

- One of the features of the linker is that it will replace an object in
  an executable with a new version of the same object:

  $ cc -o prog prog1.o prog2.o prog3.o		# make prog
  $ cc -c prog2.c				# recompile prog2.c
  $ cc -o prog.new prog2.o prog			# make prog.new from prog
						# by replacing prog2.o
  
- The standard C library /lib/libc.a is linked shared, which means that
  the actual code is not linked into your program, but is loaded only
  once and linked dynamically during loading of your program.

- The ld program actually calls the binder in /usr/lib/bind, and you can
  give ld special options to get details about the invocation of the
  binder.  These are found on the ld man page or in InfoExplorer.

- If your program normally links using a number of libraries (.a files),
  you can 'prelink' each of these into an object, which will make your
  final linking faster.  E.g. do:

  $ cc -c prog1.c prog2.c prog3.c
  $ ar cv libprog.a prog1.o prog2.o prog3.o
  $ ld -r -o libprog.o libprog.a
  $ cc -o someprog someprog.c libprog.o

This will solve all internal references between prog1.o, prog2.o and
prog3.o and save this in libprog.o Then using libprog.o to link your
program instead of libprog.a will increase linking speed, and even if
someprog.c only uses, say prog1.o and prog2.o, only those two modules
will be in your final program.  This is also due to the fact that the
binder can handle single objects inside one object module as noted above.

If you are using an -lprog option (for libprog.a) above, and still want
to be able to do so, you should name the prelinked object with a
standard library name, e.g. libprogP.a (P identifying a prelinked
object), that can be specified by -lprogP.  You cannot use the archiver
(ar) on such an object.

You should also have a look at section 3.01 of this article, in
particular if you have mixed Fortran/C programs.

Dave Dennerline (d.dennerline@bull.com) claims that his experiences
in prelinking on AIX does not save much time since most people have
separate libraries which do not have many dependencies between them,
thus not many symbols to resolve.

------------------------------

2.04: How do I statically link my program?

  cc -o prog -bnoso -bI:/lib/syscalls.exp obj1.o obj2.o obj3.o

will do that for a program consisting of the three objects obj1.o, etc.

[Editor's note: You should never link programs statically that are
supposed to leave your local environment, e.g. intended for
distribution. Statically linked programs may fail to work after
installing a new AIX version or even after installing a PTF.]

From: Marc Pawliger (marc@sti.com)

As of AIX 3.2.5, you can install a speedup for AIXwindows called
Shared Memory Transport.  To static link an X application after the
SMT PTF has been installed, you must link with
-bI:/usr/lpp/X11/bin/smt.exp and the executable will NOT run on a
machine where SMT is not installed.  See /usr/lpp/X11/README.SMT
Newsgroups: comp.unix.aix,comp.answers,news.answers
Path: news.univie.ac.at!aconews.univie.ac.at!newscore.univie.ac.at!fu-berlin.de!news-ber1.dfn.de!news-ham1.dfn.de!newsserver.rrzn.uni-hannover.de!baghira.han.de!jum
From: jum@anubis.han.de
Approved: news-answers-request@mit.edu
Followup-To: comp.unix.aix
Supersedes: <aix-faq-4-886305604@anubis.han.de>
Reply-To: jum@anubis.han.de (Jens-Uwe Mager)
Keywords: AIX RS/6000 questions answers
Sender: jum@baghira.han.de (Jens-Uwe Mager)
Expires: Sun, 5 Apr 1998 05:01:07 GMT
Organization: At Home
Message-ID: <aix-faq-4-888724807@anubis.han.de>
References: <aix-faq-1-888724807@anubis.han.de> 
Date: Sun, 1 Mar 1998 04:00:24 GMT
         and their answers.  AIX is IBM's version of Unix.
Lines: 1806
Xref: news.univie.ac.at comp.unix.aix:125562 comp.answers:29712 news.answers:39490

Posted-By: auto-faq 3.3 (Perl 4.035)
Archive-name: aix-faq/part4
Posting-Frequency: monthly


------------------------------

2.05: How do I make my own shared library?

To make your own shared object or library of shared objects, you should
know that a shared object cannot have undefined symbols.  Thus, if your
code uses any externals from /lib/libc.a, the latter MUST be linked with
your code to make a shared object.  Mike Heath (mike@pencom.com) said it
is possible to split code into more than one shared object when externals
in one object refer to another one.  You must be very good at
import/export files.  Perhaps he or someone can provide an example. 

Assume you have one file, sub1.c, containing a routine with no external
references, and another one, sub2.c, calling stuff in /lib/libc.a.  You
will also need two export files, sub1.exp, sub2.exp.  Read the example
below together with the examples on the ld man page. 

---- sub1.c ----
    int addint(int a, int b)
    {
      return a + b;
    }
---- sub2.c ----
    #include <stdio.h>

    void printint(int a)
    {
      printf("The integer is: %d\n", a);
    }
---- sub1.exp ----
    #!
    addint
---- sub2.exp ----
    #!
    printint
---- usesub.c ----
    main()
    {
      printint( addint(5,8) );
    }

The following commands will build your libshr.a, and compile/link the
program usesub to use it.  Note that you need the ld option -lc for
sub2shr.o since it calls printf from /lib/libc.a.  [Note that you can leave
out the "-T512 -H512" on AIX 4. -- Ed.]

  $ cc  -c sub1.c
  $ ld -o sub1shr.o sub1.o -bE:sub1.exp -bM:SRE -T512 -H512 
  $ cc  -c sub2.c
  $ ld -o sub2shr.o sub2.o -bE:sub2.exp -bM:SRE -T512 -H512  -lc
  $ ar r libshr.a sub1shr.o sub2shr.o
  $ cc -o usesub usesub.c -L: libshr.a
  $ usesub
  The integer is: 13
  $

------------------------------

2.06: Linking my program fails with strange errors.  Why?

Very simple, the linker (actually called the binder), cannot get the
memory it needs, either because your ulimits are too low or because you
don't have sufficient paging space.  Since the linker is quite different
>from normal Unix linkers and actually does much more than these, it also
uses a lot of virtual memory.  It is not unusual to need 10000 pages (of
4k) or more to execute a fairly complex linking.

If you get 'BUMP error', either ulimits or paging is too low, if you get
'Binder killed by signal 9' your paging is too low.

First, check your memory and data ulimits; in korn shell 'ulimit -a' will
show all limits and 'ulimit -m 99999' and 'ulimit -d 99999' will
increase the maximum memory and data respectively to some high values. 
If this was not your problem, you don't have enough paging space.

If you will or can not increase your paging space, you could try this:

- Do you duplicate libraries on the ld command line? That is never
  necessary.

- Do more users link simultaneously? Try having only one linking going
  on at any time.

- Do a partwise linking, i.e. you link some objects/libraries with the
  -r option to allow the temporary output to have unresolved references,
  then link with the rest of your objects/libraries.  This can be split
  up as much as you want, and will make each step use less virtual memory.

  If you follow this scheme, only adding one object or archive at a
  time, you will actually emulate the behavior of other Unix linkers.

If you decide to add more paging space, you should consider adding a new
paging space on a second hard disk, as opposed to just increasing the
existing one.  Doing the latter could make you run out of free space on
your first harddisk. It is more involved to shrink a paging space
but easier to delete one.

------------------------------

2.07: Why does it take so long to compile "hello world" with xlc?

Some systems have experienced delays of more than 60 seconds in
compiling "#include <stdio.h> int main () {printf ("Hello world");}"
The problem is with the license manager contact IBM to make sure
you've got the latest PTF.

------------------------------

2.08: What's with malloc()?
 
malloc() uses a late allocation algorithm based on 4.3 BSD's malloc()
for speed.  This lets you allocate very large sparse memory spaces,
since the pages are not actually allocated until they are touched for
the first time.  Unfortunately, it doesn't die gracefully in the face of
loss of available memory.  See the "Paging Space Overview" under
InfoExplorer, and see the notes on the linker in this document for an
example of an ungraceful death.

If you want your program to get notified when running out of memory, you
should handle the SIGDANGER signal.  The default is to ignore it. 
SIGDANGER is sent to all processes when paging space gets low, and if
paging space gets even lower, processes with the highest paging space
usage are sent the SIGKILL signal.

malloc() is substantially different in 3.2, allocating memory more
tightly.  If you have problems running re-compiled programs on 3.2,
try running them with MALLOCTYPE=3.1.

Early Page Space Allocation (EPSA) added to AIX 3.2: see
/usr/lpp/bos/README.PSALLOC - IX38211 / U422496 Allows setting of
early allocation (vs. default late allocation) on a per-process basis.

------------------------------

2.09: Why does xlc complain about 'extern char *strcpy()'

The header <string.h> has a strcpy macro that expands strcpy(x,y) to
__strcpy(x,y), and the latter is then used by the compiler to generate
inline code for strcpy.  Because of the macro, your extern declaration
contains an invalid macro expansion.  The real cure is to remove your
extern declaration but adding -U__STR__ to your xlc will also do the
trick, although your program might run a bit more slowly as the compiler
cannot inline the string functions any more.

------------------------------

2.10: Why do I get 'Parameter list cannot contain fewer ....'

This is the same as above (2.9).

------------------------------

2.11: Why does xlc complain about
               '(sometype *)somepointer = something'

Software that is developed using gcc may have this construct. However,
standard C does not permit casts to be lvalues, so you will need to
change the cast and move it to the right side of the assignment. If you
compile with 'cc', removing the cast completely will give you a warning,
'xlc' will give you an error (provided somepointer and something are of
different types - but else, why would the cast be there in the first place?)

------------------------------

2.12: Some more common errors

Here are a few other common errors with xlc:

305 |     switch((((np)->navigation_type) ? (*((np)->navigation_type)) :
      ((void *)0)))
      .a...........  
a - 1506-226: (S) The second and third operands of the conditional
operator must be of the same type.

The reason for this is that xlc defines NULL as (void *)0, and it does
not allow two different types as the second and third operand of ?:. 
The second argument above is not a pointer and the code used NULL
incorrectly as a scalar. NULL is a nil pointer constant in ANSI C and
in some traditional compilers.

You should change NULL in the third argument above to an integer 0.


------------------------------

2.13: Can the compiler generate assembler code?

Starting with version 1.3 of xlc and xlf the -S option will generate a
.s assembly code file prior to optimization. The option -qlist will
generate a human readable one in a .lst file.

There is also a disassembler in /usr/lpp/xlc/bin/dis include with the
1.3 version of xlc (and in /usr/lpp/xlC/bin/dis with the 2.1 version
of xlC) that will disassemble existing object or executable files.

------------------------------

2.14: Curses

Curses based applications should be linked with -lcurses and _not_ with
-ltermlib. It has also been reported that some problems with curses are
avoided if your application is compiled with -DNLS.

Peter Jeffe <peter@ski.austin.ibm.com> also notes:

>the escape sequences for cursor and function keys are *sometimes*
>treated as several characters: eg. the getch() - call does not return
>KEY_UP but 'ESC [ C.'

You're correct in your analysis: this has to do with the timing of the
escape sequence as it arrives from the net. There is an environment
variable called ESCDELAY that can change the fudge factor used to decide
when an escape is just an escape. The default value is 500; boosting
this a bit should solve your problems.

Christopher Carlyle O'Callaghan <asdfjkl@wam.umd.edu> has more comments
concerning extended curses:

1) The sample program in User Interface Programming Concepts, page 7-13
   is WRONG. Here is the correct use of panes and panels.

#include <cur01.h>
#include <cur05.h>

main()
{
PANE *A, *B, *C, *D, *E, *F, *G, *H;
PANEL *P;

initscr();

A = ecbpns (24, 79, NULL, NULL, 0, 2500, Pdivszp, Pbordry, NULL, NULL);
D = ecbpns (24, 79, NULL, NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
E = ecbpns (24, 79, D,    NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
B = ecbpns (24, 79, A, D, Pdivtyh, 3000, Pdivszp, Pbordry, NULL, NULL);
F = ecbpns (24, 79, NULL, NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
G = ecbpns (24, 79, F,    NULL, 0, 5000, Pdivszp, Pbordry, NULL, NULL);
H = ecbpns (24, 79, G,    NULL, 0, 3000, Pdivszp, Pbordry, NULL, NULL);
C = ecbpns (24, 79, B, F, Pdivtyh, 0, Pdivszf, Pbordry, NULL, NULL);
P = ecbpls (24, 79, 0, 0, "MAIN PANEL", Pdivtyv, Pbordry, A);

ecdvpl (P);
ecdfpl (P, FALSE);
ecshpl (P); 
ecrfpl (P);
endwin();
}

2) DO NOT include <curses.h> and any other <cur0x.h> file together.
   You will get a bunch of redefined statements.

3) There is CURSES and EXTENDED CURSES. Use only one or the other. If the
   manual says that they're backwards compatible or some other indication 
   that you can use CURSES routines with EXTENDED, don't believe it. To 
   use CURSES you need to include <curses.h> and you can't (see above).

4) If you use -lcur and -lcurses in the same link command, you will get
   Memory fault (core dump) error. You CANNOT use both of them at the same
   time. -lcur is for extended curses, -lcurses is for regular curses.

5) When creating PANEs, when you supply a value (other than 0) for the
   'ds' parameter and use Pdivszf value for the 'du' parameter, the 'ds'
   will be ignored (the sample program on page 7-13 in User Interface
   Programming Concepts is wrong.) For reasons as yet undetermined,
   Pdivszc doesn't seem to work (or at least I can't figure out how to
   use it.)

6) If you're running into bugs and can't figure out what is happening,
   try the following:
   include -qextchk -g in your compile line
	-qextchk will check to make sure you're passing the right number of
  	 parameters to the functions
	-g enables debug

7) Do not use 80 as the number of columns if you want to use the whole
   screen. The lower right corner will get erased.  Use 79 instead.

8) If you create a panel, you must create at least 1 pane, otherwise you
   will get a Memory fault (core dump).

9) When creating a panel, if you don't have a border around it, any title
   you want will not show up.

10) to make the screen scroll down:
    wmove (win, 0, 0);
    winsertln (win)

11) delwin(win) doesn't work in EXTENDED WINDOWS

    To make it appear as if a window is deleted, you need to do the following:
    for every window that you want to appear on the screen
	touchwin(win)
	wrefresh(win)

    you must make sure that you do it in the exact same order as you put
    them on the screen (i.e., if you called newwin with A, then C, then B,
    then you must do the loop with A, then C, then B, otherwise you won't
    get the same screen back).  The best thing to do is to put them into
    an array and keep track of the last window index.

12) mvwin(win, line, col) implies that it is only used for viewports and
    subwindows. It can also be used for the actual windows themselves.

13) If you specify the attribute of a window using wcolorout(win), any
    subsequent calls to chgat(numchars, mode) or any of its relatives
    will not work. (or at least they get very picky.)

------------------------------

2.15: How do I speed up linking

Please refer to sections 2.03 and 2.06 above.

From: losecco@undpdk.hep.nd.edu (John LoSecco) and
      hook@chaco.aix.dfw.ibm.com (Gary R. Hook)

From oahu.cern.ch in /pub/aix3 you can get a wrapper for the existing
linker called tld which can reduce link times with large libraries by
factors of 3 to 4.

------------------------------

2.16: What is deadbeef?

When running the debugger (dbx), you may have wondered what the
'deadbeef' is you occasionally see in registers.  Do note, that
0xdeadbeef is a hexadecimal number that also happens to be some kind
of word (the RS/6000 was built in Texas!), and this hexadecimal number
is simply put into unused registers at some time, probably during
program startup.


------------------------------

2.17: How do I make an export list from a library archive?
From: d.dennerline@bull.com (Dave Dennerline)

[ This script has been moved to section 8.10 ]

------------------------------

2.19: Building imake, makedepend
From: crow@austin.ibm.com (David L. Crow)

[Editor's note: if you have AIX 4.x,  you need the X11.adt.imake LPP
and probably most if not all of the X11.adt.* LPPs.  Imake, xmkmf and
other utilities are delivered precompiled.]

    You need X11dev.src release 1.2.3.0 (ie the R5 release) [on AIX 3.2].


     Unless you have an R5 release of AIXwindows, there is no xmkmf.
  These are the steps that I use to make imake, makedepend and all
  of it's config files, and then install them in the working tree
  (ie not the Xamples) for daily use:
  
      cd /usr/lpp/X11/Xamples
      make Makefile
      make SUBDIRS="config util" Makefiles
      make SUBDIRS="config util" linklibs
      make SUBDIRS="config util" depend
      make SUBDIRS="config util" 
      make SUBDIRS="config util" install
      
  Then redo the steps everytime you apply an X11 update.

------------------------------

2.20: How can tell what shared libraries a binary is linked with?

Use "dump -H <execfilename>" and see if anything other than /unix is
listed in the loader section (at the bottom).  The first example is
/bin/sh (statically linked) and the second example is
/usr/local/bin/bash (shared).

INDEX  PATH                          BASE                MEMBER              
0      /usr/lib:/lib                                                         
1      /                             unix                                    

INDEX  PATH                          BASE                MEMBER              
0      ./lib/readline/:./lib/glob/:/usr/lib:/lib               
1                                    libc.a              shr.o               
2                                    libcurses.a         shr.o               

The freeware tool "ldd" lists all the shared libraries needed
by an executable, including those recursively included by other
shared libraries. See question 2.27 "Where can I find ldd for AIX?".

------------------------------

2.21: Can I get a PTF for my C/C++ compiler from the net?

<http://service.software.ibm.com/>  contains pointers to most PTFs, including
compilers.  You'll need the fixdist program (see 1.142) to retrieve them.

------------------------------

2.22: Why does "install"ing software I got from the net fail?

Note that the RS/6000 has two install programs, one with System V flavor
in the default PATH (/etc/install with links from /usr/bin and /usr/usg),
and one with BSD behavior in /usr/ucb/install.

------------------------------

2.23: What is Linker TOC overflow error 12?

There is a hard coded limit in the AIX 3.2.5 linker that is fixed in
AIX 4.1.  A kind soul donated the following information to help people
get the 3.2.5 fix

    The LPS (paperwork) 
      AIX TOC Data Binder/6000 #P91128
      Version 1.1
      Program Number 5799-QDY
      Reference No. GC23-2604-00, FC 5615
    Pre Reqs listed were AIX 3.2.5
      IBM C Set++ V2 (5765-186)

The above is not available any longer, see section 1.006.

You could also put some of the application code into shared libraries
or, in the case of gcc, use -mminimal-toc.

------------------------------

2.24: What is the limit on number of shared memory segments
               I can attach?

Each process has 16 segments.  One is used for private code, one for
stack, one for heap; those, if memory serves, are segments 0, 1, and
2.  (If you look in sys/shm.h, you'll see that SHMLOSEG is 3 -- the
lowest segment, in number and in the process' virtual address space,
available to shmat.)

SHMHISEG, the highest segment you can attach to (also defined in
sys/shm.h), is 12.  Segments 3 through 12 are available to shmat,
giving the 10 segments your program used successfully.  (NSHMSEGS in
sys/shm.h will give you this value, though it's of limited use, since
most platforms that I've seen don't define it.)

Segment 13 is used by shared code your program has attached to;
I think one of the others might be for kernel-mode data.

See also mmap.

------------------------------

2.25: I deleted libc.a by accident --- how do I recover?
From: Ed Ravin <eravin@panix.com>

You can recover from this without rebooting or reinstalling, if you
have another copy of libc.a available that is also named "libc.a".  If
you moved libc.a to a different directory, you're in luck -- do the
following:

export LIBPATH=/other/directory


And your future commands will work.  But if you renamed libc.a, this
won't do it.  If you have an NFS mounted directory somewhere, you can
put libc.a on the that host, and point LIBPATH to that directory as
shown above.

Failing that, turn off your machine, reboot off floppies or other
media, and get a root shell.  I don't think you should do "getrootfs"
as you usually do when accessing the root vg this way -- AIX may start
looking for libc.a on the disk, and you'll just run into the same
problem.  So do an importvg, varyonvg, and then mount /usr somewhere,
then manually move libc.a back or copy in a new one from floppy.

------------------------------

2.26: Where can I find dlopen, dlclose, and dlsym for AIX?

An implementation of these dynamic code loading functions was written by
Jens-Uwe Mager <jum@anubis.han.de> and can be found at
<ftp://anubis.han.de/pub/aix/dlfcn.shar>

From: Gary R. Hook <hook@austin.ibm.com>

Starting with AIX 4.2 a dlopen et. al. are included in the base OS in
the libdl.a library. Under AIX 4.1 this is available as SLHS (Shared
Library Hookable Symbols) as APAR IX IX71849 for the runtime package and
APAR IX IX72973 for the development tools.

------------------------------

2.27: Where can I find ldd for AIX?
From: Jens-Uwe Mager <jum@anubis.han.de>

Try <ftp://anubis.han.de/pub/aix/ldd.c>. Also the "aix.tools"
package from <http://www-frec.bull.com>

------------------------------

2.28:  How do I make my program binary executable on the
                POWER, POWER2, and POWERPC architecures?

AIX will emulate those instructions not available in POWERPC processors, but
you can avoid this emulation and consequent performance degradtation by
using only the common to all.

If you are using IBM's xlc (cc) compiler, the default is to use the common
instruction set.  If you want to be explicit, use the -qarch=com option.

The option -mcpu=common makes GCC use the common instruction set.  Please
note that (unlike xlc) this is *not* the default with GCC on AIX.

------------------------------

2.29: How do I access more than 256 Megabytes of memory?

By default each program gets one segment register (see 2.24) for its
data segment. As each segment register covers 256 MB, any calls to
malloc more will fail. Also programs that declare large global or static
arrays may fail to load. To allocate more segment registers to your
program, use the linker option -bmaxdata to specify the number of bytes
you need in the data segment as follows:

cc -o myprog -bmaxdata:0x20000000 myprog.c

The example above would allocate an additional segment register to allow
for 512MB of data.

------------------------------

2.30: How do I use POSIX threads with gcc 2.7.x?
From: David Edelsohn <dje@watson.ibm.com>

The code generated by GCC is compatible with threads, but gcc-2.7 
was released so long ago that it did not provide an option to perform
the extra link steps necessary to support threads:

1) Compile all source files with "-D_THREAD_SAFE" macro defined.
2) Link with "-L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a"
   to obtain the pthreads support 
   and add "-nostartfiles /usr/lib/crt0_r.o" to the beginning of the
   link command line (using gcc to link!) to initialize threads.

------------------------------

3.00: Fortran and other compilers

This section covers all compilers other than C/C++.  On Fortran, there
seem to have been some problems with floating point handling, in
particular floating exceptions.

------------------------------

3.01: I have problems mixing Fortran and C code, why?

A few routines (such as getenv, signal, and system) exist in both the
Fortran and C libraries but with different parameters. In the recent
past, if you have a mixed program that calls getenv from both C and
Fortran code, you have to link them carefully by specifying the correct
library first on your command line. This is no longer needed starting
with version 1.5 of the compilers.


------------------------------

3.02: How do I statically bind Fortran libraries and dynamically
               bind C libraries?
From: amaranth@vela.acs.oakland.edu (Paul Amaranth)

[ Editor's note: Part of this is also discussed above under the C compiler
  section, but I felt it was so valuable that I have left it all in. 
  I've done some minor editing, mostly typographical. ]

The linker and binder are rather versatile programs, but it is not
always clear how to make them do what you want them to.  In particular,
there are times when you do not want to use shared libraries, but
rather, staticly bind the required routines into your object.  Or, you
may need to use two versions of the same routine (eg, Fortran & C).  Here
are the results of my recent experiments.  I would like to thank Daniel
Premer and Brad Hollowbush, my SE, for hints.  Any mistakes or omissions
are my own and I have tended to interchange the terms "linker" and
"binder".  These experiments were performed on AIX 3.1.2.  Most of this
should be applicable to later upgrades of 3.1.

1)  I have some C programs, I want to bind in the runtime routines.  How
    do I do this? [Mentioned in section 2.04 of this article as well, ed.]

    You can put the -bnso binder command on the link line.  You should
    also include the -bI:/lib/syscalls.exp control argument:
      
      $ cc *.o -bnso -bI:/lib/syscalls.exp -o foo

    This will magically do everything you need.  Note that this will bind
    _all_ required routines in.  The -bI argument tells the linker that
    these entry points will be resolved dynamically at runtime (these are
    system calls).  If you omit this you will get lots of unresolved 
    reference messages.

2)  I want to statically bind in the Fortran runtime so a) my customers 
    do not need to buy it and b) I don't have to worry about the runtime
    changing on a new release.  Can I use the two binder arguments in
    1) to do this?

    You should be able to do so, but, at least under 3002, if you do
    you will get a linker error referencing getenv.  In addition, there
    are a number of potential conflicts between Fortran and C routines.
    The easy way just does not work.  See the section on
    2 stage linking for C and Fortran on how to do this.  The getenv
    problem is a mess, see the section on Comments & Caveats for more.

    From: Gary R. Hook <hook@austin.ibm.com>

    The xlf runtime is a no-charge feature, you can download and install
    it without having to buy it. This change was made >2 years ago.

3)  I have a mixture of C and Fortran routines, how can I make sure
    that the C routines reference the C getenv, while the Fortran routines
    reference the Fortran getenv (which has different parameters and, if
    called mistakenly by a C routine results in a segmentation fault)?

    From Mike Heath (mike@pencom.com):

    Use -brename:symbol1,symbol2 when pre-linking the modules from one
    of the languages. It does not matter which one you choose.

4)  I have C and Fortran routines.  I want to bind in the xlf library, while
    letting the rest of the libraries be shared.  How do I do this?

    You need to do a 2 stage link.  In the first stage, you bind in the
    xlf library routines, creating an intermediate object file.  The
    second stage resolves the remaining references to the shared libraries.

    This is a general technique that allows you to bind in specific system
    routines, while still referencing the standard shared libraries.

    Specifically, use this command to bind the xlf libraries to the Fortran
    objects:

       $ ld -bh:4 -T512 -H512 <your objects> -o intermediat.o \
         -bnso -bI:/lib/syscalls.exp -berok -lxlf -bexport:/usr/lib/libg.exp \
         -lg -bexport:<your export file>

    The argument -bexport:<your export file> specifies a file with the
    name of all entry points that are to be visible outside the intermediate 
    module.  Put one entrypoint name on a line.  The -bI:/lib/libg.exp line 
    is required for proper functioning of the program.  The -berok argument 
    tells the binder that it is ok to have unresolved references, at least 
    at this time (you would think -r would work here, but it doesn't seem to).  
    The -bnso argument causes the required modules to be imported
    into the object.  The -lxlf, of course, is the xlf library.

    Then, bind the intermediate object with the other shared libraries in
    the normal fashion:

       $ ld -bh:4 -T512 -H512 <C or other modules> intermediate.o \
         /lib/crt0.o -lm -lc

    Note the absence of -berok.  After this link, all references should
    be resolved (unless you're doing a multistage link and making another
    intermediate).

    NOTE THE ORDER OF MODULES.  This is extremely important if, for example,
    you had a subroutine named "load" in your Fortran stuff.  Putting the
    C libraries before the intermediate module would make the C "load"
    the operable definition, rather than the Fortran version EVEN THOUGH 
    THE FORTRAN MODULE HAS ALREADY BEEN THROUGH A LINK AND ALL REFERENCES 
    TO THE SYMBOL ARE CONTAINED IN THE FORTRAN MODULE.  This can
    be extremely difficult to find (trust me on this one :-)  Is this
    a bug, a feature, or what?
    
    [As mentioned in section 2.03 of this article, it is a feature that you
    can replace individual objects in linked files, ed.]

    The result will be a slightly larger object than normal.  (I say slightly
    because mine went up 5%, but then it's a 2 MB object :-)


Comments & Caveats:

   From the documentation the -r argument to the linker should do what
   -berok does.  It does not.  Very strange results come from using the
   -r argument.  I have not been able to make -r work in a sensible manner
   (even for intermediate links which is what it is supposed to be for).

       Note from Mike Heath (mike@pencom.com):

       'ld -r' is essentially shorthand for 'ld -berok -bnogc -bnoglink'.
       Certainly, using -berok with an export file (so garbage collection
       can be done) is preferable to ld -r, but the latter is easier.

   When binding an intermediate module, use an export file to define the
   entry points you want visible in the later link.  If you don't do this,
   you'll get the dreaded "unresolved reference" error.  Import files name
   entry points that will be dynamically resolved (and possibly where).

   If you are in doubt about what parameters or libraries to link, use the
   -v arg when linking and modify the exec call that shows up into 
   an ld command.  Some thought about the libraries will usually yield an
   idea of when to use what.  If you don't know what an argument is for,
   leave it in.  It's there for a purpose (even if you don't understand it).

   Watch the order of external definitions (ie, libraries) when more than
   one version of a routine may show up, eg "load".  The first one defined
   on the ld command line is the winner.  

   The getenv (and system and signal) problem is a problem that started out
   minor, got somewhat worse in 3003 and, eventually will be correctly fixed.
   Basically, you should extract the 3002 version of these three routines
   from xlf.a before doing the update and save them away, then link these
   routines in if you use these Fortran system services.  


------------------------------

3.03: How do I check if a number is NaN?
From: sdl@glasnost.austin.ibm.com (Stephen Linam)

NaN is "Not a Number".  It arises because the RISC System/6000 uses
IEEE floating point arithmetic.

To determine if a variable is a NaN you can make use of the property
that a NaN does not compare equal to anything, including itself.
Thus, for real variable X, use

	IF (X .NE. X) THEN	! this will be true if X is NaN

Floating point operations which cause exceptions (such as an overflow)
cause status bits to be set in the Floating Point Status and Control
Register (FPSCR).  There is a Fortran interface to query the FPSCR, and
it is described in the XLF Fortran manuals -- I don't have the manuals
right here, but look for FPGETS and FPSETS.

The IBM manual "Risc System/6000 Hardware Technical Reference - General
Information" (SA23-2643) describes what floating point exceptions can
occur and which bits are set in the FPSCR as a result of those exceptions.


------------------------------

3.04: Some info sources on IEEE floating point.

1. ANSI/IEEE STD 754-1985 (IEEE Standard for Binary Floating-Point
   Arithmetic) and ANSI/IEEE STD 854-1987 (IEEE Standard for
   Radix-Independent Floating-Point Arithmetic), both available from IEEE. 

2. David Goldberg, "What Every Computer Scientist Should Know About
   Floating-Point Arithmetic", ACM Computing Surveys, Vol. 23, No. 1,
   March 1991, pp. 5-48.

------------------------------

3.05: Why does it take so long to compile "hello world" with xlf? 

[read 2.07]

------------------------------

4.00: GNU and Public Domain software

GNU software comes from the Free Software Foundation and various other
sources. A number of ftp sites archive them. Read the GNU license for 
rules on distributing their software.

Lots of useful public domain software have been and continue to be ported
to the RS/6000. See below for ftp or download information.

------------------------------

4.01: How do I find sources?
From: jik@GZA.COM (Jonathan Kamens)

There is a newsgroup devoted to posting about how to get a certain
source, comp.sources.wanted.  An archive of information about sources,
including FTP sites is available from

------------------------------

4.02: Are there any ftp or WWW sites?

SMIT-installable precompiled packages of popular freeware for AIX 4.x at
<http://www-frec.bull.com/>.  Download the ".exe" files with your WWW
browser. These are auto-uncompressing files, just like on PCs (it uses
similar technology to PKZIP). Mark the file as executable (chmod +x),
then execute it to generate a .bff file. The .bff file can then be
installed using "smit install_latest". For more information
read the INSTALL.txt file on the server.

There are mirrors of this site at http://www.bull.de/ and
http://ftp.univie.ac.at/aix/.

The package explicitly referenced below are ones Ciaran consideres
"solid."  That is, the binary has been "tested by lots of people."

Bull provides many other freeware packages as well.  If you use the
service,  be sure and thank Ciaran and Bull.

Below are some ftp sites that are supposed to have RS/6000 specific
software.  I haven't verified all the entries.

US sites:
<ftp://aixpdslib.seas.ucla.edu/pub/>		128.97.2.211
<ftp://aix.boulder.ibm.com/>
<ftp://software.watson.ibm.com/>

European sites:
<ftp://nic.funet.fi/pub/unix/AIX/RS6000/>		128.214.6.100
<ftp://iacrs1.unibe.ch/pub/>			130.92.11.3
<ftp://ftp.zrz.TU-Berlin.DE/pub/aix/>		130.149.4.50
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>	129.104.3.60
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>		129.69.8.13

The first one is dedicated to software running on AIX.  It might not
always be the latest versions of the software, but it has been ported
to AIX (normally AIX version 3 only).  Please use the European sites
very sparingly.  They are primarily to serve people in Europe and most
of the software can be found in the US sites originally.

The remaining sites are simply ones that archie indicated contained
AIX related materials.

<ftp://ibminet.awdpa.ibm.com/>	#IBM announcements, oem hardware
<ftp://cac.toronto.ibm.com/>	#marketing-info
<ftp://ftp.egr.duke.edu/>
<ftp://straylight.acs.ncsu.edu/>
<ftp://alpha.gnu.ai.mit.edu/rs6000>
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>
<ftp://iacrs2.unibe.ch/pub/aix/>
<ftp://ftp.u.washington.edu/pub/RS6000/>
<ftp://aixive.unb.ca/>
<ftp://ftp.ans.net/pub/misc/>
<ftp://uvaarpa.virginia.edu/pub/misc/>
<ftp://ux1.cts.eiu.edu/pub/rs6000/>
<ftp://ftp.bsc.nopub/Src/>
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>
<ftp://aix1.segi.ulg.ac.be/pub/aix/>
<ftp://byron.u.washington.edu/pub/aix/>
<ftp://cunixf.cc.columbia.edu/aix/>
<ftp://files1zrz.zrz.tu-berlin.de/pub/aix/>
<ftp://ftp.rz.uni-augsburg.de/pub/aix/>
<ftp://fyvie.cs.wisc.edu/pub/aix/>
<ftp://solaria.cc.gatech.edu/pub/aix/>
<ftp://spot.colorado.edu/aix/>
<ftp://swdsrv.edvz.univie.ac.at/unix/systems/aix/>
<ftp://switek.uni-muenster.de/pub/aix/>
<ftp://wuarchive.wustl.edu/systems/aix/>
<ftp://cs.nyu.edu/pub/AIX/>
<ftp://karazm.math.uh.edu/pub/AIX/>
<ftp://minnie.zdv.uni-mainz.de/pub0/pub/AIX/>
<ftp://oersted.ltf.dth.dk/pub/AIX/>
<ftp://rs3.hrz.th-darmstadt.de/pub/incoming/AIX/>
<ftp://aeneas.mit.edu/pub/rs6000/>
<ftp://cameron.egr.duke.edu/rs6000/>
<ftp://ifi.informatik.uni-stuttgart.de/pub/rs6000/>
<ftp://metropolis.super.org/pub/rs6000/>
<ftp://ramses.cs.cornell.edu/pub/rs6000/>
<ftp://server.uga.edu/pub/rs6000/>
<ftp://uvaarpa.virginia.edu/pub/rs6000/>
<ftp://wayback.cs.cornell.edu/pub/rs6000/>
<ftp://alice.fmi.uni-passau.de/pub/RS6000/>
<ftp://byron.u.washington.edu/pub/aix/RS6000/>
<ftp://milton.u.washington.edu/pub/RS6000/>
<ftp://pascal.math.yale.edu/pub/RS6000/>
<ftp://uxc.cso.uiuc.edu/pub/RS6000/>

------------------------------
4.03: Why does "install"ing software I got from the net fail?

This answer was moved to section 2.22

------------------------------

4.04: GNU Emacs

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

If you get a segmentation fault in GNU EMACS 19.* during hilit19 use,
you can set locale to C (export LC_ALL=C) to get around the AIX bug.

Version 18.57 of GNU Emacs started to have RS/6000 support.  Use
s-aix3-2.h for AIX 3.2. Emacs is going through rapid changes recently.
Current release is 19.x.

Emacs will core-dump if it is stripped, so don't strip when you install
it.  You can edit a copy of the Makefile in src replacing all 'install -s' 
with /usr/ucb/install.

------------------------------

4.05: gcc/gdb

GNU C version 2.0 and later supports the RS/6000, and compiles straight
out of the box.  You may, however, experience that compiling it requires
large amounts of paging space.

Compiling gcc and gdb on AIX 3.2 requires a patch to the 'as' assembler.  Call
IBM software support and request patch for apar IX26107 (U409205).

gcc has undergone many changes lately and the current version is 2.7.x.
gdb is at 4.1x.

If your machine crashed when trying to run gdb 4.7, call software support
and request ptf U412815.

------------------------------

4.06: GNU Ghostscript 

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

The PostScript interpreter GNU Ghostscript Version 2.3 and later supports
the RS/6000 and can be found on various ftp sites. Current version is 2.6.1.

Compile time problems:
  Compile idict.c and zstack.c _without_ optimization, add the following
  to the Makefile:

  idict.o: idict.c
        $(CC) -c idict.c

  zstack.o: zstack.c
        $(CC) -c zstack.c

Run time problems:
  Running ghostview-1.5 with ghostscript-2.6.1, I get 
   gs: Malformed ghostview color property.
  Solution: replace buggy version of ghostscript-2.6.1 X11 driver
  with at least 2.6.1pl4 

------------------------------

4.07  TeX - Document processing
From: "Patrick TJ McPhee" <ptjm@ican.net>

TeX can be retrieved via ftp from the comprehensive TeX archive
network (CTAN). The principle sites are
ftp.tex.ac.uk (UK)
ftp.dante.de  (Deutschland)
ftp.tug.org  (USA)
but there are many mirrors. finger ctan@ftp.tex.ac.uk for a list.

------------------------------

4.08  Perl - Scripting language

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

If you want the source code, <http://www.perl.com/perl/> is good place
to start.

------------------------------

4.09: X-Windows

AIX 4.x ships with X11R5 and Motif 1.2.

On AIX 3.2 the base version has X11R4 and Motif 1.1 and the extended
version has X11R5 as AIXwindows 1.2.3.  See question 1.500 for more
information about determining your revision.

AIXwindows version 1.2.0 (X11rte 1.2.0) is X11R4 with Motif 1.1
AIXwindows version 1.2.3 (X11rte 1.2.3) is X11R5 with Motif 1.1
'lslpp -h X11rte.motif1.2.obj' should tell you if you are
running Motif 1.2.

------------------------------

4.10  Bash - /bin/ksh alternative from FSF

Bash is an alternative to ksh and is availible from prep.ai.mit.edu
and places that mirror the GNU software.  /etc/security/login.cfg
needs to be modified if this will be used as a default shell.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

------------------------------

4.11: Elm

A very nice replacement for mail. Elm should be pretty straightforward,
the only thing to remember is to link with -lcurses as the only
curses/termlib library. You may also run into the problem listed under
point 2.13 above.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

------------------------------

4.12: Oberon 2.2
From: afx@muc.ibm.de (Andreas Siegert)

Oberon is Wirth's follow on to Modula-2, but is not compatible. A free
version of Modula-3 is available from DEC/Olivetti at
gatekeeper.dec.com. This is not a Modula-2 replacement but a new
language. There are currently two M2 compilers for the 6000 that I
know of. One from Edinburgh Portable Compilers, +44 31 225 6262 (UK)
and the other from Gardens Point is availible through A+L in
Switzerland (+41 65 520311) or Real Time Associates in the UK
(info@rtal.demon.co.uk).

Oberon can be obtained via anonymous ftp from neptune.inf.ethz.ch
(129.132.101.33) under the directory Oberon/RS6000 or gatekeeper.dec.com
(16.1.0.2).

------------------------------

4.13: Kermit - Communications
From: Frank da Cruz <fdc@watsun.cc.columbia.edu>

Available for all versions of AIX on RS/6000, PowerPC, PS/2, RT PC,
and 370-Series mainframes.  For complete information on Kermit software
for AIX and hundreds of other platforms, visit the Kermit Web site:

  <http://www.columbia.edu/kermit/>

C-Kermit 6.0 was announced November 30, 1996:

  <http://www.columbia.edu/kermit/ck60.html>

The nonprofit Kermit Project is funded primarily by manual sales.
For C-Kermit 6.0 the manual is the new second edition of "Using C-Kermit":

  <http://www.columbia.edu/kermit/ck60manual.html>

For RS/6000 and PowerPC with AIX 3.x or 4.x:

  <ftp://kermit.columbia.edu/kermit/archives/cku192.tar.Z> (or .gz)

Uncompress, untar (tar xvf cku192.tar) then:

  make rs6aix32c  <--  For AIX 3.x
  make rs6aix41c  <--  For AIX 4.x

This produces an exutable called "wermit".  Before installing, read the
instructions in ckuins.doc from the tar file.

If you don't have a C compiler, you can get binaries at:

  <http://www.columbia.edu/kermit/ck60ubin.html>

Send questions to kermit-support@columbia.edu.

------------------------------

4.14: Gnu dbm
From: doug@cc.ysu.edu (Doug Sewell)

Here's the fixes for RS/6000's:

apply this to testgdbm.c:
158c158
<   char opt;
---
>   int opt;
166c166
<   while ((opt = getopt (argc, argv, "rn")) != -1)
---
>   while ((opt = getopt (argc, argv, "rn")) != EOF)

Apply this to systems.h:
111a112,114
> #ifdef RS6000
> #pragma alloca
> #else
112a116
> #endif

To compile, edit the Makefile.  Set CC to bsdcc (see /usr/lpp/bos/bsdport
if you don't have 'bsdcc' on your system) and set CFLAGS to -DRS6000 and
whatever options (-g, -O) you prefer.  Don't define SYSV.

------------------------------

4.15  tcsh - an alternative shell
From: cordes@athos.cs.ua.edu (David Cordes)

tcsh is available from <ftp://ftp.deshaw.com/pub/tcsh>
Compiles with no problems. You must edit /etc/security/login.cfg to
permit users to change to this shell (chsh), adding the path where the
shell is installed (in my case, /usr/local/bin/tcsh).

>From: "A. Bryan Curnutt" <bryan@Stoner.COM>

Under AIX 3.2.5, you need to modify the "config.h" file, changing
    #define BSDSIGS
to
    #undef BSDSIGS

------------------------------

4.16: Kyoto Common Lisp

The sources are available from cli.com. The kcl package is the needed
base; also retrieve the latest akcl distribution. akcl provides a
front-end that "ports" the original kcl to a number of different
platforms. The port to the 6000 worked with no problems. However, you
must be root for make to work properly with some memory protection
routines.

------------------------------

4.17  Tcl/Tk - X-Windows scripting

Current versions: Tcl 8.0b2 and Tk 8.0b2.  They are available from
<ftp://ftp.sunlabs.com/pub/tcl/>. The Tcl/Tk web page is at
<http://sunscript.sun.com/>.

Prebuilt installp (smit) installable packages for several versions of Tcl and
Tk are available from <http://www-frec.bull.com/>.

------------------------------

4.18: Expect
From: Doug Sewell <DOUG@YSUB.YSU.EDU>
   
To build the command-interpreter version, you must have the tcl library
built successfully. The expect library doesn't require tcl.  Note:
Expect and its library are built with bsdcc, so applications using
the library probably also need to be developed with bsdcc.

I ftp'd expect from ftp.cme.nist.gov.

You need to change several lines in the makefile.  First you need
to customize source and target directories and files:
#
TCLHDIR = /usr/include
TCLLIB = -ltcl
MANDIR = /usr/man/manl               (local man-pages)
MANEXT = l
BINDIR = /u/local/bin
LIBDIR = /usr/lib
HDIR = /usr/include
...
Next set the compiler, switches, and configuration options:
#
CC = bsdcc
CFLAGS = -O
...
PTY_TYPE = bsd
...
INTERACT_TYPE = select
...
Then you need to make these changes about line 90 or so:
comment out CFLAGS = $(CLFLAGS)
un-comment these lines:
CFLAGS = $(CLFLAGS) $(CPPFLAGS)
LFLAGS = ($CLFLAGS)

Then run 'make'.

You can't run some of the examples without modification (host name,
etc).  I don't remember if I ran all of them or not, but I ran enough
that I was satisfied it worked.

------------------------------

4.19: Public domain software on CD
From: mbeckman@mbeckman.mbeckman.com (Mel Beckman)

The Prime Time Freeware CD collection is a package of two CD's and docs
containing over THREE GIGABYTES of compressed Unix software. It costs $69
>from Prime Time Freeware, 415-112 N. Mary Ave., Suite 50, Sunnyvale, CA
94086. Phone 408-738-4832 voice, 408-738-2050 fax. No internet orders as
far as I can tell.

I've extracted and compiled a number of the packages, and all have worked
flawlessly so far on my 220. Everything from programming languages to 3D
solid modeling is in this bonanza!

[Ed: The O'Reilly book, Unix Power Tools, also contains a CD-ROM with lots
of useful programs compiled for the RS/6000, among other platforms.]

------------------------------

4.20: Andrew Toolkit

From: Gary Keim <gk5g+@andrew.cmu.edu>

The Andrew Toolkit Consortium of Carnegie Mellon University's School of
Computer Science has released new versions of the Andrew User
Environment, Andrew Toolkit, and Andrew Message System.

The Andrew User Environment (AUE) is an integrated set of applications
beginning with a 'generic object' editor, ez, a help system, a system
monitoring tool (console), an editor-based shell interface (typescript),
and support for printing multi-media documents. 

The Andrew Toolkit (ATK) is a portable user-interface toolkit that runs
under X11. It provides a dynamically-loadable object-oriented
environment wherein objects can be embedded in one another. Thus, one
could edit text that, in addition to containing multiple fonts, contains
embedded raster images, spreadsheets, drawing editors, equations, simple
animations, etc. These embedded objects can also be nested.

The Andrew Message System (AMS) provides a multi-media interface to mail
and bulletin-boards. AMS supports several mail management strategies
and implements many advanced features including authentication, return
receipts, automatic sorting of mail, vote collection and tabulation,
enclosures, audit trails of related messages, and subscription
management. It has interfaces that support ttys, personal computers, 
and workstations.

Release 5.1 of Andrew contains many bug fixes and updates. There is now
support for the new Internet MIME (Multipurpose Internet Mail Extensions)
standards for multipart, and multimedia mail. For more information on
MIME, please see the CHANGES files in the ftp directory on
emsworth.andrew.cmu.edu.

This release can be obtained as follows. The sources are available via
anonymous ftp from export.lcs.mit.edu (18.30.0.238) in the
./contrib/andrew tree. For details, see ./contrib/andrew/README.

PATCH for AIX3.2: A patch to the AUIS 5.1 sources can be ftp'ed from
emsworth.andrew.cmu.edu (128.2.45.40) in ./aixpatch. For those without
internet access, a 3.5" diskette can be ordered for a nominal fee of $10
by sending, or faxing, a purchase order to the Consortium address below.

Andrew, as well as a variety of other CMU software, can also be ftp'ed
>from emsworth.andrew.cmu.edu (128.2.30.62). Those with AFS access look
at /afs/andrew.cmu.edu/itc/sm/releases/X.V11R5/ftp.

Remote Andrew Demo Service 

This network service allows you to run Andrew Toolkit applications
without obtaining or compiling the Andrew software. You need a host
machine running X11 on the Internet. A simple "finger" command will let
you experience ATK applications firsthand. You'll be able to compose
multimedia documents, navigate through the interactive Andrew Tour, and
use the Andrew Message System to browse through CMU's three thousand
bulletin boards and newsgroups.

To use the Remote Andrew Demo service, run the following command:

    finger help@atk.itc.cmu.edu 

The service will give you further instructions.

Information Sources

Your bug reports are welcome; kindly send them to
info-andrew-bugs@andrew.cmu.edu and we will periodically post a status
report to the mailing list info-andrew@andrew.cmu.edu. To be added to
the mailing list or make other requests, send mail to
info-andrew-request@andrew.cmu.edu.

We also distribute the following related materials:

ATK and AMS sources and binaries on CDROM. Binaries are available
for the following system types: 

        	IBM RiscSystem/6000 
		Sun SparcStation 
		HP 700 Series 
		DECstation 

ATK and AMS sources on QIC and Iotamat tapes Hardcopies of the
documentation for ATK and AMS. Introductory video tape: Welcome to
Andrew: An Overview of the Andrew System. Technical video tape: The
Andrew Project: A Session at the Winter 1988 Usenix Conference.

More information about these materials is available from:

    Information Requests
    Andrew Toolkit Consortium
    Carnegie Mellon University
    4910 Forbes Avenue, UCC 214
    Pittsburgh, PA 15213-3890
    USA
    phone: +1-412-268-6710
    fax: +1-412-621-8081
    info-andrew-request@andrew.cmu.edu

There is also a netnews distribution list, comp.soft-sys.andrew, which
is identical to the info-andrew list except that it does not support the
multi-media capabilities of info-andrew.

------------------------------

4.21: sudo


Sudo (superuser do) allows a system administrator to give certain users (or
groups of users) the ability to run some (or all) commands as root while
logging all commands and arguments. Sudo operates on a per-command basis, it
is not a replacement for the shell. 

The latest version of sudo is cu-sudo v1.5.  There is a web page for sudo at
<http://www.courtesan.com/courtesan/products/sudo/sudo.html>.  The program
itself can be obtained from <ftp://ftp.courtesan.com/pub/sudo/>.  Sudo's
author, Todd Miller < Todd.Miller@courtesan.com> reports that sudo works on
both AIX 3.2.X and 4.1.X. 


------------------------------

4.22: Flexfax/HylaFax and other fax software

From: Christian Zahl <czahl@cs.tu-berlin.de>

Sam Leffler has released a new version of FlexFax called HylaFax.  It
is availible from <ftp://sgi.com/sgi/fax/>.  There is a HlyaFax web
page at <http://www.vix.com/hylafax/>.  Version V3.0pl1
supported many types of Class 1/2 fax modems and several UNIX systems
including AIX 3.2.3 or greater.  There is also a fax modem review
document at the same site as <ftp://sgi.com/pub/fax/bakeoff>. The FlexFax
related files on sgi.com are replicated on ftp.bsc.no as well.

>From: michael@hal6000.thp.Uni-Duisburg.DE (Michael Staats)

We're using mgetty+sendfax for the basic modem I/O, I wrote a printer
backend for the modem so that users can send faxes as easy as they print
postscript. I also wrote a little X interface composer to generate a
fax form that makes sending faxes very easy. You can find these
programs at hal6000.thp.Uni-Duisburg.DE under /pub/source.

program				comment

mgetty+sendfax-0.14.tar.gz	basic modem I/O, needs hacking for AIX
X11/xform-1.1.tar.gz	     	small and simple X interface composer
				with an example fax form. Needs
				libxview.a incl. headers.
faxiobe.tar.gz			fax backend, needs configuring for
				your local site

If you need a binary version of libxview.a and the headers you'll find
them under /pub/binaries/AIX-3-2/lxview.tar.gz.

------------------------------

4.23: lsof - LiSt Open Files

From: abe@vic.cc.purdue.edu (Vic Abell)

Q. How can I determine the files that a process has opened?
Q. How can I locate the process that is using a specific network address?
Q. How can I locate the processes that have files open on a file system?

A. Use lsof (LiSt Open Files).
>From: "Juan G. Ruiz Pinto" <jgruiz@cyber1.servtech.com>

Lsof is available via anonymous ftp from vic.cc.purdue.edu
(128.210.15.16) in /pub/tools/unix/lsof/lsof.tar.Z (for the
most current version). The most current version is 4.14. There
are binary distributions in the "binary" directory.

Lsof supports AIX 4.1 since version 3.09.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>. The installation scripts in this package
automatically creates a group "kmem" during the install
and uses "acledit" to allow the kmem group to read /dev/mem and /dev/kmem.
This configuraqtion is reccomended by Vic Abell <abe@cc.purdue.edu>, the
author of lsof.

------------------------------

4.24: popper - POP3 mail daemon


The POP server is available via anonymous ftp from 
ftp.qualcomm.com:/quest/unix/servers/popper
  The makefile supports AIX
ftp.CC.Berkeley.EDU (128.32.136.9, 128.32.206.12).
  There are two versions in the pub directory: a compressed tar file
  popper-version.tar.Z and a Macintosh StuffIt archive in BinHex format
  called MacPOP.sit.hqx.

Problems building some versions of popper can sometimes be resolved by
compiling with bsdcc or -D_BSD.

The pine 3.95 package on <http://www-frec.bull.com/> contains "plug
and play" support for both POP3 and IMAP mail reading protocols.  You
can also get a compiled version of qpopper 2.2 there also.

------------------------------

4.26: mpeg link errors version 2.0

From: Nathan Lane <nathan@seldon.foundation.tricon.com>

.XShmCreateImage
.XShmDetach
.XShmAttach
.XShmGetEventBase
.XShmPutImage
.XShmQueryExtension

... are for the Shared Memory extension of the X server.
You can either choose to build it with shared memory or without.  I
always do it without the performance increase is not really
incredible, except on something like a 2x0 machine with the local bus
graphics adapter.  Just take out "DSH_MEM" in the CFLAGS in the
makefile for mpeg_play.  There is more information about shared memory
link errors in section 1.513.

Also, in the module "video.c" for mpeg_play it will complain about not
having enough memory to fully optimize one of the loops.  You can get
around that by specificying "qmaxmem=8000" in your cflags line, BUT,
the extra optimization does little good in my tests.

------------------------------

4.27: NNTP, INN


Link errors compiling nntp may occur because your machine lacks the
"patch" command.  Patch can be obtained from GNU repositories.  See question

4.29 for more information on patch.


------------------------------

4.28: Zmodem - File transfer

RZSZ is Chuck Forsberg's script for Z-modem. It is available by ftp at
<ftp://oak.oakland.edu/pub/unix-c/xyzmodem/rzsz9305.tar.Z> or
directly from Forsberg at Omen Technology BBS at 503-621-3746.

Hints:
0. Build with "make posix"
1. Use an 8-bit clean version of rlogin or telnet (Note: below)
2. Set the system to be transparent, I use "terminal download" 
3. Ensure hardware flow-control

Note, carlson@xylogics.com (James Carlson) suggests: Rlogin is
"slightly" unclean -- if an FF FF 73 73 appears in the datastream, it
can be ripped out by rlogind as a 'window size change' request.

[Ed note: The important part is using an 8-bit clean application,
since there are several implemenations of rlogin and telnet availible
you may need to try both and hunt down manuals to find the right flags
for your system]

------------------------------

4.29: Patch - automated file updates


AIX 3.2.5 does not ship with patch, a utility to apply the differences
between two files to make them identical.  This tool is often used to
update source code.

<ftp://ftp.x.org/pub/R6untarred/xc/util/patch/>
<ftp://prep.ai.mit.edu/pub/gnu/patch-2.1.tar.gz>

------------------------------

4.30: XNTP - network time protocol, synchronizes clocks

From: Joerg Schumacher <schuma@ips.cs.tu-bs.de>

   AIX 4:   xntpd in bos.net.tcp.client
   source:  ftp://ftp.udel.edu/pub/ntp/
   WWW:     http://www.eecis.udel.edu/~ntp/


------------------------------

4.31: GNU Screen and AIX 4.1.x


Once again,  binaries can be had from <http://www-frec.bull.com/>.

------------------------------

4.32: PINT -- SCSI scanner software

From: Kenneth Stailey <kstailey@leidecker.gsfc.nasa.gov>

<http://www.dol-esa.gov/~kstailey/pint>
<ftp://uniwa.uwa.edu.au:/pub/pint>
<ftp://ftp.gwdg.de:/pub/misc/scanner>
<ftp://alpha.gnu.ai.mit.edu:/pub/pint-0.5d.tar.gz>

------------------------------

4.33: Pager/Paging software


There is information on Paging, Paging programs and  listing of the
Archive sites to download at the web site:
<ftp://ftp.airnote.net:/pub/paging-info/ixo.faq>.

HylaFAX (see 4.22) supports sending messages to alphanumeric pagers.

Commercially there is: AlphaPage(r) MD2001 from Information Radio
Technology, Inc. in Cleveland, OH. 

------------------------------

4.34: JAVA Development Kit

From: Curt Finch <curt@tkg.com>

<http://ncc.hursley.ibm.com/javainfo/>

------------------------------

4.35: Sendmail


<ftp://ftp.sendmail.org/sendmail/>

If you want to use SRC to start and stop BSD sendmail,  do the following 
after installing it:

chssys -s sendmail -S -n 15 -f 9 -a -d99.100

This tells SRC that sendmail may be stopped with signals 15 and 9.  It also
arranges for sendmail not to daemonize itself,  since it will run under SRC.

------------------------------

4.00: GNU and Public Domain software


GNU software comes from the Free Software Foundation and various other
sources. A number of ftp sites archive them. Read the GNU license for 
rules on distributing their software.

Lots of useful public domain software have been and continue to be ported
to the RS/6000. See below for ftp or download information.

------------------------------

4.01: How do I find sources?

From: jik@GZA.COM (Jonathan Kamens)

There is a newsgroup devoted to posting about how to get a certain
source, comp.sources.wanted.  An archive of information about sources,
including FTP sites is available from

------------------------------

4.02: Are there any ftp or WWW sites?


SMIT-installable precompiled packages of popular freeware for AIX 4.x at
<http://www-frec.bull.com/>.  Download the ".exe" files with your WWW
browser. These are auto-uncompressing files, just like on PCs (it uses
similar technology to PKZIP). Mark the file as executable (chmod +x),
then execute it to generate a .bff file. The .bff file can then be
installed using "smit install_latest". For more information
read the INSTALL.txt file on the server.

There are mirrors of this site at http://www.bull.de/ and
http://ftp.univie.ac.at/aix/.

The package explicitly referenced below are ones Ciaran consideres
"solid."  That is, the binary has been "tested by lots of people."

Bull provides many other freeware packages as well.  If you use the
service,  be sure and thank Ciaran and Bull.

Below are some ftp sites that are supposed to have RS/6000 specific
software.  I haven't verified all the entries.

US sites:
<ftp://aixpdslib.seas.ucla.edu/pub/>		128.97.2.211
<ftp://aix.boulder.ibm.com/>
<ftp://software.watson.ibm.com/>

European sites:
<ftp://nic.funet.fi/pub/unix/AIX/RS6000/>		128.214.6.100
<ftp://iacrs1.unibe.ch/pub/>			130.92.11.3
<ftp://ftp.zrz.TU-Berlin.DE/pub/aix/>		130.149.4.50
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>	129.104.3.60
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>		129.69.8.13

The first one is dedicated to software running on AIX.  It might not
always be the latest versions of the software, but it has been ported
to AIX (normally AIX version 3 only).  Please use the European sites
very sparingly.  They are primarily to serve people in Europe and most
of the software can be found in the US sites originally.

The remaining sites are simply ones that archie indicated contained
AIX related materials.

<ftp://ibminet.awdpa.ibm.com/>	#IBM announcements, oem hardware
<ftp://cac.toronto.ibm.com/>	#marketing-info
<ftp://ftp.egr.duke.edu/>
<ftp://straylight.acs.ncsu.edu/>
<ftp://alpha.gnu.ai.mit.edu/rs6000>
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>
<ftp://iacrs2.unibe.ch/pub/aix/>
<ftp://ftp.u.washington.edu/pub/RS6000/>
<ftp://aixive.unb.ca/>
<ftp://ftp.ans.net/pub/misc/>
<ftp://uvaarpa.virginia.edu/pub/misc/>
<ftp://ux1.cts.eiu.edu/pub/rs6000/>
<ftp://ftp.bsc.nopub/Src/>
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>
<ftp://aix1.segi.ulg.ac.be/pub/aix/>
<ftp://byron.u.washington.edu/pub/aix/>
<ftp://cunixf.cc.columbia.edu/aix/>
<ftp://files1zrz.zrz.tu-berlin.de/pub/aix/>
<ftp://ftp.rz.uni-augsburg.de/pub/aix/>
<ftp://fyvie.cs.wisc.edu/pub/aix/>
<ftp://solaria.cc.gatech.edu/pub/aix/>
<ftp://spot.colorado.edu/aix/>
<ftp://swdsrv.edvz.univie.ac.at/unix/systems/aix/>
<ftp://switek.uni-muenster.de/pub/aix/>
<ftp://wuarchive.wustl.edu/systems/aix/>
<ftp://cs.nyu.edu/pub/AIX/>
<ftp://karazm.math.uh.edu/pub/AIX/>
<ftp://minnie.zdv.uni-mainz.de/pub0/pub/AIX/>
<ftp://oersted.ltf.dth.dk/pub/AIX/>
<ftp://rs3.hrz.th-darmstadt.de/pub/incoming/AIX/>
<ftp://aeneas.mit.edu/pub/rs6000/>
<ftp://cameron.egr.duke.edu/rs6000/>
<ftp://ifi.informatik.uni-stuttgart.de/pub/rs6000/>
<ftp://metropolis.super.org/pub/rs6000/>
<ftp://ramses.cs.cornell.edu/pub/rs6000/>
<ftp://server.uga.edu/pub/rs6000/>
<ftp://uvaarpa.virginia.edu/pub/rs6000/>
<ftp://wayback.cs.cornell.edu/pub/rs6000/>
<ftp://alice.fmi.uni-passau.de/pub/RS6000/>
<ftp://byron.u.washington.edu/pub/aix/RS6000/>
<ftp://milton.u.washington.edu/pub/RS6000/>
<ftp://pascal.math.yale.edu/pub/RS6000/>
<ftp://uxc.cso.uiuc.edu/pub/RS6000/>

------------------------------

4.03: Why does "install"ing software I got from the net fail?


This answer was moved to section 2.22

------------------------------

4.04: GNU Emacs


A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

If you get a segmentation fault in GNU EMACS 19.* during hilit19 use,
you can set locale to C (export LC_ALL=C) to get around the AIX bug.

Version 18.57 of GNU Emacs started to have RS/6000 support.  Use
s-aix3-2.h for AIX 3.2. Emacs is going through rapid changes recently.
Current release is 19.x.

Emacs will core-dump if it is stripped, so don't strip when you install
it.  You can edit a copy of the Makefile in src replacing all 'install -s' 
with /usr/ucb/install.

------------------------------

4.05: gcc/gdb


GNU C version 2.0 and later supports the RS/6000, and compiles straight
out of the box.  You may, however, experience that compiling it requires
large amounts of paging space.

Compiling gcc and gdb on AIX 3.2 requires a patch to the 'as' assembler.  Call
IBM software support and request patch for apar IX26107 (U409205).

gcc has undergone many changes lately and the current version is 2.7.x.
gdb is at 4.1x.

If your machine crashed when trying to run gdb 4.7, call software support
and request ptf U412815.

------------------------------

4.06: GNU Ghostscript


A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

The PostScript interpreter GNU Ghostscript Version 2.3 and later supports
the RS/6000 and can be found on various ftp sites. Current version is 2.6.1.

Compile time problems:
  Compile idict.c and zstack.c _without_ optimization, add the following
  to the Makefile:

  idict.o: idict.c
        $(CC) -c idict.c

  zstack.o: zstack.c
        $(CC) -c zstack.c

Run time problems:
  Running ghostview-1.5 with ghostscript-2.6.1, I get 
   gs: Malformed ghostview color property.
  Solution: replace buggy version of ghostscript-2.6.1 X11 driver
  with at least 2.6.1pl4 

------------------------------

4.07 TeX - Document processing

From: "Patrick TJ McPhee" <ptjm@ican.net>

TeX can be retrieved via ftp from the comprehensive TeX archive
network (CTAN). The principle sites are
ftp.tex.ac.uk (UK)
ftp.dante.de  (Deutschland)
ftp.tug.org  (USA)
but there are many mirrors. finger ctan@ftp.tex.ac.uk for a list.

------------------------------

4.08 Perl - Scripting language


A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

If you want the source code, <http://www.perl.com/perl/> is good place
to start.

------------------------------

4.09: X-Windows


AIX 4.x ships with X11R5 and Motif 1.2.

On AIX 3.2 the base version has X11R4 and Motif 1.1 and the extended
version has X11R5 as AIXwindows 1.2.3.  See question 1.500 for more
information about determining your revision.

AIXwindows version 1.2.0 (X11rte 1.2.0) is X11R4 with Motif 1.1
AIXwindows version 1.2.3 (X11rte 1.2.3) is X11R5 with Motif 1.1
'lslpp -h X11rte.motif1.2.obj' should tell you if you are
running Motif 1.2.

------------------------------

4.10 Bash - /bin/ksh alternative from FSF


Bash is an alternative to ksh and is availible from prep.ai.mit.edu
and places that mirror the GNU software.  /etc/security/login.cfg
needs to be modified if this will be used as a default shell.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

------------------------------

4.11: Elm


A very nice replacement for mail. Elm should be pretty straightforward,
the only thing to remember is to link with -lcurses as the only
curses/termlib library. You may also run into the problem listed under
point 2.13 above.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

------------------------------

4.12: Oberon 2.2

From: afx@muc.ibm.de (Andreas Siegert)

Oberon is Wirth's follow on to Modula-2, but is not compatible. A free
version of Modula-3 is available from DEC/Olivetti at
gatekeeper.dec.com. This is not a Modula-2 replacement but a new
language. There are currently two M2 compilers for the 6000 that I
know of. One from Edinburgh Portable Compilers, +44 31 225 6262 (UK)
and the other from Gardens Point is availible through A+L in
Switzerland (+41 65 520311) or Real Time Associates in the UK
(info@rtal.demon.co.uk).

Oberon can be obtained via anonymous ftp from neptune.inf.ethz.ch
(129.132.101.33) under the directory Oberon/RS6000 or gatekeeper.dec.com
(16.1.0.2).

------------------------------

4.13: Kermit - Communications

From: Frank da Cruz <fdc@watsun.cc.columbia.edu>

Available for all versions of AIX on RS/6000, PowerPC, PS/2, RT PC,
and 370-Series mainframes.  For complete information on Kermit software
for AIX and hundreds of other platforms, visit the Kermit Web site:

  <http://www.columbia.edu/kermit/>

C-Kermit 6.0 was announced November 30, 1996:

  <http://www.columbia.edu/kermit/ck60.html>

The nonprofit Kermit Project is funded primarily by manual sales.
For C-Kermit 6.0 the manual is the new second edition of "Using C-Kermit":

  <http://www.columbia.edu/kermit/ck60manual.html>

For RS/6000 and PowerPC with AIX 3.x or 4.x:

  <ftp://kermit.columbia.edu/kermit/archives/cku192.tar.Z> (or .gz)

Uncompress, untar (tar xvf cku192.tar) then:

  make rs6aix32c  <--  For AIX 3.x
  make rs6aix41c  <--  For AIX 4.x

This produces an exutable called "wermit".  Before installing, read the
instructions in ckuins.doc from the tar file.

If you don't have a C compiler, you can get binaries at:

  <http://www.columbia.edu/kermit/ck60ubin.html>

Send questions to kermit-support@columbia.edu.

------------------------------

4.14: Gnu dbm

From: doug@cc.ysu.edu (Doug Sewell)

Here's the fixes for RS/6000's:

apply this to testgdbm.c:
158c158
<   char opt;
---
>   int opt;
166c166
<   while ((opt = getopt (argc, argv, "rn")) != -1)
---
>   while ((opt = getopt (argc, argv, "rn")) != EOF)

Apply this to systems.h:
111a112,114
> #ifdef RS6000
> #pragma alloca
> #else
112a116
> #endif

To compile, edit the Makefile.  Set CC to bsdcc (see /usr/lpp/bos/bsdport
if you don't have 'bsdcc' on your system) and set CFLAGS to -DRS6000 and
whatever options (-g, -O) you prefer.  Don't define SYSV.

------------------------------

4.15 tcsh - an alternative shell

From: cordes@athos.cs.ua.edu (David Cordes)

tcsh is available from <ftp://ftp.deshaw.com/pub/tcsh>
Compiles with no problems. You must edit /etc/security/login.cfg to
permit users to change to this shell (chsh), adding the path where the
shell is installed (in my case, /usr/local/bin/tcsh).

>From: "A. Bryan Curnutt" <bryan@Stoner.COM>

Under AIX 3.2.5, you need to modify the "config.h" file, changing
    #define BSDSIGS
to
    #undef BSDSIGS

------------------------------

4.16: Kyoto Common Lisp


The sources are available from cli.com. The kcl package is the needed
base; also retrieve the latest akcl distribution. akcl provides a
front-end that "ports" the original kcl to a number of different
platforms. The port to the 6000 worked with no problems. However, you
must be root for make to work properly with some memory protection
routines.

------------------------------

4.17 Tcl/Tk - X-Windows scripting


Current versions: Tcl 8.0b2 and Tk 8.0b2.  They are available from
<ftp://ftp.sunlabs.com/pub/tcl/>. The Tcl/Tk web page is at
<http://sunscript.sun.com/>.

Prebuilt installp (smit) installable packages for several versions of Tcl and
Tk are available from <http://www-frec.bull.com/>.

------------------------------

4.18: Expect

From: Doug Sewell <DOUG@YSUB.YSU.EDU>
   
To build the command-interpreter version, you must have the tcl library
built successfully. The expect library doesn't require tcl.  Note:
Expect and its library are built with bsdcc, so applications using
the library probably also need to be developed with bsdcc.

I ftp'd expect from ftp.cme.nist.gov.

You need to change several lines in the makefile.  First you need
to customize source and target directories and files:
#
TCLHDIR = /usr/include
TCLLIB = -ltcl
MANDIR = /usr/man/manl               (local man-pages)
MANEXT = l
BINDIR = /u/local/bin
LIBDIR = /usr/lib
HDIR = /usr/include
...
Next set the compiler, switches, and configuration options:
#
CC = bsdcc
CFLAGS = -O
...
PTY_TYPE = bsd
...
INTERACT_TYPE = select
...
Then you need to make these changes about line 90 or so:
comment out CFLAGS = $(CLFLAGS)
un-comment these lines:
CFLAGS = $(CLFLAGS) $(CPPFLAGS)
LFLAGS = ($CLFLAGS)

Then run 'make'.

You can't run some of the examples without modification (host name,
etc).  I don't remember if I ran all of them or not, but I ran enough
that I was satisfied it worked.

------------------------------

4.19: Public domain software on CD

From: mbeckman@mbeckman.mbeckman.com (Mel Beckman)

The Prime Time Freeware CD collection is a package of two CD's and docs
containing over THREE GIGABYTES of compressed Unix software. It costs $69
>from Prime Time Freeware, 415-112 N. Mary Ave., Suite 50, Sunnyvale, CA
94086. Phone 408-738-4832 voice, 408-738-2050 fax. No internet orders as
far as I can tell.

I've extracted and compiled a number of the packages, and all have worked
flawlessly so far on my 220. Everything from programming languages to 3D
solid modeling is in this bonanza!

[Ed: The O'Reilly book, Unix Power Tools, also contains a CD-ROM with lots
of useful programs compiled for the RS/6000, among other platforms.]

------------------------------

4.20: Andrew Toolkit

From: Gary Keim <gk5g+@andrew.cmu.edu>

The Andrew Toolkit Consortium of Carnegie Mellon University's School of
Computer Science has released new versions of the Andrew User
Environment, Andrew Toolkit, and Andrew Message System.

The Andrew User Environment (AUE) is an integrated set of applications
beginning with a 'generic object' editor, ez, a help system, a system
monitoring tool (console), an editor-based shell interface (typescript),
and support for printing multi-media documents. 

The Andrew Toolkit (ATK) is a portable user-interface toolkit that runs
under X11. It provides a dynamically-loadable object-oriented
environment wherein objects can be embedded in one another. Thus, one
could edit text that, in addition to containing multiple fonts, contains
embedded raster images, spreadsheets, drawing editors, equations, simple
animations, etc. These embedded objects can also be nested.

The Andrew Message System (AMS) provides a multi-media interface to mail
and bulletin-boards. AMS supports several mail management strategies
and implements many advanced features including authentication, return
receipts, automatic sorting of mail, vote collection and tabulation,
enclosures, audit trails of related messages, and subscription
management. It has interfaces that support ttys, personal computers, 
and workstations.

Release 5.1 of Andrew contains many bug fixes and updates. There is now
support for the new Internet MIME (Multipurpose Internet Mail Extensions)
standards for multipart, and multimedia mail. For more information on
MIME, please see the CHANGES files in the ftp directory on
emsworth.andrew.cmu.edu.

This release can be obtained as follows. The sources are available via
anonymous ftp from export.lcs.mit.edu (18.30.0.238) in the
./contrib/andrew tree. For details, see ./contrib/andrew/README.

PATCH for AIX3.2: A patch to the AUIS 5.1 sources can be ftp'ed from
emsworth.andrew.cmu.edu (128.2.45.40) in ./aixpatch. For those without
internet access, a 3.5" diskette can be ordered for a nominal fee of $10
by sending, or faxing, a purchase order to the Consortium address below.

Andrew, as well as a variety of other CMU software, can also be ftp'ed
>from emsworth.andrew.cmu.edu (128.2.30.62). Those with AFS access look
at /afs/andrew.cmu.edu/itc/sm/releases/X.V11R5/ftp.

Remote Andrew Demo Service 

This network service allows you to run Andrew Toolkit applications
without obtaining or compiling the Andrew software. You need a host
machine running X11 on the Internet. A simple "finger" command will let
you experience ATK applications firsthand. You'll be able to compose
multimedia documents, navigate through the interactive Andrew Tour, and
use the Andrew Message System to browse through CMU's three thousand
bulletin boards and newsgroups.

To use the Remote Andrew Demo service, run the following command:

    finger help@atk.itc.cmu.edu 

The service will give you further instructions.

Information Sources

Your bug reports are welcome; kindly send them to
info-andrew-bugs@andrew.cmu.edu and we will periodically post a status
report to the mailing list info-andrew@andrew.cmu.edu. To be added to
the mailing list or make other requests, send mail to
info-andrew-request@andrew.cmu.edu.

We also distribute the following related materials:

ATK and AMS sources and binaries on CDROM. Binaries are available
for the following system types: 

        	IBM RiscSystem/6000 
		Sun SparcStation 
		HP 700 Series 
		DECstation 

ATK and AMS sources on QIC and Iotamat tapes Hardcopies of the
documentation for ATK and AMS. Introductory video tape: Welcome to
Andrew: An Overview of the Andrew System. Technical video tape: The
Andrew Project: A Session at the Winter 1988 Usenix Conference.

More information about these materials is available from:

    Information Requests
    Andrew Toolkit Consortium
    Carnegie Mellon University
    4910 Forbes Avenue, UCC 214
    Pittsburgh, PA 15213-3890
    USA
    phone: +1-412-268-6710
    fax: +1-412-621-8081
    info-andrew-request@andrew.cmu.edu

There is also a netnews distribution list, comp.soft-sys.andrew, which
is identical to the info-andrew list except that it does not support the
multi-media capabilities of info-andrew.

------------------------------

4.21: sudo


Sudo (superuser do) allows a system administrator to give certain users (or
groups of users) the ability to run some (or all) commands as root while
logging all commands and arguments. Sudo operates on a per-command basis, it
is not a replacement for the shell. 

The latest version of sudo is cu-sudo v1.5.  There is a web page for sudo at
<http://www.courtesan.com/courtesan/products/sudo/sudo.html>.  The program
itself can be obtained from <ftp://ftp.courtesan.com/pub/sudo/>.  Sudo's
author, Todd Miller < Todd.Miller@courtesan.com> reports that sudo works on
both AIX 3.2.X and 4.1.X. 


------------------------------

4.22: Flexfax/HylaFax and other fax software

From: Christian Zahl <czahl@cs.tu-berlin.de>

Sam Leffler has released a new version of FlexFax called HylaFax.  It
is availible from <ftp://sgi.com/sgi/fax/>.  There is a HlyaFax web
page at <http://www.vix.com/hylafax/>.  Version V3.0pl1
supported many types of Class 1/2 fax modems and several UNIX systems
including AIX 3.2.3 or greater.  There is also a fax modem review
document at the same site as <ftp://sgi.com/pub/fax/bakeoff>. The FlexFax
related files on sgi.com are replicated on ftp.bsc.no as well.

>From: michael@hal6000.thp.Uni-Duisburg.DE (Michael Staats)

We're using mgetty+sendfax for the basic modem I/O, I wrote a printer
backend for the modem so that users can send faxes as easy as they print
postscript. I also wrote a little X interface composer to generate a
fax form that makes sending faxes very easy. You can find these
programs at hal6000.thp.Uni-Duisburg.DE under /pub/source.

program				comment

mgetty+sendfax-0.14.tar.gz	basic modem I/O, needs hacking for AIX
X11/xform-1.1.tar.gz	     	small and simple X interface composer
				with an example fax form. Needs
				libxview.a incl. headers.
faxiobe.tar.gz			fax backend, needs configuring for
				your local site

If you need a binary version of libxview.a and the headers you'll find
them under /pub/binaries/AIX-3-2/lxview.tar.gz.

------------------------------

4.23: lsof - LiSt Open Files

From: abe@vic.cc.purdue.edu (Vic Abell)

Q. How can I determine the files that a process has opened?
Q. How can I locate the process that is using a specific network address?
Q. How can I locate the processes that have files open on a file system?

A. Use lsof (LiSt Open Files).
>From: "Juan G. Ruiz Pinto" <jgruiz@cyber1.servtech.com>

Lsof is available via anonymous ftp from vic.cc.purdue.edu
(128.210.15.16) in /pub/tools/unix/lsof/lsof.tar.Z (for the
most current version). The most current version is 4.14. There
are binary distributions in the "binary" directory.

Lsof supports AIX 4.1 since version 3.09.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>. The installation scripts in this package
automatically creates a group "kmem" during the install
and uses "acledit" to allow the kmem group to read /dev/mem and /dev/kmem.
This configuraqtion is reccomended by Vic Abell <abe@cc.purdue.edu>, the
author of lsof.

------------------------------

4.24: popper - POP3 mail daemon


The POP server is available via anonymous ftp from 
ftp.qualcomm.com:/quest/unix/servers/popper
  The makefile supports AIX
ftp.CC.Berkeley.EDU (128.32.136.9, 128.32.206.12).
  There are two versions in the pub directory: a compressed tar file
  popper-version.tar.Z and a Macintosh StuffIt archive in BinHex format
  called MacPOP.sit.hqx.

Problems building some versions of popper can sometimes be resolved by
compiling with bsdcc or -D_BSD.

The pine 3.95 package on <http://www-frec.bull.com/> contains "plug
and play" support for both POP3 and IMAP mail reading protocols.  You
can also get a compiled version of qpopper 2.2 there also.

------------------------------

4.26: mpeg link errors version 2.0

From: Nathan Lane <nathan@seldon.foundation.tricon.com>

.XShmCreateImage
.XShmDetach
.XShmAttach
.XShmGetEventBase
.XShmPutImage
.XShmQueryExtension

... are for the Shared Memory extension of the X server.
You can either choose to build it with shared memory or without.  I
always do it without the performance increase is not really
incredible, except on something like a 2x0 machine with the local bus
graphics adapter.  Just take out "DSH_MEM" in the CFLAGS in the
makefile for mpeg_play.  There is more information about shared memory
link errors in section 1.513.

Also, in the module "video.c" for mpeg_play it will complain about not
having enough memory to fully optimize one of the loops.  You can get
around that by specificying "qmaxmem=8000" in your cflags line, BUT,
the extra optimization does little good in my tests.

------------------------------

4.27: NNTP, INN


Link errors compiling nntp may occur because your machine lacks the
"patch" command.  Patch can be obtained from GNU repositories.  See question

4.29 for more information on patch.


------------------------------

4.28: Zmodem - File transfer

RZSZ is Chuck Forsberg's script for Z-modem. It is available by ftp at
<ftp://oak.oakland.edu/pub/unix-c/xyzmodem/rzsz9305.tar.Z> or
directly from Forsberg at Omen Technology BBS at 503-621-3746.

Hints:
0. Build with "make posix"
1. Use an 8-bit clean version of rlogin or telnet (Note: below)
2. Set the system to be transparent, I use "terminal download" 
3. Ensure hardware flow-control

Note, carlson@xylogics.com (James Carlson) suggests: Rlogin is
"slightly" unclean -- if an FF FF 73 73 appears in the datastream, it
can be ripped out by rlogind as a 'window size change' request.

[Ed note: The important part is using an 8-bit clean application,
since there are several implemenations of rlogin and telnet availible
you may need to try both and hunt down manuals to find the right flags
for your system]

------------------------------

4.29: Patch - automated file updates


AIX 3.2.5 does not ship with patch, a utility to apply the differences
between two files to make them identical.  This tool is often used to
update source code.

<ftp://ftp.x.org/pub/R6untarred/xc/util/patch/>
<ftp://prep.ai.mit.edu/pub/gnu/patch-2.1.tar.gz>

------------------------------

4.30: XNTP - network time protocol, synchronizes clocks

From: Joerg Schumacher <schuma@ips.cs.tu-bs.de>

   AIX 4:   xntpd in bos.net.tcp.client
   source:  ftp://ftp.udel.edu/pub/ntp/
   WWW:     http://www.eecis.udel.edu/~ntp/


------------------------------

4.31: GNU Screen and AIX 4.1.x


Once again,  binaries can be had from <http://www-frec.bull.com/>.

------------------------------

4.32: PINT -- SCSI scanner software

From: Kenneth Stailey <kstailey@leidecker.gsfc.nasa.gov>

<http://www.dol-esa.gov/~kstailey/pint>
<ftp://uniwa.uwa.edu.au:/pub/pint>
<ftp://ftp.gwdg.de:/pub/misc/scanner>
<ftp://alpha.gnu.ai.mit.edu:/pub/pint-0.5d.tar.gz>

------------------------------

4.33: Pager/Paging software


There is information on Paging, Paging programs and  listing of the
Archive sites to download at the web site:
<ftp://ftp.airnote.net:/pub/paging-info/ixo.faq>.

HylaFAX (see 4.22) supports sending messages to alphanumeric pagers.

Commercially there is: AlphaPage(r) MD2001 from Information Radio
Technology, Inc. in Cleveland, OH. 

------------------------------

4.34: JAVA Development Kit

From: Curt Finch <curt@tkg.com>

<http://ncc.hursley.ibm.com/javainfo/>

------------------------------

4.35: Sendmail


<ftp://ftp.sendmail.org/sendmail/>

If you want to use SRC to start and stop BSD sendmail,  do the following 
after installing it:

chssys -s sendmail -S -n 15 -f 9 -a -d99.100

This tells SRC that sendmail may be stopped with signals 15 and 9.  It also
arranges for sendmail not to daemonize itself,  since it will run under SRC.

------------------------------

4.00: GNU and Public Domain software


GNU software comes from the Free Software Foundation and various other
sources. A number of ftp sites archive them. Read the GNU license for 
rules on distributing their software.

Lots of useful public domain software have been and continue to be ported
to the RS/6000. See below for ftp or download information.

------------------------------

4.01: How do I find sources?

From: jik@GZA.COM (Jonathan Kamens)

There is a newsgroup devoted to posting about how to get a certain
source, comp.sources.wanted.  An archive of information about sources,
including FTP sites is available from

------------------------------

4.02: Are there any ftp or WWW sites?


SMIT-installable precompiled packages of popular freeware for AIX 4.x at
<http://www-frec.bull.com/>.  Download the ".exe" files with your WWW
browser. These are auto-uncompressing files, just like on PCs (it uses
similar technology to PKZIP). Mark the file as executable (chmod +x),
then execute it to generate a .bff file. The .bff file can then be
installed using "smit install_latest". For more information
read the INSTALL.txt file on the server.

There are mirrors of this site at http://www.bull.de/ and
http://ftp.univie.ac.at/aix/.

The package explicitly referenced below are ones Ciaran consideres
"solid."  That is, the binary has been "tested by lots of people."

Bull provides many other freeware packages as well.  If you use the
service,  be sure and thank Ciaran and Bull.

Below are some ftp sites that are supposed to have RS/6000 specific
software.  I haven't verified all the entries.

US sites:
<ftp://aixpdslib.seas.ucla.edu/pub/>		128.97.2.211
<ftp://aix.boulder.ibm.com/>
<ftp://software.watson.ibm.com/>

European sites:
<ftp://nic.funet.fi/pub/unix/AIX/RS6000/>		128.214.6.100
<ftp://iacrs1.unibe.ch/pub/>			130.92.11.3
<ftp://ftp.zrz.TU-Berlin.DE/pub/aix/>		130.149.4.50
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>	129.104.3.60
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>		129.69.8.13

The first one is dedicated to software running on AIX.  It might not
always be the latest versions of the software, but it has been ported
to AIX (normally AIX version 3 only).  Please use the European sites
very sparingly.  They are primarily to serve people in Europe and most
of the software can be found in the US sites originally.

The remaining sites are simply ones that archie indicated contained
AIX related materials.

<ftp://ibminet.awdpa.ibm.com/>	#IBM announcements, oem hardware
<ftp://cac.toronto.ibm.com/>	#marketing-info
<ftp://ftp.egr.duke.edu/>
<ftp://straylight.acs.ncsu.edu/>
<ftp://alpha.gnu.ai.mit.edu/rs6000>
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>
<ftp://iacrs2.unibe.ch/pub/aix/>
<ftp://ftp.u.washington.edu/pub/RS6000/>
<ftp://aixive.unb.ca/>
<ftp://ftp.ans.net/pub/misc/>
<ftp://uvaarpa.virginia.edu/pub/misc/>
<ftp://ux1.cts.eiu.edu/pub/rs6000/>
<ftp://ftp.bsc.nopub/Src/>
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>
<ftp://aix1.segi.ulg.ac.be/pub/aix/>
<ftp://byron.u.washington.edu/pub/aix/>
<ftp://cunixf.cc.columbia.edu/aix/>
<ftp://files1zrz.zrz.tu-berlin.de/pub/aix/>
<ftp://ftp.rz.uni-augsburg.de/pub/aix/>
<ftp://fyvie.cs.wisc.edu/pub/aix/>
<ftp://solaria.cc.gatech.edu/pub/aix/>
<ftp://spot.colorado.edu/aix/>
<ftp://swdsrv.edvz.univie.ac.at/unix/systems/aix/>
<ftp://switek.uni-muenster.de/pub/aix/>
<ftp://wuarchive.wustl.edu/systems/aix/>
<ftp://cs.nyu.edu/pub/AIX/>
<ftp://karazm.math.uh.edu/pub/AIX/>
<ftp://minnie.zdv.uni-mainz.de/pub0/pub/AIX/>
<ftp://oersted.ltf.dth.dk/pub/AIX/>
<ftp://rs3.hrz.th-darmstadt.de/pub/incoming/AIX/>
<ftp://aeneas.mit.edu/pub/rs6000/>
<ftp://cameron.egr.duke.edu/rs6000/>
<ftp://ifi.informatik.uni-stuttgart.de/pub/rs6000/>
<ftp://metropolis.super.org/pub/rs6000/>
<ftp://ramses.cs.cornell.edu/pub/rs6000/>
<ftp://server.uga.edu/pub/rs6000/>
<ftp://uvaarpa.virginia.edu/pub/rs6000/>
<ftp://wayback.cs.cornell.edu/pub/rs6000/>
<ftp://alice.fmi.uni-passau.de/pub/RS6000/>
<ftp://byron.u.washington.edu/pub/aix/RS6000/>
<ftp://milton.u.washington.edu/pub/RS6000/>
<ftp://pascal.math.yale.edu/pub/RS6000/>
<ftp://uxc.cso.uiuc.edu/pub/RS6000/>

------------------------------

4.03: Why does "install"ing software I got from the net fail?


This answer was moved to section 2.22

------------------------------

4.04: GNU Emacs


A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

If you get a segmentation fault in GNU EMACS 19.* during hilit19 use,
you can set locale to C (export LC_ALL=C) to get around the AIX bug.

Version 18.57 of GNU Emacs started to have RS/6000 support.  Use
s-aix3-2.h for AIX 3.2. Emacs is going through rapid changes recently.
Current release is 19.x.

Emacs will core-dump if it is stripped, so don't strip when you install
it.  You can edit a copy of the Makefile in src replacing all 'install -s' 
with /usr/ucb/install.

------------------------------

4.05: gcc/gdb


GNU C version 2.0 and later supports the RS/6000, and compiles straight
out of the box.  You may, however, experience that compiling it requires
large amounts of paging space.

Compiling gcc and gdb on AIX 3.2 requires a patch to the 'as' assembler.  Call
IBM software support and request patch for apar IX26107 (U409205).

gcc has undergone many changes lately and the current version is 2.7.x.
gdb is at 4.1x.

If your machine crashed when trying to run gdb 4.7, call software support
and request ptf U412815.

------------------------------

4.06: GNU Ghostscript


A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

The PostScript interpreter GNU Ghostscript Version 2.3 and later supports
the RS/6000 and can be found on various ftp sites. Current version is 2.6.1.

Compile time problems:
  Compile idict.c and zstack.c _without_ optimization, add the following
  to the Makefile:

  idict.o: idict.c
        $(CC) -c idict.c

  zstack.o: zstack.c
        $(CC) -c zstack.c

Run time problems:
  Running ghostview-1.5 with ghostscript-2.6.1, I get 
   gs: Malformed ghostview color property.
  Solution: replace buggy version of ghostscript-2.6.1 X11 driver
  with at least 2.6.1pl4 

------------------------------

4.07 TeX - Document processing

From: "Patrick TJ McPhee" <ptjm@ican.net>

TeX can be retrieved via ftp from the comprehensive TeX archive
network (CTAN). The principle sites are
ftp.tex.ac.uk (UK)
ftp.dante.de  (Deutschland)
ftp.tug.org  (USA)
but there are many mirrors. finger ctan@ftp.tex.ac.uk for a list.

------------------------------

4.08 Perl - Scripting language


A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

If you want the source code, <http://www.perl.com/perl/> is good place
to start.

------------------------------

4.09: X-Windows


AIX 4.x ships with X11R5 and Motif 1.2.

On AIX 3.2 the base version has X11R4 and Motif 1.1 and the extended
version has X11R5 as AIXwindows 1.2.3.  See question 1.500 for more
information about determining your revision.

AIXwindows version 1.2.0 (X11rte 1.2.0) is X11R4 with Motif 1.1
AIXwindows version 1.2.3 (X11rte 1.2.3) is X11R5 with Motif 1.1
'lslpp -h X11rte.motif1.2.obj' should tell you if you are
running Motif 1.2.

------------------------------

4.10 Bash - /bin/ksh alternative from FSF


Bash is an alternative to ksh and is availible from prep.ai.mit.edu
and places that mirror the GNU software.  /etc/security/login.cfg
needs to be modified if this will be used as a default shell.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

------------------------------

4.11: Elm


A very nice replacement for mail. Elm should be pretty straightforward,
the only thing to remember is to link with -lcurses as the only
curses/termlib library. You may also run into the problem listed under
point 2.13 above.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

------------------------------

4.12: Oberon 2.2

From: afx@muc.ibm.de (Andreas Siegert)

Oberon is Wirth's follow on to Modula-2, but is not compatible. A free
version of Modula-3 is available from DEC/Olivetti at
gatekeeper.dec.com. This is not a Modula-2 replacement but a new
language. There are currently two M2 compilers for the 6000 that I
know of. One from Edinburgh Portable Compilers, +44 31 225 6262 (UK)
and the other from Gardens Point is availible through A+L in
Switzerland (+41 65 520311) or Real Time Associates in the UK
(info@rtal.demon.co.uk).

Oberon can be obtained via anonymous ftp from neptune.inf.ethz.ch
(129.132.101.33) under the directory Oberon/RS6000 or gatekeeper.dec.com
(16.1.0.2).

------------------------------

4.13: Kermit - Communications

From: Frank da Cruz <fdc@watsun.cc.columbia.edu>

Available for all versions of AIX on RS/6000, PowerPC, PS/2, RT PC,
and 370-Series mainframes.  For complete information on Kermit software
for AIX and hundreds of other platforms, visit the Kermit Web site:

  <http://www.columbia.edu/kermit/>

C-Kermit 6.0 was announced November 30, 1996:

  <http://www.columbia.edu/kermit/ck60.html>

The nonprofit Kermit Project is funded primarily by manual sales.
For C-Kermit 6.0 the manual is the new second edition of "Using C-Kermit":

  <http://www.columbia.edu/kermit/ck60manual.html>

For RS/6000 and PowerPC with AIX 3.x or 4.x:

  <ftp://kermit.columbia.edu/kermit/archives/cku192.tar.Z> (or .gz)

Uncompress, untar (tar xvf cku192.tar) then:

  make rs6aix32c  <--  For AIX 3.x
  make rs6aix41c  <--  For AIX 4.x

This produces an exutable called "wermit".  Before installing, read the
instructions in ckuins.doc from the tar file.

If you don't have a C compiler, you can get binaries at:

  <http://www.columbia.edu/kermit/ck60ubin.html>

Send questions to kermit-support@columbia.edu.

------------------------------

4.14: Gnu dbm

From: doug@cc.ysu.edu (Doug Sewell)

Here's the fixes for RS/6000's:

apply this to testgdbm.c:
158c158
<   char opt;
---
>   int opt;
166c166
<   while ((opt = getopt (argc, argv, "rn")) != -1)
---
>   while ((opt = getopt (argc, argv, "rn")) != EOF)

Apply this to systems.h:
111a112,114
> #ifdef RS6000
> #pragma alloca
> #else
112a116
> #endif

To compile, edit the Makefile.  Set CC to bsdcc (see /usr/lpp/bos/bsdport
if you don't have 'bsdcc' on your system) and set CFLAGS to -DRS6000 and
whatever options (-g, -O) you prefer.  Don't define SYSV.

------------------------------

4.15 tcsh - an alternative shell

From: cordes@athos.cs.ua.edu (David Cordes)

tcsh is available from <ftp://ftp.deshaw.com/pub/tcsh>
Compiles with no problems. You must edit /etc/security/login.cfg to
permit users to change to this shell (chsh), adding the path where the
shell is installed (in my case, /usr/local/bin/tcsh).

>From: "A. Bryan Curnutt" <bryan@Stoner.COM>

Under AIX 3.2.5, you need to modify the "config.h" file, changing
    #define BSDSIGS
to
    #undef BSDSIGS

------------------------------

4.16: Kyoto Common Lisp


The sources are available from cli.com. The kcl package is the needed
base; also retrieve the latest akcl distribution. akcl provides a
front-end that "ports" the original kcl to a number of different
platforms. The port to the 6000 worked with no problems. However, you
must be root for make to work properly with some memory protection
routines.

------------------------------

4.17 Tcl/Tk - X-Windows scripting


Current versions: Tcl 8.0b2 and Tk 8.0b2.  They are available from
<ftp://ftp.sunlabs.com/pub/tcl/>. The Tcl/Tk web page is at
<http://sunscript.sun.com/>.

Prebuilt installp (smit) installable packages for several versions of Tcl and
Tk are available from <http://www-frec.bull.com/>.

------------------------------

4.18: Expect

From: Doug Sewell <DOUG@YSUB.YSU.EDU>
   
To build the command-interpreter version, you must have the tcl library
built successfully. The expect library doesn't require tcl.  Note:
Expect and its library are built with bsdcc, so applications using
the library probably also need to be developed with bsdcc.

I ftp'd expect from ftp.cme.nist.gov.

You need to change several lines in the makefile.  First you need
to customize source and target directories and files:
#
TCLHDIR = /usr/include
TCLLIB = -ltcl
MANDIR = /usr/man/manl               (local man-pages)
MANEXT = l
BINDIR = /u/local/bin
LIBDIR = /usr/lib
HDIR = /usr/include
...
Next set the compiler, switches, and configuration options:
#
CC = bsdcc
CFLAGS = -O
...
PTY_TYPE = bsd
...
INTERACT_TYPE = select
...
Then you need to make these changes about line 90 or so:
comment out CFLAGS = $(CLFLAGS)
un-comment these lines:
CFLAGS = $(CLFLAGS) $(CPPFLAGS)
LFLAGS = ($CLFLAGS)

Then run 'make'.

You can't run some of the examples without modification (host name,
etc).  I don't remember if I ran all of them or not, but I ran enough
that I was satisfied it worked.

------------------------------

4.19: Public domain software on CD

From: mbeckman@mbeckman.mbeckman.com (Mel Beckman)

The Prime Time Freeware CD collection is a package of two CD's and docs
containing over THREE GIGABYTES of compressed Unix software. It costs $69
>from Prime Time Freeware, 415-112 N. Mary Ave., Suite 50, Sunnyvale, CA
94086. Phone 408-738-4832 voice, 408-738-2050 fax. No internet orders as
far as I can tell.

I've extracted and compiled a number of the packages, and all have worked
flawlessly so far on my 220. Everything from programming languages to 3D
solid modeling is in this bonanza!

[Ed: The O'Reilly book, Unix Power Tools, also contains a CD-ROM with lots
of useful programs compiled for the RS/6000, among other platforms.]

------------------------------

4.20: Andrew Toolkit

From: Gary Keim <gk5g+@andrew.cmu.edu>

The Andrew Toolkit Consortium of Carnegie Mellon University's School of
Computer Science has released new versions of the Andrew User
Environment, Andrew Toolkit, and Andrew Message System.

The Andrew User Environment (AUE) is an integrated set of applications
beginning with a 'generic object' editor, ez, a help system, a system
monitoring tool (console), an editor-based shell interface (typescript),
and support for printing multi-media documents. 

The Andrew Toolkit (ATK) is a portable user-interface toolkit that runs
under X11. It provides a dynamically-loadable object-oriented
environment wherein objects can be embedded in one another. Thus, one
could edit text that, in addition to containing multiple fonts, contains
embedded raster images, spreadsheets, drawing editors, equations, simple
animations, etc. These embedded objects can also be nested.

The Andrew Message System (AMS) provides a multi-media interface to mail
and bulletin-boards. AMS supports several mail management strategies
and implements many advanced features including authentication, return
receipts, automatic sorting of mail, vote collection and tabulation,
enclosures, audit trails of related messages, and subscription
management. It has interfaces that support ttys, personal computers, 
and workstations.

Release 5.1 of Andrew contains many bug fixes and updates. There is now
support for the new Internet MIME (Multipurpose Internet Mail Extensions)
standards for multipart, and multimedia mail. For more information on
MIME, please see the CHANGES files in the ftp directory on
emsworth.andrew.cmu.edu.

This release can be obtained as follows. The sources are available via
anonymous ftp from export.lcs.mit.edu (18.30.0.238) in the
./contrib/andrew tree. For details, see ./contrib/andrew/README.

PATCH for AIX3.2: A patch to the AUIS 5.1 sources can be ftp'ed from
emsworth.andrew.cmu.edu (128.2.45.40) in ./aixpatch. For those without
internet access, a 3.5" diskette can be ordered for a nominal fee of $10
by sending, or faxing, a purchase order to the Consortium address below.

Andrew, as well as a variety of other CMU software, can also be ftp'ed
>from emsworth.andrew.cmu.edu (128.2.30.62). Those with AFS access look
at /afs/andrew.cmu.edu/itc/sm/releases/X.V11R5/ftp.

Remote Andrew Demo Service 

This network service allows you to run Andrew Toolkit applications
without obtaining or compiling the Andrew software. You need a host
machine running X11 on the Internet. A simple "finger" command will let
you experience ATK applications firsthand. You'll be able to compose
multimedia documents, navigate through the interactive Andrew Tour, and
use the Andrew Message System to browse through CMU's three thousand
bulletin boards and newsgroups.

To use the Remote Andrew Demo service, run the following command:

    finger help@atk.itc.cmu.edu 

The service will give you further instructions.

Information Sources

Your bug reports are welcome; kindly send them to
info-andrew-bugs@andrew.cmu.edu and we will periodically post a status
report to the mailing list info-andrew@andrew.cmu.edu. To be added to
the mailing list or make other requests, send mail to
info-andrew-request@andrew.cmu.edu.

We also distribute the following related materials:

ATK and AMS sources and binaries on CDROM. Binaries are available
for the following system types: 

        	IBM RiscSystem/6000 
		Sun SparcStation 
		HP 700 Series 
		DECstation 

ATK and AMS sources on QIC and Iotamat tapes Hardcopies of the
documentation for ATK and AMS. Introductory video tape: Welcome to
Andrew: An Overview of the Andrew System. Technical video tape: The
Andrew Project: A Session at the Winter 1988 Usenix Conference.

More information about these materials is available from:

    Information Requests
    Andrew Toolkit Consortium
    Carnegie Mellon University
    4910 Forbes Avenue, UCC 214
    Pittsburgh, PA 15213-3890
    USA
    phone: +1-412-268-6710
    fax: +1-412-621-8081
    info-andrew-request@andrew.cmu.edu

There is also a netnews distribution list, comp.soft-sys.andrew, which
is identical to the info-andrew list except that it does not support the
multi-media capabilities of info-andrew.

------------------------------

4.21: sudo


Sudo (superuser do) allows a system administrator to give certain users (or
groups of users) the ability to run some (or all) commands as root while
logging all commands and arguments. Sudo operates on a per-command basis, it
is not a replacement for the shell. 

The latest version of sudo is cu-sudo v1.5.  There is a web page for sudo at
<http://www.courtesan.com/courtesan/products/sudo/sudo.html>.  The program
itself can be obtained from <ftp://ftp.courtesan.com/pub/sudo/>.  Sudo's
author, Todd Miller < Todd.Miller@courtesan.com> reports that sudo works on
both AIX 3.2.X and 4.1.X. 


------------------------------

4.22: Flexfax/HylaFax and other fax software

From: Christian Zahl <czahl@cs.tu-berlin.de>

Sam Leffler has released a new version of FlexFax called HylaFax.  It
is availible from <ftp://sgi.com/sgi/fax/>.  There is a HlyaFax web
page at <http://www.vix.com/hylafax/>.  Version V3.0pl1
supported many types of Class 1/2 fax modems and several UNIX systems
including AIX 3.2.3 or greater.  There is also a fax modem review
document at the same site as <ftp://sgi.com/pub/fax/bakeoff>. The FlexFax
related files on sgi.com are replicated on ftp.bsc.no as well.

>From: michael@hal6000.thp.Uni-Duisburg.DE (Michael Staats)

We're using mgetty+sendfax for the basic modem I/O, I wrote a printer
backend for the modem so that users can send faxes as easy as they print
postscript. I also wrote a little X interface composer to generate a
fax form that makes sending faxes very easy. You can find these
programs at hal6000.thp.Uni-Duisburg.DE under /pub/source.

program				comment

mgetty+sendfax-0.14.tar.gz	basic modem I/O, needs hacking for AIX
X11/xform-1.1.tar.gz	     	small and simple X interface composer
				with an example fax form. Needs
				libxview.a incl. headers.
faxiobe.tar.gz			fax backend, needs configuring for
				your local site

If you need a binary version of libxview.a and the headers you'll find
them under /pub/binaries/AIX-3-2/lxview.tar.gz.

------------------------------

4.23: lsof - LiSt Open Files

From: abe@vic.cc.purdue.edu (Vic Abell)

Q. How can I determine the files that a process has opened?
Q. How can I locate the process that is using a specific network address?
Q. How can I locate the processes that have files open on a file system?

A. Use lsof (LiSt Open Files).
>From: "Juan G. Ruiz Pinto" <jgruiz@cyber1.servtech.com>

Lsof is available via anonymous ftp from vic.cc.purdue.edu
(128.210.15.16) in /pub/tools/unix/lsof/lsof.tar.Z (for the
most current version). The most current version is 4.14. There
are binary distributions in the "binary" directory.

Lsof supports AIX 4.1 since version 3.09.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>. The installation scripts in this package
automatically creates a group "kmem" during the install
and uses "acledit" to allow the kmem group to read /dev/mem and /dev/kmem.
This configuraqtion is reccomended by Vic Abell <abe@cc.purdue.edu>, the
author of lsof.

------------------------------

4.24: popper - POP3 mail daemon


The POP server is available via anonymous ftp from 
ftp.qualcomm.com:/quest/unix/servers/popper
  The makefile supports AIX
ftp.CC.Berkeley.EDU (128.32.136.9, 128.32.206.12).
  There are two versions in the pub directory: a compressed tar file
  popper-version.tar.Z and a Macintosh StuffIt archive in BinHex format
  called MacPOP.sit.hqx.

Problems building some versions of popper can sometimes be resolved by
compiling with bsdcc or -D_BSD.

The pine 3.95 package on <http://www-frec.bull.com/> contains "plug
and play" support for both POP3 and IMAP mail reading protocols.  You
can also get a compiled version of qpopper 2.2 there also.

------------------------------

4.26: mpeg link errors version 2.0

From: Nathan Lane <nathan@seldon.foundation.tricon.com>

.XShmCreateImage
.XShmDetach
.XShmAttach
.XShmGetEventBase
.XShmPutImage
.XShmQueryExtension

... are for the Shared Memory extension of the X server.
You can either choose to build it with shared memory or without.  I
always do it without the performance increase is not really
incredible, except on something like a 2x0 machine with the local bus
graphics adapter.  Just take out "DSH_MEM" in the CFLAGS in the
makefile for mpeg_play.  There is more information about shared memory
link errors in section 1.513.

Also, in the module "video.c" for mpeg_play it will complain about not
having enough memory to fully optimize one of the loops.  You can get
around that by specificying "qmaxmem=8000" in your cflags line, BUT,
the extra optimization does little good in my tests.

------------------------------

4.27: NNTP, INN


Link errors compiling nntp may occur because your machine lacks the
"patch" command.  Patch can be obtained from GNU repositories.  See 
question 4.29 for more information on patch.

------------------------------

4.28: Zmodem - File transfer


RZSZ is Chuck Forsberg's script for Z-modem. It is available by ftp at
<ftp://oak.oakland.edu/pub/unix-c/xyzmodem/rzsz9305.tar.Z> or
directly from Forsberg at Omen Technology BBS at 503-621-3746.

Hints:
0. Build with "make posix"
1. Use an 8-bit clean version of rlogin or telnet (Note: below)
2. Set the system to be transparent, I use "terminal download" 
3. Ensure hardware flow-control

Note, carlson@xylogics.com (James Carlson) suggests: Rlogin is
"slightly" unclean -- if an FF FF 73 73 appears in the datastream, it
can be ripped out by rlogind as a 'window size change' request.

[Ed note: The important part is using an 8-bit clean application,
since there are several implemenations of rlogin and telnet availible
you may need to try both and hunt down manuals to find the right flags
for your system]

------------------------------

4.29: Patch - automated file updates


AIX 3.2.5 does not ship with patch, a utility to apply the differences
between two files to make them identical.  This tool is often used to
update source code.

<ftp://ftp.x.org/pub/R6untarred/xc/util/patch/>
<ftp://prep.ai.mit.edu/pub/gnu/patch-2.1.tar.gz>

------------------------------

4.30: XNTP - network time protocol, synchronizes clocks

From: Joerg Schumacher <schuma@ips.cs.tu-bs.de>

   AIX 4:   xntpd in bos.net.tcp.client
   source:  ftp://ftp.udel.edu/pub/ntp/
   WWW:     http://www.eecis.udel.edu/~ntp/


------------------------------

4.31: GNU Screen and AIX 4.1.x


Once again,  binaries can be had from <http://www-frec.bull.com/>.

------------------------------

4.32: PINT -- SCSI scanner software

From: Kenneth Stailey <kstailey@leidecker.gsfc.nasa.gov>

<http://www.dol-esa.gov/~kstailey/pint>
<ftp://uniwa.uwa.edu.au:/pub/pint>
<ftp://ftp.gwdg.de:/pub/misc/scanner>
<ftp://alpha.gnu.ai.mit.edu:/pub/pint-0.5d.tar.gz>

------------------------------

4.33: Pager/Paging software


There is information on Paging, Paging programs and  listing of the
Archive sites to download at the web site:
<ftp://ftp.airnote.net:/pub/paging-info/ixo.faq>.

HylaFAX (see 4.22) supports sending messages to alphanumeric pagers.

Commercially there is: AlphaPage(r) MD2001 from Information Radio
Technology, Inc. in Cleveland, OH. 

------------------------------

4.34: JAVA Development Kit

From: Curt Finch <curt@tkg.com>

<http://ncc.hursley.ibm.com/javainfo/>

------------------------------

4.35: Sendmail


<ftp://ftp.sendmail.org/sendmail/>

If you want to use SRC to start and stop BSD sendmail,  do the following 
after installing it:

chssys -s sendmail -S -n 15 -f 9 -a -d99.100

This tells SRC that sendmail may be stopped with signals 15 and 9.  It also
arranges for sendmail not to daemonize itself,  since it will run under SRC.

------------------------------

4.00: GNU and Public Domain software


GNU software comes from the Free Software Foundation and various other
sources. A number of ftp sites archive them. Read the GNU license for 
rules on distributing their software.

Lots of useful public domain software have been and continue to be ported
to the RS/6000. See below for ftp or download information.

------------------------------

4.01: How do I find sources?

From: jik@GZA.COM (Jonathan Kamens)

There is a newsgroup devoted to posting about how to get a certain
source, comp.sources.wanted.  An archive of information about sources,
including FTP sites is available from

------------------------------

4.02: Are there any ftp or WWW sites?


SMIT-installable precompiled packages of popular freeware for AIX 4.x at
<http://www-frec.bull.com/>.  Download the ".exe" files with your WWW
browser. These are auto-uncompressing files, just like on PCs (it uses
similar technology to PKZIP). Mark the file as executable (chmod +x),
then execute it to generate a .bff file. The .bff file can then be
installed using "smit install_latest". For more information
read the INSTALL.txt file on the server.

There are mirrors of this site at http://www.bull.de/ and
http://ftp.univie.ac.at/aix/.

The package explicitly referenced below are ones Ciaran consideres
"solid."  That is, the binary has been "tested by lots of people."

Bull provides many other freeware packages as well.  If you use the
service,  be sure and thank Ciaran and Bull.

Below are some ftp sites that are supposed to have RS/6000 specific
software.  I haven't verified all the entries.

US sites:
<ftp://aixpdslib.seas.ucla.edu/pub/>		128.97.2.211
<ftp://aix.boulder.ibm.com/>
<ftp://software.watson.ibm.com/>

European sites:
<ftp://nic.funet.fi/pub/unix/AIX/RS6000/>		128.214.6.100
<ftp://iacrs1.unibe.ch/pub/>			130.92.11.3
<ftp://ftp.zrz.TU-Berlin.DE/pub/aix/>		130.149.4.50
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>	129.104.3.60
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>		129.69.8.13

The first one is dedicated to software running on AIX.  It might not
always be the latest versions of the software, but it has been ported
to AIX (normally AIX version 3 only).  Please use the European sites
very sparingly.  They are primarily to serve people in Europe and most
of the software can be found in the US sites originally.

The remaining sites are simply ones that archie indicated contained
AIX related materials.

<ftp://ibminet.awdpa.ibm.com/>	#IBM announcements, oem hardware
<ftp://cac.toronto.ibm.com/>	#marketing-info
<ftp://ftp.egr.duke.edu/>
<ftp://straylight.acs.ncsu.edu/>
<ftp://alpha.gnu.ai.mit.edu/rs6000>
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>
<ftp://iacrs2.unibe.ch/pub/aix/>
<ftp://ftp.u.washington.edu/pub/RS6000/>
<ftp://aixive.unb.ca/>
<ftp://ftp.ans.net/pub/misc/>
<ftp://uvaarpa.virginia.edu/pub/misc/>
<ftp://ux1.cts.eiu.edu/pub/rs6000/>
<ftp://ftp.bsc.nopub/Src/>
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>
<ftp://aix1.segi.ulg.ac.be/pub/aix/>
<ftp://byron.u.washington.edu/pub/aix/>
<ftp://cunixf.cc.columbia.edu/aix/>
<ftp://files1zrz.zrz.tu-berlin.de/pub/aix/>
<ftp://ftp.rz.uni-augsburg.de/pub/aix/>
<ftp://fyvie.cs.wisc.edu/pub/aix/>
<ftp://solaria.cc.gatech.edu/pub/aix/>
<ftp://spot.colorado.edu/aix/>
<ftp://swdsrv.edvz.univie.ac.at/unix/systems/aix/>
<ftp://switek.uni-muenster.de/pub/aix/>
<ftp://wuarchive.wustl.edu/systems/aix/>
<ftp://cs.nyu.edu/pub/AIX/>
<ftp://karazm.math.uh.edu/pub/AIX/>
<ftp://minnie.zdv.uni-mainz.de/pub0/pub/AIX/>
<ftp://oersted.ltf.dth.dk/pub/AIX/>
<ftp://rs3.hrz.th-darmstadt.de/pub/incoming/AIX/>
<ftp://aeneas.mit.edu/pub/rs6000/>
<ftp://cameron.egr.duke.edu/rs6000/>
<ftp://ifi.informatik.uni-stuttgart.de/pub/rs6000/>
<ftp://metropolis.super.org/pub/rs6000/>
<ftp://ramses.cs.cornell.edu/pub/rs6000/>
<ftp://server.uga.edu/pub/rs6000/>
<ftp://uvaarpa.virginia.edu/pub/rs6000/>
<ftp://wayback.cs.cornell.edu/pub/rs6000/>
<ftp://alice.fmi.uni-passau.de/pub/RS6000/>
<ftp://byron.u.washington.edu/pub/aix/RS6000/>
<ftp://milton.u.washington.edu/pub/RS6000/>
<ftp://pascal.math.yale.edu/pub/RS6000/>
<ftp://uxc.cso.uiuc.edu/pub/RS6000/>

------------------------------

4.03: Why does "install"ing software I got from the net fail?


This answer was moved to section 2.22

------------------------------

4.04: GNU Emacs


A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

If you get a segmentation fault in GNU EMACS 19.* during hilit19 use,
you can set locale to C (export LC_ALL=C) to get around the AIX bug.

Version 18.57 of GNU Emacs started to have RS/6000 support.  Use
s-aix3-2.h for AIX 3.2. Emacs is going through rapid changes recently.
Current release is 19.x.

Emacs will core-dump if it is stripped, so don't strip when you install
it.  You can edit a copy of the Makefile in src replacing all 'install -s' 
with /usr/ucb/install.

------------------------------

4.05: gcc/gdb


GNU C version 2.0 and later supports the RS/6000, and compiles straight
out of the box.  You may, however, experience that compiling it requires
large amounts of paging space.

Compiling gcc and gdb on AIX 3.2 requires a patch to the 'as' assembler.  Call
IBM software support and request patch for apar IX26107 (U409205).

gcc has undergone many changes lately and the current version is 2.7.x.
gdb is at 4.1x.

If your machine crashed when trying to run gdb 4.7, call software support
and request ptf U412815.

------------------------------

4.06: GNU Ghostscript


A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

The PostScript interpreter GNU Ghostscript Version 2.3 and later supports
the RS/6000 and can be found on various ftp sites. Current version is 2.6.1.

Compile time problems:
  Compile idict.c and zstack.c _without_ optimization, add the following
  to the Makefile:

  idict.o: idict.c
        $(CC) -c idict.c

  zstack.o: zstack.c
        $(CC) -c zstack.c

Run time problems:
  Running ghostview-1.5 with ghostscript-2.6.1, I get 
   gs: Malformed ghostview color property.
  Solution: replace buggy version of ghostscript-2.6.1 X11 driver
  with at least 2.6.1pl4 

------------------------------

4.07 TeX - Document processing

From: "Patrick TJ McPhee" <ptjm@ican.net>

TeX can be retrieved via ftp from the comprehensive TeX archive
network (CTAN). The principle sites are
ftp.tex.ac.uk (UK)
ftp.dante.de  (Deutschland)
ftp.tug.org  (USA)
but there are many mirrors. finger ctan@ftp.tex.ac.uk for a list.

------------------------------

4.08 Perl - Scripting language


A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

If you want the source code, <http://www.perl.com/perl/> is good place
to start.

------------------------------

4.09: X-Windows


AIX 4.x ships with X11R5 and Motif 1.2.

On AIX 3.2 the base version has X11R4 and Motif 1.1 and the extended
version has X11R5 as AIXwindows 1.2.3.  See question 1.500 for more
information about determining your revision.

AIXwindows version 1.2.0 (X11rte 1.2.0) is X11R4 with Motif 1.1
AIXwindows version 1.2.3 (X11rte 1.2.3) is X11R5 with Motif 1.1
'lslpp -h X11rte.motif1.2.obj' should tell you if you are
running Motif 1.2.

------------------------------

4.10 Bash - /bin/ksh alternative from FSF


Bash is an alternative to ksh and is availible from prep.ai.mit.edu
and places that mirror the GNU software.  /etc/security/login.cfg
needs to be modified if this will be used as a default shell.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

------------------------------

4.11: Elm


A very nice replacement for mail. Elm should be pretty straightforward,
the only thing to remember is to link with -lcurses as the only
curses/termlib library. You may also run into the problem listed under
point 2.13 above.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

------------------------------

4.12: Oberon 2.2

From: afx@muc.ibm.de (Andreas Siegert)

Oberon is Wirth's follow on to Modula-2, but is not compatible. A free
version of Modula-3 is available from DEC/Olivetti at
gatekeeper.dec.com. This is not a Modula-2 replacement but a new
language. There are currently two M2 compilers for the 6000 that I
know of. One from Edinburgh Portable Compilers, +44 31 225 6262 (UK)
and the other from Gardens Point is availible through A+L in
Switzerland (+41 65 520311) or Real Time Associates in the UK
(info@rtal.demon.co.uk).

Oberon can be obtained via anonymous ftp from neptune.inf.ethz.ch
(129.132.101.33) under the directory Oberon/RS6000 or gatekeeper.dec.com
(16.1.0.2).

------------------------------

4.13: Kermit - Communications

From: Frank da Cruz <fdc@watsun.cc.columbia.edu>

Available for all versions of AIX on RS/6000, PowerPC, PS/2, RT PC,
and 370-Series mainframes.  For complete information on Kermit software
for AIX and hundreds of other platforms, visit the Kermit Web site:

  <http://www.columbia.edu/kermit/>

C-Kermit 6.0 was announced November 30, 1996:

  <http://www.columbia.edu/kermit/ck60.html>

The nonprofit Kermit Project is funded primarily by manual sales.
For C-Kermit 6.0 the manual is the new second edition of "Using C-Kermit":

  <http://www.columbia.edu/kermit/ck60manual.html>

For RS/6000 and PowerPC with AIX 3.x or 4.x:

  <ftp://kermit.columbia.edu/kermit/archives/cku192.tar.Z> (or .gz)

Uncompress, untar (tar xvf cku192.tar) then:

  make rs6aix32c  <--  For AIX 3.x
  make rs6aix41c  <--  For AIX 4.x

This produces an exutable called "wermit".  Before installing, read the
instructions in ckuins.doc from the tar file.

If you don't have a C compiler, you can get binaries at:

  <http://www.columbia.edu/kermit/ck60ubin.html>

Send questions to kermit-support@columbia.edu.

------------------------------

4.14: Gnu dbm

From: doug@cc.ysu.edu (Doug Sewell)

Here's the fixes for RS/6000's:

apply this to testgdbm.c:
158c158
<   char opt;
---
>   int opt;
166c166
<   while ((opt = getopt (argc, argv, "rn")) != -1)
---
>   while ((opt = getopt (argc, argv, "rn")) != EOF)

Apply this to systems.h:
111a112,114
> #ifdef RS6000
> #pragma alloca
> #else
112a116
> #endif

To compile, edit the Makefile.  Set CC to bsdcc (see /usr/lpp/bos/bsdport
if you don't have 'bsdcc' on your system) and set CFLAGS to -DRS6000 and
whatever options (-g, -O) you prefer.  Don't define SYSV.

------------------------------

4.15 tcsh - an alternative shell

From: cordes@athos.cs.ua.edu (David Cordes)

tcsh is available from <ftp://ftp.deshaw.com/pub/tcsh>
Compiles with no problems. You must edit /etc/security/login.cfg to
permit users to change to this shell (chsh), adding the path where the
shell is installed (in my case, /usr/local/bin/tcsh).

>From: "A. Bryan Curnutt" <bryan@Stoner.COM>

Under AIX 3.2.5, you need to modify the "config.h" file, changing
    #define BSDSIGS
to
    #undef BSDSIGS

------------------------------

4.16: Kyoto Common Lisp


The sources are available from cli.com. The kcl package is the needed
base; also retrieve the latest akcl distribution. akcl provides a
front-end that "ports" the original kcl to a number of different
platforms. The port to the 6000 worked with no problems. However, you
must be root for make to work properly with some memory protection
routines.

------------------------------

4.17 Tcl/Tk - X-Windows scripting


Current versions: Tcl 8.0b2 and Tk 8.0b2.  They are available from
<ftp://ftp.sunlabs.com/pub/tcl/>. The Tcl/Tk web page is at
<http://sunscript.sun.com/>.

Prebuilt installp (smit) installable packages for several versions of Tcl and
Tk are available from <http://www-frec.bull.com/>.

------------------------------

4.18: Expect

From: Doug Sewell <DOUG@YSUB.YSU.EDU>
   
To build the command-interpreter version, you must have the tcl library
built successfully. The expect library doesn't require tcl.  Note:
Expect and its library are built with bsdcc, so applications using
the library probably also need to be developed with bsdcc.

I ftp'd expect from ftp.cme.nist.gov.

You need to change several lines in the makefile.  First you need
to customize source and target directories and files:
#
TCLHDIR = /usr/include
TCLLIB = -ltcl
MANDIR = /usr/man/manl               (local man-pages)
MANEXT = l
BINDIR = /u/local/bin
LIBDIR = /usr/lib
HDIR = /usr/include
...
Next set the compiler, switches, and configuration options:
#
CC = bsdcc
CFLAGS = -O
...
PTY_TYPE = bsd
...
INTERACT_TYPE = select
...
Then you need to make these changes about line 90 or so:
comment out CFLAGS = $(CLFLAGS)
un-comment these lines:
CFLAGS = $(CLFLAGS) $(CPPFLAGS)
LFLAGS = ($CLFLAGS)

Then run 'make'.

You can't run some of the examples without modification (host name,
etc).  I don't remember if I ran all of them or not, but I ran enough
that I was satisfied it worked.

------------------------------

4.19: Public domain software on CD

From: mbeckman@mbeckman.mbeckman.com (Mel Beckman)

The Prime Time Freeware CD collection is a package of two CD's and docs
containing over THREE GIGABYTES of compressed Unix software. It costs $69
>from Prime Time Freeware, 415-112 N. Mary Ave., Suite 50, Sunnyvale, CA
94086. Phone 408-738-4832 voice, 408-738-2050 fax. No internet orders as
far as I can tell.

I've extracted and compiled a number of the packages, and all have worked
flawlessly so far on my 220. Everything from programming languages to 3D
solid modeling is in this bonanza!

[Ed: The O'Reilly book, Unix Power Tools, also contains a CD-ROM with lots
of useful programs compiled for the RS/6000, among other platforms.]

------------------------------

4.20: Andrew Toolkit

From: Gary Keim <gk5g+@andrew.cmu.edu>

The Andrew Toolkit Consortium of Carnegie Mellon University's School of
Computer Science has released new versions of the Andrew User
Environment, Andrew Toolkit, and Andrew Message System.

The Andrew User Environment (AUE) is an integrated set of applications
beginning with a 'generic object' editor, ez, a help system, a system
monitoring tool (console), an editor-based shell interface (typescript),
and support for printing multi-media documents. 

The Andrew Toolkit (ATK) is a portable user-interface toolkit that runs
under X11. It provides a dynamically-loadable object-oriented
environment wherein objects can be embedded in one another. Thus, one
could edit text that, in addition to containing multiple fonts, contains
embedded raster images, spreadsheets, drawing editors, equations, simple
animations, etc. These embedded objects can also be nested.

The Andrew Message System (AMS) provides a multi-media interface to mail
and bulletin-boards. AMS supports several mail management strategies
and implements many advanced features including authentication, return
receipts, automatic sorting of mail, vote collection and tabulation,
enclosures, audit trails of related messages, and subscription
management. It has interfaces that support ttys, personal computers, 
and workstations.

Release 5.1 of Andrew contains many bug fixes and updates. There is now
support for the new Internet MIME (Multipurpose Internet Mail Extensions)
standards for multipart, and multimedia mail. For more information on
MIME, please see the CHANGES files in the ftp directory on
emsworth.andrew.cmu.edu.

This release can be obtained as follows. The sources are available via
anonymous ftp from export.lcs.mit.edu (18.30.0.238) in the
./contrib/andrew tree. For details, see ./contrib/andrew/README.

PATCH for AIX3.2: A patch to the AUIS 5.1 sources can be ftp'ed from
emsworth.andrew.cmu.edu (128.2.45.40) in ./aixpatch. For those without
internet access, a 3.5" diskette can be ordered for a nominal fee of $10
by sending, or faxing, a purchase order to the Consortium address below.

Andrew, as well as a variety of other CMU software, can also be ftp'ed
>from emsworth.andrew.cmu.edu (128.2.30.62). Those with AFS access look
at /afs/andrew.cmu.edu/itc/sm/releases/X.V11R5/ftp.

Remote Andrew Demo Service 

This network service allows you to run Andrew Toolkit applications
without obtaining or compiling the Andrew software. You need a host
machine running X11 on the Internet. A simple "finger" command will let
you experience ATK applications firsthand. You'll be able to compose
multimedia documents, navigate through the interactive Andrew Tour, and
use the Andrew Message System to browse through CMU's three thousand
bulletin boards and newsgroups.

To use the Remote Andrew Demo service, run the following command:

    finger help@atk.itc.cmu.edu 

The service will give you further instructions.

Information Sources

Your bug reports are welcome; kindly send them to
info-andrew-bugs@andrew.cmu.edu and we will periodically post a status
report to the mailing list info-andrew@andrew.cmu.edu. To be added to
the mailing list or make other requests, send mail to
info-andrew-request@andrew.cmu.edu.

We also distribute the following related materials:

ATK and AMS sources and binaries on CDROM. Binaries are available
for the following system types: 

        	IBM RiscSystem/6000 
		Sun SparcStation 
		HP 700 Series 
		DECstation 

ATK and AMS sources on QIC and Iotamat tapes Hardcopies of the
documentation for ATK and AMS. Introductory video tape: Welcome to
Andrew: An Overview of the Andrew System. Technical video tape: The
Andrew Project: A Session at the Winter 1988 Usenix Conference.

More information about these materials is available from:

    Information Requests
    Andrew Toolkit Consortium
    Carnegie Mellon University
    4910 Forbes Avenue, UCC 214
    Pittsburgh, PA 15213-3890
    USA
    phone: +1-412-268-6710
    fax: +1-412-621-8081
    info-andrew-request@andrew.cmu.edu

There is also a netnews distribution list, comp.soft-sys.andrew, which
is identical to the info-andrew list except that it does not support the
multi-media capabilities of info-andrew.

------------------------------

4.21: sudo


Sudo (superuser do) allows a system administrator to give certain users (or
groups of users) the ability to run some (or all) commands as root while
logging all commands and arguments. Sudo operates on a per-command basis, it
is not a replacement for the shell. 

The latest version of sudo is cu-sudo v1.5.  There is a web page for sudo at
<http://www.courtesan.com/courtesan/products/sudo/sudo.html>.  The program
itself can be obtained from <ftp://ftp.courtesan.com/pub/sudo/>.  Sudo's
author, Todd Miller < Todd.Miller@courtesan.com> reports that sudo works on
both AIX 3.2.X and 4.1.X. 


------------------------------

4.22: Flexfax/HylaFax and other fax software

From: Christian Zahl <czahl@cs.tu-berlin.de>

Sam Leffler has released a new version of FlexFax called HylaFax.  It
is availible from <ftp://sgi.com/sgi/fax/>.  There is a HlyaFax web
page at <http://www.vix.com/hylafax/>.  Version V3.0pl1
supported many types of Class 1/2 fax modems and several UNIX systems
including AIX 3.2.3 or greater.  There is also a fax modem review
document at the same site as <ftp://sgi.com/pub/fax/bakeoff>. The FlexFax
related files on sgi.com are replicated on ftp.bsc.no as well.

>From: michael@hal6000.thp.Uni-Duisburg.DE (Michael Staats)

We're using mgetty+sendfax for the basic modem I/O, I wrote a printer
backend for the modem so that users can send faxes as easy as they print
postscript. I also wrote a little X interface composer to generate a
fax form that makes sending faxes very easy. You can find these
programs at hal6000.thp.Uni-Duisburg.DE under /pub/source.

program				comment

mgetty+sendfax-0.14.tar.gz	basic modem I/O, needs hacking for AIX
X11/xform-1.1.tar.gz	     	small and simple X interface composer
				with an example fax form. Needs
				libxview.a incl. headers.
faxiobe.tar.gz			fax backend, needs configuring for
				your local site

If you need a binary version of libxview.a and the headers you'll find
them under /pub/binaries/AIX-3-2/lxview.tar.gz.

------------------------------

4.23: lsof - LiSt Open Files

From: abe@vic.cc.purdue.edu (Vic Abell)

Q. How can I determine the files that a process has opened?
Q. How can I locate the process that is using a specific network address?
Q. How can I locate the processes that have files open on a file system?

A. Use lsof (LiSt Open Files).
>From: "Juan G. Ruiz Pinto" <jgruiz@cyber1.servtech.com>

Lsof is available via anonymous ftp from vic.cc.purdue.edu
(128.210.15.16) in /pub/tools/unix/lsof/lsof.tar.Z (for the
most current version). The most current version is 4.14. There
are binary distributions in the "binary" directory.

Lsof supports AIX 4.1 since version 3.09.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>. The installation scripts in this package
automatically creates a group "kmem" during the install
and uses "acledit" to allow the kmem group to read /dev/mem and /dev/kmem.
This configuraqtion is reccomended by Vic Abell <abe@cc.purdue.edu>, the
author of lsof.

------------------------------

4.24: popper - POP3 mail daemon


The POP server is available via anonymous ftp from 
ftp.qualcomm.com:/quest/unix/servers/popper
  The makefile supports AIX
ftp.CC.Berkeley.EDU (128.32.136.9, 128.32.206.12).
  There are two versions in the pub directory: a compressed tar file
  popper-version.tar.Z and a Macintosh StuffIt archive in BinHex format
  called MacPOP.sit.hqx.

Problems building some versions of popper can sometimes be resolved by
compiling with bsdcc or -D_BSD.

The pine 3.95 package on <http://www-frec.bull.com/> contains "plug
and play" support for both POP3 and IMAP mail reading protocols.  You
can also get a compiled version of qpopper 2.2 there also.

------------------------------

4.26: mpeg link errors version 2.0

From: Nathan Lane <nathan@seldon.foundation.tricon.com>

.XShmCreateImage
.XShmDetach
.XShmAttach
.XShmGetEventBase
.XShmPutImage
.XShmQueryExtension

... are for the Shared Memory extension of the X server.
You can either choose to build it with shared memory or without.  I
always do it without the performance increase is not really
incredible, except on something like a 2x0 machine with the local bus
graphics adapter.  Just take out "DSH_MEM" in the CFLAGS in the
makefile for mpeg_play.  There is more information about shared memory
link errors in section 1.513.

Also, in the module "video.c" for mpeg_play it will complain about not
having enough memory to fully optimize one of the loops.  You can get
around that by specificying "qmaxmem=8000" in your cflags line, BUT,
the extra optimization does little good in my tests.

------------------------------

4.27: NNTP, INN


Link errors compiling nntp may occur because your machine lacks the
"patch" command.  Patch can be obtained from GNU repositories.  See 
question 4.29 for more information on patch.

------------------------------

4.28: Zmodem - File transfer


RZSZ is Chuck Forsberg's script for Z-modem. It is available by ftp at
<ftp://oak.oakland.edu/pub/unix-c/xyzmodem/rzsz9305.tar.Z> or
directly from Forsberg at Omen Technology BBS at 503-621-3746.

Hints:
0. Build with "make posix"
1. Use an 8-bit clean version of rlogin or telnet (Note: below)
2. Set the system to be transparent, I use "terminal download" 
3. Ensure hardware flow-control

Note, carlson@xylogics.com (James Carlson) suggests: Rlogin is
"slightly" unclean -- if an FF FF 73 73 appears in the datastream, it
can be ripped out by rlogind as a 'window size change' request.

[Ed note: The important part is using an 8-bit clean application,
since there are several implemenations of rlogin and telnet availible
you may need to try both and hunt down manuals to find the right flags
for your system]

------------------------------

4.29: Patch - automated file updates


AIX 3.2.5 does not ship with patch, a utility to apply the differences
between two files to make them identical.  This tool is often used to
update source code.

<ftp://ftp.x.org/pub/R6untarred/xc/util/patch/>
<ftp://prep.ai.mit.edu/pub/gnu/patch-2.1.tar.gz>

------------------------------

4.30: XNTP - network time protocol, synchronizes clocks

From: Joerg Schumacher <schuma@ips.cs.tu-bs.de>

   AIX 4:   xntpd in bos.net.tcp.client
   source:  ftp://ftp.udel.edu/pub/ntp/
   WWW:     http://www.eecis.udel.edu/~ntp/


------------------------------

4.31: GNU Screen and AIX 4.1.x


Once again,  binaries can be had from <http://www-frec.bull.com/>.

------------------------------

4.32: PINT -- SCSI scanner software

From: Kenneth Stailey <kstailey@leidecker.gsfc.nasa.gov>

<http://www.dol-esa.gov/~kstailey/pint>
<ftp://uniwa.uwa.edu.au:/pub/pint>
<ftp://ftp.gwdg.de:/pub/misc/scanner>
<ftp://alpha.gnu.ai.mit.edu:/pub/pint-0.5d.tar.gz>

------------------------------

4.33: Pager/Paging software


There is information on Paging, Paging programs and  listing of the
Archive sites to download at the web site:
<ftp://ftp.airnote.net:/pub/paging-info/ixo.faq>.

HylaFAX (see 4.22) supports sending messages to alphanumeric pagers.

Commercially there is: AlphaPage(r) MD2001 from Information Radio
Technology, Inc. in Cleveland, OH. 

------------------------------

4.34: JAVA Development Kit

From: Curt Finch <curt@tkg.com>

<http://ncc.hursley.ibm.com/javainfo/>

------------------------------

4.35: Sendmail


<ftp://ftp.sendmail.org/sendmail/>

If you want to use SRC to start and stop BSD sendmail,  do the following 
after installing it:

chssys -s sendmail -S -n 15 -f 9 -a -d99.100

This tells SRC that sendmail may be stopped with signals 15 and 9.  It also
arranges for sendmail not to daemonize itself,  since it will run under SRC.

------------------------------

4.00: GNU and Public Domain software


GNU software comes from the Free Software Foundation and various other
sources. A number of ftp sites archive them. Read the GNU license for 
rules on distributing their software.

Lots of useful public domain software have been and continue to be ported
to the RS/6000. See below for ftp or download information.

------------------------------

4.01: How do I find sources?

From: jik@GZA.COM (Jonathan Kamens)

There is a newsgroup devoted to posting about how to get a certain
source, comp.sources.wanted.  An archive of information about sources,
including FTP sites is available from

------------------------------

4.02: Are there any ftp or WWW sites?


SMIT-installable precompiled packages of popular freeware for AIX 4.x at
<http://www-frec.bull.com/>.  Download the ".exe" files with your WWW
browser. These are auto-uncompressing files, just like on PCs (it uses
similar technology to PKZIP). Mark the file as executable (chmod +x),
then execute it to generate a .bff file. The .bff file can then be
installed using "smit install_latest". For more information
read the INSTALL.txt file on the server.

There are mirrors of this site at http://www.bull.de/ and
http://ftp.univie.ac.at/aix/.

The package explicitly referenced below are ones Ciaran consideres
"solid."  That is, the binary has been "tested by lots of people."

Bull provides many other freeware packages as well.  If you use the
service,  be sure and thank Ciaran and Bull.

Below are some ftp sites that are supposed to have RS/6000 specific
software.  I haven't verified all the entries.

US sites:
<ftp://aixpdslib.seas.ucla.edu/pub/>		128.97.2.211
<ftp://aix.boulder.ibm.com/>
<ftp://software.watson.ibm.com/>

European sites:
<ftp://nic.funet.fi/pub/unix/AIX/RS6000/>		128.214.6.100
<ftp://iacrs1.unibe.ch/pub/>			130.92.11.3
<ftp://ftp.zrz.TU-Berlin.DE/pub/aix/>		130.149.4.50
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>	129.104.3.60
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>		129.69.8.13

The first one is dedicated to software running on AIX.  It might not
always be the latest versions of the software, but it has been ported
to AIX (normally AIX version 3 only).  Please use the European sites
very sparingly.  They are primarily to serve people in Europe and most
of the software can be found in the US sites originally.

The remaining sites are simply ones that archie indicated contained
AIX related materials.

<ftp://ibminet.awdpa.ibm.com/>	#IBM announcements, oem hardware
<ftp://cac.toronto.ibm.com/>	#marketing-info
<ftp://ftp.egr.duke.edu/>
<ftp://straylight.acs.ncsu.edu/>
<ftp://alpha.gnu.ai.mit.edu/rs6000>
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>
<ftp://iacrs2.unibe.ch/pub/aix/>
<ftp://ftp.u.washington.edu/pub/RS6000/>
<ftp://aixive.unb.ca/>
<ftp://ftp.ans.net/pub/misc/>
<ftp://uvaarpa.virginia.edu/pub/misc/>
<ftp://ux1.cts.eiu.edu/pub/rs6000/>
<ftp://ftp.bsc.nopub/Src/>
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>
<ftp://aix1.segi.ulg.ac.be/pub/aix/>
<ftp://byron.u.washington.edu/pub/aix/>
<ftp://cunixf.cc.columbia.edu/aix/>
<ftp://files1zrz.zrz.tu-berlin.de/pub/aix/>
<ftp://ftp.rz.uni-augsburg.de/pub/aix/>
<ftp://fyvie.cs.wisc.edu/pub/aix/>
<ftp://solaria.cc.gatech.edu/pub/aix/>
<ftp://spot.colorado.edu/aix/>
<ftp://swdsrv.edvz.univie.ac.at/unix/systems/aix/>
<ftp://switek.uni-muenster.de/pub/aix/>
<ftp://wuarchive.wustl.edu/systems/aix/>
<ftp://cs.nyu.edu/pub/AIX/>
<ftp://karazm.math.uh.edu/pub/AIX/>
<ftp://minnie.zdv.uni-mainz.de/pub0/pub/AIX/>
<ftp://oersted.ltf.dth.dk/pub/AIX/>
<ftp://rs3.hrz.th-darmstadt.de/pub/incoming/AIX/>
<ftp://aeneas.mit.edu/pub/rs6000/>
<ftp://cameron.egr.duke.edu/rs6000/>
<ftp://ifi.informatik.uni-stuttgart.de/pub/rs6000/>
<ftp://metropolis.super.org/pub/rs6000/>
<ftp://ramses.cs.cornell.edu/pub/rs6000/>
<ftp://server.uga.edu/pub/rs6000/>
<ftp://uvaarpa.virginia.edu/pub/rs6000/>
<ftp://wayback.cs.cornell.edu/pub/rs6000/>
<ftp://alice.fmi.uni-passau.de/pub/RS6000/>
<ftp://byron.u.washington.edu/pub/aix/RS6000/>
<ftp://milton.u.washington.edu/pub/RS6000/>
<ftp://pascal.math.yale.edu/pub/RS6000/>
<ftp://uxc.cso.uiuc.edu/pub/RS6000/>

------------------------------

4.03: Why does "install"ing software I got from the net fail?


This answer was moved to section 2.22

------------------------------

4.04: GNU Emacs


A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

If you get a segmentation fault in GNU EMACS 19.* during hilit19 use,
you can set locale to C (export LC_ALL=C) to get around the AIX bug.

Version 18.57 of GNU Emacs started to have RS/6000 support.  Use
s-aix3-2.h for AIX 3.2. Emacs is going through rapid changes recently.
Current release is 19.x.

Emacs will core-dump if it is stripped, so don't strip when you install
it.  You can edit a copy of the Makefile in src replacing all 'install -s' 
with /usr/ucb/install.

------------------------------

4.05: gcc/gdb


GNU C version 2.0 and later supports the RS/6000, and compiles straight
out of the box.  You may, however, experience that compiling it requires
large amounts of paging space.

Compiling gcc and gdb on AIX 3.2 requires a patch to the 'as' assembler.  Call
IBM software support and request patch for apar IX26107 (U409205).

gcc has undergone many changes lately and the current version is 2.7.x.
gdb is at 4.1x.

If your machine crashed when trying to run gdb 4.7, call software support
and request ptf U412815.

------------------------------

4.06: GNU Ghostscript


A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

The PostScript interpreter GNU Ghostscript Version 2.3 and later supports
the RS/6000 and can be found on various ftp sites. Current version is 2.6.1.

Compile time problems:
  Compile idict.c and zstack.c _without_ optimization, add the following
  to the Makefile:

  idict.o: idict.c
        $(CC) -c idict.c

  zstack.o: zstack.c
        $(CC) -c zstack.c

Run time problems:
  Running ghostview-1.5 with ghostscript-2.6.1, I get 
   gs: Malformed ghostview color property.
  Solution: replace buggy version of ghostscript-2.6.1 X11 driver
  with at least 2.6.1pl4 

------------------------------

4.07 TeX - Document processing

From: "Patrick TJ McPhee" <ptjm@ican.net>

TeX can be retrieved via ftp from the comprehensive TeX archive
network (CTAN). The principle sites are
ftp.tex.ac.uk (UK)
ftp.dante.de  (Deutschland)
ftp.tug.org  (USA)
but there are many mirrors. finger ctan@ftp.tex.ac.uk for a list.

------------------------------

4.08 Perl - Scripting language


A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

If you want the source code, <http://www.perl.com/perl/> is good place
to start.

------------------------------

4.09: X-Windows


AIX 4.x ships with X11R5 and Motif 1.2.

On AIX 3.2 the base version has X11R4 and Motif 1.1 and the extended
version has X11R5 as AIXwindows 1.2.3.  See question 1.500 for more
information about determining your revision.

AIXwindows version 1.2.0 (X11rte 1.2.0) is X11R4 with Motif 1.1
AIXwindows version 1.2.3 (X11rte 1.2.3) is X11R5 with Motif 1.1
'lslpp -h X11rte.motif1.2.obj' should tell you if you are
running Motif 1.2.

------------------------------

4.10 Bash - /bin/ksh alternative from FSF


Bash is an alternative to ksh and is availible from prep.ai.mit.edu
and places that mirror the GNU software.  /etc/security/login.cfg
needs to be modified if this will be used as a default shell.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

------------------------------

4.11: Elm


A very nice replacement for mail. Elm should be pretty straightforward,
the only thing to remember is to link with -lcurses as the only
curses/termlib library. You may also run into the problem listed under
point 2.13 above.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

------------------------------

4.12: Oberon 2.2

From: afx@muc.ibm.de (Andreas Siegert)

Oberon is Wirth's follow on to Modula-2, but is not compatible. A free
version of Modula-3 is available from DEC/Olivetti at
gatekeeper.dec.com. This is not a Modula-2 replacement but a new
language. There are currently two M2 compilers for the 6000 that I
know of. One from Edinburgh Portable Compilers, +44 31 225 6262 (UK)
and the other from Gardens Point is availible through A+L in
Switzerland (+41 65 520311) or Real Time Associates in the UK
(info@rtal.demon.co.uk).

Oberon can be obtained via anonymous ftp from neptune.inf.ethz.ch
(129.132.101.33) under the directory Oberon/RS6000 or gatekeeper.dec.com
(16.1.0.2).

------------------------------

4.13: Kermit - Communications

From: Frank da Cruz <fdc@watsun.cc.columbia.edu>

Available for all versions of AIX on RS/6000, PowerPC, PS/2, RT PC,
and 370-Series mainframes.  For complete information on Kermit software
for AIX and hundreds of other platforms, visit the Kermit Web site:

  <http://www.columbia.edu/kermit/>

C-Kermit 6.0 was announced November 30, 1996:

  <http://www.columbia.edu/kermit/ck60.html>

The nonprofit Kermit Project is funded primarily by manual sales.
For C-Kermit 6.0 the manual is the new second edition of "Using C-Kermit":

  <http://www.columbia.edu/kermit/ck60manual.html>

For RS/6000 and PowerPC with AIX 3.x or 4.x:

  <ftp://kermit.columbia.edu/kermit/archives/cku192.tar.Z> (or .gz)

Uncompress, untar (tar xvf cku192.tar) then:

  make rs6aix32c  <--  For AIX 3.x
  make rs6aix41c  <--  For AIX 4.x

This produces an exutable called "wermit".  Before installing, read the
instructions in ckuins.doc from the tar file.

If you don't have a C compiler, you can get binaries at:

  <http://www.columbia.edu/kermit/ck60ubin.html>

Send questions to kermit-support@columbia.edu.

------------------------------

4.14: Gnu dbm

From: doug@cc.ysu.edu (Doug Sewell)

Here's the fixes for RS/6000's:

apply this to testgdbm.c:
158c158
<   char opt;
---
>   int opt;
166c166
<   while ((opt = getopt (argc, argv, "rn")) != -1)
---
>   while ((opt = getopt (argc, argv, "rn")) != EOF)

Apply this to systems.h:
111a112,114
> #ifdef RS6000
> #pragma alloca
> #else
112a116
> #endif

To compile, edit the Makefile.  Set CC to bsdcc (see /usr/lpp/bos/bsdport
if you don't have 'bsdcc' on your system) and set CFLAGS to -DRS6000 and
whatever options (-g, -O) you prefer.  Don't define SYSV.

------------------------------

4.15 tcsh - an alternative shell

From: cordes@athos.cs.ua.edu (David Cordes)

tcsh is available from <ftp://ftp.deshaw.com/pub/tcsh>
Compiles with no problems. You must edit /etc/security/login.cfg to
permit users to change to this shell (chsh), adding the path where the
shell is installed (in my case, /usr/local/bin/tcsh).

>From: "A. Bryan Curnutt" <bryan@Stoner.COM>

Under AIX 3.2.5, you need to modify the "config.h" file, changing
    #define BSDSIGS
to
    #undef BSDSIGS

------------------------------

4.16: Kyoto Common Lisp


The sources are available from cli.com. The kcl package is the needed
base; also retrieve the latest akcl distribution. akcl provides a
front-end that "ports" the original kcl to a number of different
platforms. The port to the 6000 worked with no problems. However, you
must be root for make to work properly with some memory protection
routines.

------------------------------

4.17 Tcl/Tk - X-Windows scripting


Current versions: Tcl 8.0b2 and Tk 8.0b2.  They are available from
<ftp://ftp.sunlabs.com/pub/tcl/>. The Tcl/Tk web page is at
<http://sunscript.sun.com/>.

Prebuilt installp (smit) installable packages for several versions of Tcl and
Tk are available from <http://www-frec.bull.com/>.

------------------------------

4.18: Expect

From: Doug Sewell <DOUG@YSUB.YSU.EDU>
   
To build the command-interpreter version, you must have the tcl library
built successfully. The expect library doesn't require tcl.  Note:
Expect and its library are built with bsdcc, so applications using
the library probably also need to be developed with bsdcc.

I ftp'd expect from ftp.cme.nist.gov.

You need to change several lines in the makefile.  First you need
to customize source and target directories and files:
#
TCLHDIR = /usr/include
TCLLIB = -ltcl
MANDIR = /usr/man/manl               (local man-pages)
MANEXT = l
BINDIR = /u/local/bin
LIBDIR = /usr/lib
HDIR = /usr/include
...
Next set the compiler, switches, and configuration options:
#
CC = bsdcc
CFLAGS = -O
...
PTY_TYPE = bsd
...
INTERACT_TYPE = select
...
Then you need to make these changes about line 90 or so:
comment out CFLAGS = $(CLFLAGS)
un-comment these lines:
CFLAGS = $(CLFLAGS) $(CPPFLAGS)
LFLAGS = ($CLFLAGS)

Then run 'make'.

You can't run some of the examples without modification (host name,
etc).  I don't remember if I ran all of them or not, but I ran enough
that I was satisfied it worked.

------------------------------

4.19: Public domain software on CD

From: mbeckman@mbeckman.mbeckman.com (Mel Beckman)

The Prime Time Freeware CD collection is a package of two CD's and docs
containing over THREE GIGABYTES of compressed Unix software. It costs $69
>from Prime Time Freeware, 415-112 N. Mary Ave., Suite 50, Sunnyvale, CA
94086. Phone 408-738-4832 voice, 408-738-2050 fax. No internet orders as
far as I can tell.

I've extracted and compiled a number of the packages, and all have worked
flawlessly so far on my 220. Everything from programming languages to 3D
solid modeling is in this bonanza!

[Ed: The O'Reilly book, Unix Power Tools, also contains a CD-ROM with lots
of useful programs compiled for the RS/6000, among other platforms.]

------------------------------

4.20: Andrew Toolkit

From: Gary Keim <gk5g+@andrew.cmu.edu>

The Andrew Toolkit Consortium of Carnegie Mellon University's School of
Computer Science has released new versions of the Andrew User
Environment, Andrew Toolkit, and Andrew Message System.

The Andrew User Environment (AUE) is an integrated set of applications
beginning with a 'generic object' editor, ez, a help system, a system
monitoring tool (console), an editor-based shell interface (typescript),
and support for printing multi-media documents. 

The Andrew Toolkit (ATK) is a portable user-interface toolkit that runs
under X11. It provides a dynamically-loadable object-oriented
environment wherein objects can be embedded in one another. Thus, one
could edit text that, in addition to containing multiple fonts, contains
embedded raster images, spreadsheets, drawing editors, equations, simple
animations, etc. These embedded objects can also be nested.

The Andrew Message System (AMS) provides a multi-media interface to mail
and bulletin-boards. AMS supports several mail management strategies
and implements many advanced features including authentication, return
receipts, automatic sorting of mail, vote collection and tabulation,
enclosures, audit trails of related messages, and subscription
management. It has interfaces that support ttys, personal computers, 
and workstations.

Release 5.1 of Andrew contains many bug fixes and updates. There is now
support for the new Internet MIME (Multipurpose Internet Mail Extensions)
standards for multipart, and multimedia mail. For more information on
MIME, please see the CHANGES files in the ftp directory on
emsworth.andrew.cmu.edu.

This release can be obtained as follows. The sources are available via
anonymous ftp from export.lcs.mit.edu (18.30.0.238) in the
./contrib/andrew tree. For details, see ./contrib/andrew/README.

PATCH for AIX3.2: A patch to the AUIS 5.1 sources can be ftp'ed from
emsworth.andrew.cmu.edu (128.2.45.40) in ./aixpatch. For those without
internet access, a 3.5" diskette can be ordered for a nominal fee of $10
by sending, or faxing, a purchase order to the Consortium address below.

Andrew, as well as a variety of other CMU software, can also be ftp'ed
>from emsworth.andrew.cmu.edu (128.2.30.62). Those with AFS access look
at /afs/andrew.cmu.edu/itc/sm/releases/X.V11R5/ftp.

Remote Andrew Demo Service 

This network service allows you to run Andrew Toolkit applications
without obtaining or compiling the Andrew software. You need a host
machine running X11 on the Internet. A simple "finger" command will let
you experience ATK applications firsthand. You'll be able to compose
multimedia documents, navigate through the interactive Andrew Tour, and
use the Andrew Message System to browse through CMU's three thousand
bulletin boards and newsgroups.

To use the Remote Andrew Demo service, run the following command:

    finger help@atk.itc.cmu.edu 

The service will give you further instructions.

Information Sources

Your bug reports are welcome; kindly send them to
info-andrew-bugs@andrew.cmu.edu and we will periodically post a status
report to the mailing list info-andrew@andrew.cmu.edu. To be added to
the mailing list or make other requests, send mail to
info-andrew-request@andrew.cmu.edu.

We also distribute the following related materials:

ATK and AMS sources and binaries on CDROM. Binaries are available
for the following system types: 

        	IBM RiscSystem/6000 
		Sun SparcStation 
		HP 700 Series 
		DECstation 

ATK and AMS sources on QIC and Iotamat tapes Hardcopies of the
documentation for ATK and AMS. Introductory video tape: Welcome to
Andrew: An Overview of the Andrew System. Technical video tape: The
Andrew Project: A Session at the Winter 1988 Usenix Conference.

More information about these materials is available from:

    Information Requests
    Andrew Toolkit Consortium
    Carnegie Mellon University
    4910 Forbes Avenue, UCC 214
    Pittsburgh, PA 15213-3890
    USA
    phone: +1-412-268-6710
    fax: +1-412-621-8081
    info-andrew-request@andrew.cmu.edu

There is also a netnews distribution list, comp.soft-sys.andrew, which
is identical to the info-andrew list except that it does not support the
multi-media capabilities of info-andrew.

------------------------------

4.21: sudo


Sudo (superuser do) allows a system administrator to give certain users (or
groups of users) the ability to run some (or all) commands as root while
logging all commands and arguments. Sudo operates on a per-command basis, it
is not a replacement for the shell. 

The latest version of sudo is cu-sudo v1.5.  There is a web page for sudo at
<http://www.courtesan.com/courtesan/products/sudo/sudo.html>.  The program
itself can be obtained from <ftp://ftp.courtesan.com/pub/sudo/>.  Sudo's
author, Todd Miller < Todd.Miller@courtesan.com> reports that sudo works on
both AIX 3.2.X and 4.1.X. 


------------------------------

4.22: Flexfax/HylaFax and other fax software

From: Christian Zahl <czahl@cs.tu-berlin.de>

Sam Leffler has released a new version of FlexFax called HylaFax.  It
is availible from <ftp://sgi.com/sgi/fax/>.  There is a HlyaFax web
page at <http://www.vix.com/hylafax/>.  Version V3.0pl1
supported many types of Class 1/2 fax modems and several UNIX systems
including AIX 3.2.3 or greater.  There is also a fax modem review
document at the same site as <ftp://sgi.com/pub/fax/bakeoff>. The FlexFax
related files on sgi.com are replicated on ftp.bsc.no as well.

>From: michael@hal6000.thp.Uni-Duisburg.DE (Michael Staats)

We're using mgetty+sendfax for the basic modem I/O, I wrote a printer
backend for the modem so that users can send faxes as easy as they print
postscript. I also wrote a little X interface composer to generate a
fax form that makes sending faxes very easy. You can find these
programs at hal6000.thp.Uni-Duisburg.DE under /pub/source.

program				comment

mgetty+sendfax-0.14.tar.gz	basic modem I/O, needs hacking for AIX
X11/xform-1.1.tar.gz	     	small and simple X interface composer
				with an example fax form. Needs
				libxview.a incl. headers.
faxiobe.tar.gz			fax backend, needs configuring for
				your local site

If you need a binary version of libxview.a and the headers you'll find
them under /pub/binaries/AIX-3-2/lxview.tar.gz.

------------------------------

4.23: lsof - LiSt Open Files

From: abe@vic.cc.purdue.edu (Vic Abell)

Q. How can I determine the files that a process has opened?
Q. How can I locate the process that is using a specific network address?
Q. How can I locate the processes that have files open on a file system?

A. Use lsof (LiSt Open Files).
>From: "Juan G. Ruiz Pinto" <jgruiz@cyber1.servtech.com>

Lsof is available via anonymous ftp from vic.cc.purdue.edu
(128.210.15.16) in /pub/tools/unix/lsof/lsof.tar.Z (for the
most current version). The most current version is 4.14. There
are binary distributions in the "binary" directory.

Lsof supports AIX 4.1 since version 3.09.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>. The installation scripts in this package
automatically creates a group "kmem" during the install
and uses "acledit" to allow the kmem group to read /dev/mem and /dev/kmem.
This configuraqtion is reccomended by Vic Abell <abe@cc.purdue.edu>, the
author of lsof.

------------------------------

4.24: popper - POP3 mail daemon


The POP server is available via anonymous ftp from 
ftp.qualcomm.com:/quest/unix/servers/popper
  The makefile supports AIX
ftp.CC.Berkeley.EDU (128.32.136.9, 128.32.206.12).
  There are two versions in the pub directory: a compressed tar file
  popper-version.tar.Z and a Macintosh StuffIt archive in BinHex format
  called MacPOP.sit.hqx.

Problems building some versions of popper can sometimes be resolved by
compiling with bsdcc or -D_BSD.

The pine 3.95 package on <http://www-frec.bull.com/> contains "plug
and play" support for both POP3 and IMAP mail reading protocols.  You
can also get a compiled version of qpopper 2.2 there also.

------------------------------

4.26: mpeg link errors version 2.0

From: Nathan Lane <nathan@seldon.foundation.tricon.com>

.XShmCreateImage
.XShmDetach
.XShmAttach
.XShmGetEventBase
.XShmPutImage
.XShmQueryExtension

... are for the Shared Memory extension of the X server.
You can either choose to build it with shared memory or without.  I
always do it without the performance increase is not really
incredible, except on something like a 2x0 machine with the local bus
graphics adapter.  Just take out "DSH_MEM" in the CFLAGS in the
makefile for mpeg_play.  There is more information about shared memory
link errors in section 1.513.

Also, in the module "video.c" for mpeg_play it will complain about not
having enough memory to fully optimize one of the loops.  You can get
around that by specificying "qmaxmem=8000" in your cflags line, BUT,
the extra optimization does little good in my tests.

------------------------------

4.27: NNTP, INN


Link errors compiling nntp may occur because your machine lacks the
"patch" command.  Patch can be obtained from GNU repositories.  See 
question 4.29 for more information on patch.

------------------------------

4.28: Zmodem - File transfer


RZSZ is Chuck Forsberg's script for Z-modem. It is available by ftp at
<ftp://oak.oakland.edu/pub/unix-c/xyzmodem/rzsz9305.tar.Z> or
directly from Forsberg at Omen Technology BBS at 503-621-3746.

Hints:
0. Build with "make posix"
1. Use an 8-bit clean version of rlogin or telnet (Note: below)
2. Set the system to be transparent, I use "terminal download" 
3. Ensure hardware flow-control

Note, carlson@xylogics.com (James Carlson) suggests: Rlogin is
"slightly" unclean -- if an FF FF 73 73 appears in the datastream, it
can be ripped out by rlogind as a 'window size change' request.

[Ed note: The important part is using an 8-bit clean application,
since there are several implemenations of rlogin and telnet availible
you may need to try both and hunt down manuals to find the right flags
for your system]

------------------------------

4.29: Patch - automated file updates


AIX 3.2.5 does not ship with patch, a utility to apply the differences
between two files to make them identical.  This tool is often used to
update source code.

<ftp://ftp.x.org/pub/R6untarred/xc/util/patch/>
<ftp://prep.ai.mit.edu/pub/gnu/patch-2.1.tar.gz>

------------------------------

4.30: XNTP - network time protocol, synchronizes clocks

From: Joerg Schumacher <schuma@ips.cs.tu-bs.de>

   AIX 4:   xntpd in bos.net.tcp.client
   source:  ftp://ftp.udel.edu/pub/ntp/
   WWW:     http://www.eecis.udel.edu/~ntp/


------------------------------

4.31: GNU Screen and AIX 4.1.x


Once again,  binaries can be had from <http://www-frec.bull.com/>.

------------------------------

4.32: PINT -- SCSI scanner software

From: Kenneth Stailey <kstailey@leidecker.gsfc.nasa.gov>

<http://www.dol-esa.gov/~kstailey/pint>
<ftp://uniwa.uwa.edu.au:/pub/pint>
<ftp://ftp.gwdg.de:/pub/misc/scanner>
<ftp://alpha.gnu.ai.mit.edu:/pub/pint-0.5d.tar.gz>

------------------------------

4.33: Pager/Paging software


There is information on Paging, Paging programs and  listing of the
Archive sites to download at the web site:
<ftp://ftp.airnote.net:/pub/paging-info/ixo.faq>.

HylaFAX (see 4.22) supports sending messages to alphanumeric pagers.

Commercially there is: AlphaPage(r) MD2001 from Information Radio
Technology, Inc. in Cleveland, OH. 

------------------------------

4.34: JAVA Development Kit

From: Curt Finch <curt@tkg.com>

<http://ncc.hursley.ibm.com/javainfo/>

------------------------------

4.35: Sendmail


<ftp://ftp.sendmail.org/sendmail/>

If you want to use SRC to start and stop BSD sendmail,  do the following 
after installing it:

chssys -s sendmail -S -n 15 -f 9 -a -d99.100

This tells SRC that sendmail may be stopped with signals 15 and 9.  It also
arranges for sendmail not to daemonize itself,  since it will run under SRC.

------------------------------

4.2 already has a similar feature.


------------------------------

1.149 How to install LPPs on a shared disk?
From: Ciaran Deignan <C.Deignan@frec.bull.fr>

I have an LPP that I want to install on all my AIX machines (for
example the "perl" freeware), but I want to minimize the disk-space
used on the network of machines. Can I selectively mount part of /usr
on another machine?

In general it is not possible to share an LPP with several machines.
Sometimes it is possible to use a dedicated filesystem to install
freeware which can then be shared.

However for anything packaged as an LPP it is possible to use
a script that replaces /usr/sbin/inurest, and that redirects files
delivered by the LPP to the shared disk.

One script that does this is called Ninstallp, and it is available
(with instructions) from
http://www.geocities.com/ResearchTriangle/5428/ninstallp.html

------------------------------

1.150 How can I reduce the size of /var/adm/wtmp ?

The file /var/adm/wtmp grows with each login, but is never reduced.
The contents of wtmp is used (only?) by the command "last",
which shows, in reverse order, all the logins and reboots that
happened since the start of the wtmp file.

The file should not be deleted, but the contents can be discarded using
the following command:
# > /var/adm/wtmp

Alternatively the freeware utility "tidysys" can remove all the entries
from wtmp that are older than (say) 15 days. Tidysys was written by
Terry Murray <terry@weavel.demon.co.uk> for AIX 3.2 and is available
from ftp://ftp.frontiernet.net/pub/aix/tsys220.tar.

Tidysys was ported to AIX 4.1 by C. Deignan and is available from
<http://www-frec.bull.com/>.

------------------------------

1.151: How do I start local daemons at system startup?

AIX does neither use the BSD style rc.local file nor the System V style
/etc/rc*.d startup files directories. To add local daemons to the system
startup sequence in a BSD rc.local style use the following command to
create an /etc/inittab entry:

# mkitab -i rcnfs "rclocal:2:wait:/etc/rc.local >/dev/console 2>&1"
# touch /etc/rc.local
# chmod 700 /etc/rc.local

Then put the command lines to start the daemons in /etc/rc.local.

------------------------------

1.152  How do I set the TZ variable to automatically change to
		daylight savings time?

The TZ variable can be set in /etc/environment file so the time
automatically switches to daylight savings time in spring and back to
normal in autumn. The actual rules when to switch vary by country, the
following should work in middle europe:

TZ=MET-1MET DST,M3.5.0/02:00:00,M10.5.0/03:00:00

The exact definition for the rules can be found with infoexplorer under
the environment page.

------------------------------

1.153  Why does init not reap its zombie child processes?

If you have lots of zombie (defunct) processes with parent process id 1,
the init process is probably waiting for some bad /etc/inittab
configuration line to finish. Check the inittab file for entries that
specify the wait keyword for processes that do not terminate. These
lines should probably specify "once" or "respawn" instead.

1.200: Some info about tape backups
From: Craig Anderson

The following supplements the information on rmt devices in
InfoExplorer. It is based on my own personal experience with IBM tape
drives running on AIX 3.1. No warranty is expressed or implied.

CONFIGURING THROUGH SMIT:
    BLOCK size (0=variable length)		(ALL)
	Sets the tape block size.  When reading, the block size must be
	set to the block size set when the tape was written.  When
	using some commands, tapes written with ANY block size can be
	read if the block size is set to 0 (variable length) (see
	"BLOCK SIZES" below).

    Use DEVICE BUFFERS during writes		(ALL)
	Set to yes, the device will buffer data internally on writes.
	This greatly improves performance, but under certain cases may
	be undesirable since the data is not written to tape before
	returning a good indication.

    Use EXTENDED file marks			(8mm only)
	Extended file marks take up much more space than short (or
	non-extended) file marks.  But extended file marks can be
	overwritten, allowing data not at the beginning of tape to be
	overwritten (see "FILE MARKS" below).

    RETENSION on tape change or reset		(1/4" only)
	If set to "no" then the tape will not be retentioned
	automatically when the tape is inserted.  Note that this will
	take effect only after the device is used.


FILE MARKS:
     Tape devices support multiple tape files.  Tape files are the
     result of a backup/cpio/tar/dd type command, where the device is
     opened, written to, and closed.  Because tapes allow large
     quantities of data to be written on a single tape, several backups
     (that is, tape files), may be combined on one physical tape.
     Between each tape file is a "tape file mark" or simply "file
     mark".  These file marks are used by the device driver to indicate
     where one tape file ends and another begins.

                              B       E
                   <-------   O       O   ------->
                              T       T
     physical | \            |       |      \             |physical
     beginning|  \           | tape  |       \            | end
       of     |   \          | file  |        \           |  of
      tape    |    \         | mark  |         \          | tape
              |_____\________|_______|__________\_________|
 
     Note that there is a distinction between the beginning of tape
     (BOT) side of a file mark and the end of tape (EOT) side of a file
     mark.  If the head is on the BOT side of a file- mark, "tctl fsf
     1" command will move only to the EOT side of the same file mark.

     With the 1/4" tape drive, writing can only take place
     sequentially, or after blank tape has been detected.  You cannot
     write over data on the tape (except at BOT).  If you wish to add
     data to a tape which has been written and then rewound you should
     space forward file mark until an error occurs.  Only then can
     you start writing again.

     With an 8mm tape drive, writing can only take place before blank
     tape, an EXTENDED file mark, or at BOT.  Thus if several backups
     have been made on one tape and you wish to overwrite one of the
     backups, position the tape to the place you wish to start writing
     and issue the following commands:
	tctl bsf 1
	tctl eof 1
     The first command skips back to the BOT side of the same file
     mark.  The second command rewrites the file mark (writing is
     allowed before extended file marks).  The erase head will erase
     data ahead of the write head, so that after writing the file mark
     the head will be positioned before blank tape.  Only after this
     may you start writing over data in the middle of the tape.  (All
     data beyond where you are currently writing will be lost).  Note
     that you cannot write over short file marks.  In order for this to
     work, the tape must have been written with extended file marks
     (use smit to change this).

     With the 9-track drive writing can take place anywhere on the
     tape although overwriting single blocks of data is not supported.

     On the 8mm drive extended filemarks use 2.2 megabytes of tape and
     can take up to 8.5 seconds to write.  Short filemarks use 184K
     and take up to 1.5 seconds to write.

BLOCK SIZES:
     When data is written to tape it is written in blocks.  The blocks
     on a tape are separated by inter-record gaps.  It is important to
     understand the structure of the written tape in order to
     understand the problems which can occur with changing block
     sizes.

     In fixed block size mode all blocks on the tape are the same
     size.  They are the size of the block size set in the device
     configuration.  All read()s and write()s to the tape drive must be
     a multiple of the fixed block size.

     In fixed block mode a read() will return as many blocks as needed
     to satisfy the read() request.  If a file mark is encountered
     while reading the tape only the data up until the file mark will
     be returned.

     It is not possible for the tape drive to read a tape whose block
     size is not the same as the block size in the device
     configuration.  (Unless the device configuration is in variable
     size blocks.)

     In variable block size (0) mode, the blocks written on the tape
     are the size of the read() and write() requests to the device
     driver.  In this case, the actual block sizes on the tape can be
     changed using the options to the backup commands (tar -C, cpio -C,
     backup -C).

     In variable mode, read() requests greater than size of the block
     on the tape will return only the data from the next block on the
     tape.  It is this feature that allows tapes written in any block
     size (fixed or variable) to read with the dd command (the output
     from the dd command may be piped to restore, tar, or cpio for
     example.)  Note that backup, tar, and cpio cannot read all tapes
     by using a large block size because they assume there is an error
     if they get a short read().
		dd ibs=128k obs=16k if=/dev/rmt0 | ...

     The tape head is always positioned at an inter-record gap, file
     mark, or blank tape after reading or writing.

     With the 8mm tape drive, using a fixed block size which is not a
     multiple of 1K is inefficient.  The 8mm tape drive always writes
     internally in 1K blocks.  It simulates the effect of variable
     block sizes, but, for example, using a fixed block size of 512
     bytes (or using variable block size and write()ing 512 bytes at a
     time) wastes one half of the tape capacity and gives only one half
     the maximum transfer rate.

     To figure out a tape's actual block size try:

     1). Set the tape to variable block size.
     2). "dd if=<tape> of=/tmp/dummy bs=128k count=1"
     3). "ls -l /tmp/dummy"
     4). The number of bytes in "/tmp/dummy" is the physical block size.

EXCHANGING DATA WITH NON-UNIX AND OTHER VENDORS MACHINES:
     Many tape drives support both variable and fixed block sizes.

     Variable block mode writes block sizes the size of the write
     command issued (tar and backup specify this with the -b option). 
     In fixed mode, block sizes are fixed and all writes must be a
     multiple of the fixed block size.

     Unix often internally chops larger reads and writes up into
     manageable pieces (often 65535, 65534, or 65532 bytes) before
     doing the actual reads and writes.  This means reads and writes of
     64K bytes are often broken up into a 65535 byte record and a 1
     byte record (In fixed mode the write will fail).  Block sizes >=
     64K (-C128 and greater) should be avoided for this reason.  AIX
     does not break up read and write requests, but be aware of the
     situation on other machines.

     If the tape is written in an unknown block size then set the
     device configuration in smit to use variable size blocks, use the
     "dd" command with a large input block size, and pipe it to the
     restore command.  For example:
	  chdev -l rmt0 -a block_size=0
	  dd if=/dev/rmt0 ibs=128k obs=16k | tar -tvf-

------------------------------

1.201: How do I do remote backup?

There seems to be several ways of doing this.  The first approach is a
one-liner to allow tar to reference another machine's device.  The
second is more complete but uses a similar approach.  The latest
addition to this section claims to be able to support mksysb on a
remote machine.  Thanks to all the contibutors.

  tar -b1 -cf - . | rsh REMOTEHOST "dd ibs=512 obs=1024 of=/dev/TAPEDEVICE"

[Ed.: The usave.sh script has been moved to section 8.06.  I've verified
this script works fine. However, it may be slow for large filesystems
since it creates a temp file of filenames in /tmp.]

There are also several commercial solutions.  One is IBM's SYSBACK/6000
product.  See Question 1.209 for more information.

Open Microsystems sells a product called DistribuTAPE which supports
mksysb to a remote tape drive under AIX 3.2, 4.1 and 4.2.  DistribuTAPE
supports remote tape drives by placing a pseudo tape driver on the
client system, and a server daemon on the server.  More information at
http://www.openmic.com/

------------------------------

1.202: How do I backup a multi-disk volume group?
From: pack@acd.ucar.edu (Daniel Packman)

[ Ed.: I have not verified this procedure. I would actually recommend
  NOT to have one volume group span multiple disks unless you really
  need such big logical volumes. ]

  1. If you have a set of three or more disks in a volume group
     (typically 3 for 5xx machines with three internal drives;
     with only two, the procedures outlined here have to be modified
     to ignore the fact that you don't have a quorum in the volume group)

  2. If one drive has failed (usually only one fails at a time :-) )

It is possible to go through a service boot (the volume group is called
rootvg and one of the 2 good disks on it is called hdisk0):

  importvg -y rootvg hdisk0
  varyonvg -f -n -m1 rootvg

These commands will work, but give error messages. If you wish to mount
a user filesystem, say /u on logical volume /dev/lv00, then

  mount -f /dev/lv00 /v

will work only if jfslog, the journaled file system log device, is not
on the damaged disk. If it is, you must (and can in any case) mount the
filesystem read-only:

  mount -f -r /dev/lv00 /v

This crucial and rather obvious point baffled several level 3 support
personnel at Austin as well as myself for almost a week. Once the file
system(s) of interest are available, they can be saved to tape for
restoration later. Of course, one can expect only about two thirds of a
filesystem to be recoverable if it spans all 3 physical disks. One
other point to remember is that the standard boot procedure from floppy
includes the restore command but does not include the backup command.

*****************************************************************************
* If you do not have other RS6000 machines at your site it is imperative    * 
* that you either build a bootable tape which includes either restore or    * 
* tar or cpio (a bootable floppy set will not have enough space) or at the  *
* very least copy onto a spare floppy backup, cpio, or tar.  The floppy     *
* should be created with backup -ivq so that its contents can be read into  *
* the memory resident system after booting.                                 *
*****************************************************************************

All is not lost if tar, cpio or backup are available on an undamaged
disk that can be mounted. Since tar and cpio are in /bin, they may both
very well be unavailable.

It is a very good idea for those who have tape devices to build a
bootable tape with their desired extra commands in it. Follow the
instructions from IBM but add your desired commands to the following
three files:

    /usr/lpp/bosinst/tape2
    /usr/lpp/bosinst/diskette/boot2
    /usr/lpp/bosinst/diskette/inslist

If you have anything other than a minimum memory configuration, you
should be able to add many commands.

------------------------------

1.203: How do I put multiple backups on a single 8mm tape?
From: kerm@mcnc.org (Cary E. Burnette)

There are two possible solutions to this, both of which use /dev/rmt0.1
which is non-rewinding.

SOLUTION #1
-----------

To put multiple backups on a single tape, use /dev/rmt0.1, which is a
no-rewind device, using either rdump or backup (both by name & inode
work). Using rdump or backup "byinode" both generate the message that
the tape is rewinding but actually do not. This is an example that
works on my system:

# rsh remote1 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
# rsh remote2 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
# tctl -f /dev/rmt0.1 rewind       # rewinds the tape

where I am implementing the command from host.

# restore -f /dev/rmt0.1 -s1 -tv

where the -s1 flag tells restore to go to the first record on the tape. 
Type the exact command again to get the second record. The -s(Number)
means go to Number record from this spot. It works pretty well.


SOLUTION #2
-----------
Steve Knodle, Educational Resources Center, Clarkson University

I use:
------------------- Dump.sh --------------------
CONTENTSFILE=`date |dd conv=lcase |sed -e 's/19//' |awk '{print $6 $2 $3}'`
set -x
LEVEL=$1
shift

backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /
backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /usr
backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /u
tctl -f /dev/rmt0 rewind

touch /usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /usr" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /u" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
tctl -f /dev/rmt0 rewind

I process the table-of-contents first by a little program that does
common prefix encoding, and then compress.

is reused.


Solution #3
-----------
   mount | grep jfs | cut -c27- | cut -d" " -f1 | \
     xargs -i backup -${LEVEL} -u -f /dev/rmt1.1 {} > ${DATE}.backup 2>&1

------------------------------

1.204: How can I make an exact duplicate of a tape over the network?

The challenge here is not to have to create a temporary file (disk space
limitation) and work across heterogeneous networks.

This script might work:

LOCAL=/dev/tape_dev
REMOTE=/dev/tape_dev
dd if=$LOCAL ibs=64k obs=512 | rsh remote_host dd ibs=512 obs=64k of=$REMOTE


From: pack@acd.ucar.edu (Daniel Packman)

Daniel provides the following perl script to convert from the known
world's function codes to AIX for compatibility.

#!/bin/perl
# Wrapper to convert input rmt requests to
# AIX 3.2 ioctl numbers.  We pass on all commands we don't understand
# I0 MTWEOF -> I10  STWEOF write and end-of-file record
# I1 MTFSF  -> I11  STFSF  forward space file
# I2 MTBSF  -> I12  STRSF  reverse space file
# I3 MTFSR  -> I13  STFSR  forward space record
# I4 MTBSR  -> I14  STRSR  reverse space record
# I5 MTREW  -> I6   STREW  rewind
# I6 MTOFFL -> I5   STOFFL rewind and unload tape
# I7 MTNOP  -> I0   (no-op? should ignore following count)
# I8 MTRETEN-> I8   STRETEN retension tape, leave at load point
# I9 MTERASE-> I7   STERASE erase tape, leave at load point
#I10 MTEOM (position to end of media ... no ibm equivalent?)
#I11 MTNBSF  (backward space file to BOF ... no ibm equivalent?)
@iocs = (10,11,12,13,14,6,5,0,8,7);
open(RMT,"|/usr/sbin/rmt") || die "Can't open pipe to rmt\n";
select(RMT);
$| = 1;
while (<STDIN>) {
  s/(^I)(\d$)/I$iocs[$2]/;
  exit 0 if $_ =~ /^[Qq]/;
  print RMT $_ ; }
exit 0;

------------------------------

1.205: What is tape block size of 0?
From: benson@odi.com (Benson I. Margulies)

Tape devices are generally split into two categories: fixed block and
variable block.  1/4" tape is the fixed block, and 8mm is variable.

On a fixed block size device, the kernel always sends data to the device
in suitable block size lumps, and varying the size passed to write(2)
(e.g., via the bs option to dd) gives the kernel more data to stream. 
On a variable block size device, the kernel writes to the device
whatever passed to it. On an 8mm, it had better be a multiple of 1024
to get efficient tape usage.

AIX has the World's Only Variable Block Size 1/4" tape drive. If you
use SMIT to set the block size to a nonzero value, AIX treats the device
as fixed block size, whether it is or not. By default, 8mm drives are
set to the same size as 1/4", 512 bytes. This is wasteful, but
otherwise mksysb and installp would fail.

If you set the block size to 0, the device is treated as variable block
size, and the size passed to write becomes the physical block size. 
Then if you use a sensible block size to dd, all should be wonderful.

------------------------------

1.206: Resetting a hung tape drive
From: Craig_Anderson@kcbbs.gen.nz (Craig Anderson)

A process accesses the tape drive. The process stops, exits, or whatever,
but still hold on to the drive. When this happens, the process cannot be
killed by any signal and the tape drive cannot be used by any other
process until the machine is rebooted.

The following should help:

RESET:

AIX, like most UNIX systems has no reset function for tape drives. You
can however send a Bus Device Reset (a standard SCSI message) to the
tape drive using the following piece of code. If the tape drive does
not respond to the BDR, then a SCSI Bus Reset will be sent (and this
will reset every device on the SCSI Bus). SCSI Bus resets are rather
extreme so you should refrain from using this program unnecessarily. 
But there are times (like after you've inserted a jammed/old/bad tape in
an 8mm drive), when there's no other way to reset the device other than
to shutdown and reboot (obviously you can power down and up an external
drive to reset it - and this would be the better choice).

This is actually documented in info, but can be hard to find and
there's no complete program.

/* taperst: resets the tape drive by sending a BDR to the drive. */
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/scsi.h>

int main(int argc, char **argv)
{
         /* This can be run only by root */

         if (argc != 2) {
             fprintf(stderr, "Usage: %s /dev/rmt#\n", argv[0]);
             return 1;
         }

         if (openx(argv[1], O_RDONLY, 0, SC_FORCED_OPEN) < 0) {
             perror(argv[0]);
             return 2;
         }
         return 0;
}

------------------------------

1.207: How do I restore specific files from a mksysb tape?
From: Marc Pawliger (marc@sti.com)

To recover specific files from a backup made with mksysb, try
$ tctl fsf 3
$ tar xvf /dev/rmt0.1 ./your/file/name

From: Matt Willman (Willman.matt@cnf.com)

The procedure changed with AIX 4, which uses backup instead of tar to
write the tape. For AIX 4 the procedure is as follows:

$ tctl fsf 3
$ restore -xvf /dev/rmt0.1 ./your/file/name

------------------------------

1.208: How do I read a 5Gbyte tape on a 2Gbyte drive?
Posted by: bobmet@clam.com (Robert Metcalf)

To read a 5Gbyte tape on a 2Gbyte drive, the
tape needs to have been created with a density setting of 20.

The following is from IBM's electronic ASKSUPPORT repository:
  
   R: The 7208 011 5 GB tape drive has various density settings which are
      as follows:
  
     +-------+--------------------------+
     | DENSIT| DESCRIPTION              |
     | SETTIN|                          |
     +-------+--------------------------+
     | 140   | Writes in 5.0GB mode and |
     |       | will enable data com-    |
     |       | pression; also, to do    |
     |       | compression you must use |
     |       | "DATA COMPRESSION = yes" |
     +-------+--------------------------+
     | 21    | Writes in 5.0GB mode and |
     |       | will NOT do data com-    |
     |       | pression                 |
     +-------+--------------------------+
     | 20    | Writes in 2.3GB mode and |
     |       | will NOT do data com-    |
     |       | pression                 |
     +-------+--------------------------+
     | 00    | Factory power-on default |
     |       | for 5.0GB data com-      |
     |       | pression mode            |
     +-------+--------------------------+
  
     The density setting of the 7208 011 must be 20 for it to make a tape
     that is readable by the 7208 001.


------------------------------

1.209: What can Sysback do for me?
From: johnsont@austin.ibm.com (Tony Johnson)

Sysback provides the flexibility of restoring onto the same system in
the exact same manner, or onto a completely different system with
differnet disk configuration, platform type, kernel, etc, while
reporting any inconsistencies and allowing you to adjust to fit. For
instance, you will get warnings if a particular volume group cannot be
created because the original disks to not exist, or that mirroring
cannot be accomplished because there is no longer enough disk space
because the disks are smaller. You can then select the disks for each
volume group, reduce or add space to filesystems and LVs, exclude
entire VGs or filesystems, etc.  You can even add and delete mirrors,
stripe or un-stripe logical volumes, etc.

In addition, all of the Sysback functions can be performed across the
network, including network boot and network install, and you can
perform striped backups across multipel tape drives, use sequential
tape autoloaders, and perform unattended multi-volume backups with
cron.

ON AIX 3.2, mksysb does not retain paging space config, disk LV
placement, mirroring, etc.

On AIX 4.1, it does these on an EXACT same configuration, but does not
allow any flexibility, and still does not retain non-rootvg volume
groups (although you can now use additional commands to backupa nd
restore these).  mksysb also does not allow you to clone onto
different platforms (i.e.  rspc -> rs6k -> rs6ksmp).


------------------------------

1.210: How can I get my HP 4mm DAT to work?

For HP25470/80A DDS:
   MRS disabled: Set switches 3,6,7,8=0 and 1,2,4,5=1
   MRS enabled:  Set switches 3,6,7=0 and 1,2,4,5,8=1

------------------------------

1.211: How do I copy DAT tapes?

If you have two drives try tcopy(1).  Otherwise the traditional UNIX
approach is ( dd if=/dev/rmt0 bs=1024b | dd of=/dev/rmt1 bs=1024b )
Put that in a while loop using a non-rewinding device to do multiple
files.  To use drives from two different machines either get the GNU
dd (bundled with GNU tar) or use something like.

  $ dd if=/dev/rmt0 bs=1024b | rsh hostname dd of=/dev/rmt0 bs=1024b


------------------------------

1.212: How do I speed up backups to DLT tapes?

DLT tapes need high data rates to stay in streaming mode. To achieve
higher data rates, use a variable length block size by setting the fixed
length block size to zero. Also use a buffer size of about 64KB for
backup (128 blocks for tar).

------------------------------

1.300: Some info about the memory management system
From: Michael Coggins (MCOG@CHVM1.VNET.IBM.COM).

1. Does AIX use more paging space than other unix systems?

Under many scenarios, AIX requires more paging space than other unix
systems. The AIX VMM implements a technique called "early allocation of
paging space". When a page is allocated in RAM, and it is not a
"client" (NFS) or a "persistent" (disk file) storage page, then it is
considered a "working" storage page. Working storage pages are commonly
an application's stack, data, and any shared memory segments. So, when
a program's stack or data area is increased, and RAM is accessed, the
VMM will allocate space in RAM and space on the paging device. This
means that even before RAM is exhausted, paging space is used. This
does not happen on many other unix systems, although they do keep track
of total VM used.

Example 1: 
Workstation with 64mb RAM is running only one small application that
accesses a few small files. Everything fits into RAM, including all
accessed data. On AIX, some paging space will already be used. On
other unix systems, paging space will be 100% free. Clearly, this is an
example that shows where we use more paging space than the other machines.

Example 2:

Same machine as above, except we are in an environment where many
applications are running with inadequate RAM. Also, the system is
running applications that are started, run, left idle, and not in
constant use. A session of FRAME running in a window, for example. 
What happens is that eventually (theoretically) all applications will be
paged out at least once. On the AIX system and the other systems the
total paging requirements will be the same (assuming similar malloc
algorithm). The major difference is that the AIX system allocated the
paging space pages before they were actually needed, and the other
systems did not allocate them until they were needed. However, most
other systems have an internal variable that gets incremented as virtual
memory pages are used. AIX does not do this. This can cause the AIX
system to run out of paging space (virtual memory), even though malloc()
continues to return memory. This "feature" allows sparse memory
segments to work, but requires that all normal users of malloc()
(sbrk()) know how much virtual memory will be available (actually
impossible), and to handle a paging space low condition. A big problem. 
There are some pretty obvious pros and cons to both methods of doing
Virtual Memory.

2. How much paging space do I need?

Concerning the rule of thumb of having 2 times RAM for paging space:
this is rather simplistic, as are most rules of thumb.  If the machine
is in a "persistent storage environment", meaning that they have a few
small programs, and lots of data, they may not need even as much as 1
times RAM for paging space.  For example, a 1GB database server running
on a 6000 with 256MB of RAM, and only running about 50MB of "working"
storage does not need 512MB of paging space, or even 256MB.  They only
need the amount of paging space that will allow all their working
storage to be paged out to disk.  This is because the 1GB database is
mostly "persistent storage", and will require little or no paging space. 
Excessive paging space may simply mean wasted disk space.  However,
avoid insufficient paging space.  Tip: Don't have more than one paging
space per disk.  Tip: Put lots of RAM in your system - it will use it.

3. Why does vmstat show no free RAM pages?

AIX uses RAM as a possibly huge disk buffer.  If you read a file in the
morning, that file is read into RAM, and left there.  If no other
programs need that RAM, that file will be left in RAM until the machine
is halted.  This means that if you need the file again, access will be
quick.  If you need that RAM, the system will simply use the pages the
file were using. The pages were flushed back to disk earlier.  This
means that you can get a huge speedup in disk access if you have enough
RAM.  For example, a 200MB database will just ease into RAM if you have
a 256MB system.

4. Since vmstat shows no free RAM pages, am I out of RAM?

Probably not. Since disk files will be "mapped" into RAM, if vmstat
shows lots of RAM pages FREE, then you probably have too much RAM (not
usual on a RISC System/6000)!

5. Shouldn't the "avm" and the "fre" fields from vmstat add up to something?

No. The "avm" field tells you how much "Active Virtual Memory" AIX
thinks you are using. This will closely match the amount of paging
space you are using. This number has *ABSOLUTELY* nothing to do with
the amount of RAM you are using, and does *NOT* include your mapped
files (disk files).  The amount of RAM can be determined with
/usr/sbin/bootinfo -r

6. Why does the "fre" field from vmstat sometimes show lots of free
   RAM pages?

This will happen after an application that used a lot of RAM via
"working" storage (not NFS storage, and not disk file or "persistent"
storage) exits. When RAM pages that were used by working storage (a
program's stack and data area) are no longer needed, there is no need to
leave them around. AIX completely frees these RAM pages. The time to
access these pages versus a RAM page holding a "sync'd" mapped file is
almost identical. Therefore, there is no need to periodically "flush" RAM.

7. Is the vmstat "fre" field useful?

The vmstat "fre" field represents the number of free page frames.  If
the number is consistently small (less than 500 pages), this is normal. 
If the number is consistently large (greater than 4000 pages), then you
have more memory than you need in this machine.

------------------------------

1.301: How much should I trust the ps memory reports?
From: chukran@austin.VNET.IBM.COM

Using "ps vg" gives a per process tally of memory usage for each running
process.  Several fields give memory usage in different units, but these
numbers do not tell the whole story on where all the memory goes.

First of all, the man page for ps does not give an accurate description
of the memory related fields.  Here is a better description:

RSS - This tells how much RAM resident memory is currently being used
for the text and data segments for a particular process in units of
kilobytes.  (this value will always be a multiple of 4 since memory is
allocated in 4 KB pages).

%MEM - This is the fraction of RSS divided by the total size of RAM for
a particular process.  Since RSS is some subset of the total resident
memory usage for a process, the %MEM value will also be lower than actual.

TRS - This tells how much RAM resident memory is currently being used
for the text segment for a particular process in units of kilobytes. 
This will always be less than or equal to RSS.

SIZE - This tells how much paging space is allocated for this process
for the text and data segments in units of kilobytes.  If the executable
file is on a local filesystem, the page space usage for text is zero. 
If the executable is on an NFS filesystem, the page space usage will be
nonzero.  This number may be greater than RSS, or it may not, depending
on how much of the process is paged in.  The reason RSS can be larger is
that RSS counts text whereas SIZE does not.

TSIZ - This field is absolutely bogus because it is not a multiple of 4
and does not correlate to any of the other fields.

These fields only report on a process text and data segments.  Segment
size which cannot be interrogated at this time are:

       Text portion of shared libraries (segment 13)

       Files that are in use. Open files are cached in memory as
       individual segments.  The traditional kernel cache buffer
       scheme is not used in AIX 3.

       Shared data segments created with shmat.

       Kernel segments such as kernel segment 0, kernel extension
       segments, and virtual memory management segments.

Speaking of kernel segments, the %MEM and RSS report for process zero
are totally bogus for AIX 3.1.  The reason why RSS is so big is that the
kernel segment zero is counted twice.  For AIX 3.2, this has been
changed, but the whole story is still not known.  The RSS value for
process 0 will report a very small number of the swapper private data
segment.  It does not report the size of the kernel segment 0, where the
swapper code lives.

In summary, ps is not a very good tool to measure system memory usage. 
It can give you some idea where some of the memory goes, but it leaves
too many questions unanswered about the total usage.

------------------------------

1.302: Which simms do RS6000's use?

This answer is under construction... I'm trying to collect details
about compatable simms.

RS/6000 220,230 USE 2 pair 70ns PS/2 style simms
RS/6000 250,C10 USE 4 pair 70ns PS/2 style simms

------------------------------

1.303: What is kproc?

kproc (always PID 514 on AIX 3 and PID 516 on AIX 4) is the kernel's
idle process.

------------------------------

1.304: How do I create a RAM disk in AIX?
From: Jeff Wang <hjiwa@nor.chevron.com>

You can't create a RAM disk in AIX.  The closest related functionality
the operating system gives you is the RAM disk buffer. Read 1.300
sub-section 3.

------------------------------

1.305: How much RAM (real memory) does my machine have?
From: Michael Abel/resnova
	<Michael_Abel/resnova%RESNOVAD@notesgw.compuserve.com>

As     root:  bootinfo -r
As any user:  lsattr -E -l sys0 -a realmem

lsdev -C -c memory

shows all memory adapters.  On MCA systems one may add up the values
displayed for each memory card in order to sum up to the amount of
total memory.  On PCI systems only one item (mem0) is
displayed. Additional information may be displayed with

lsattr -E -lmem0

These commands were tested on various IBM systems running AIX relases
3.2.5 and 4.1.4

------------------------------

1.306: Why do PIDs run non-sequentially?
From: Julianne F. Haugh <jfh@austin.ibm.com>

The answer (I was there, consider me an authority ...) is that the
PIDs needed to be somewhat unpredictable.  This is because AIX was
originally designed with a number of C2 and B1 features, and one of those
is the notion of covert channel analysis.  Sequential PIDs are a covert
channel (assuming the system has one PID namespace ...) since the value
of the "next" PID is shared by all currently running processes.  So if I
want to sneak some of my classified data out to your co-operating
non-classified program, I can do it by carefully controlling the value
of the "next" PID.

------------------------------

1.400: How do I make an informative prompt in the shell?

In the Korn Shell (ksh), the PS1 variable is expanded each time it is
printed, so you can use:

$ export myhost=`hostname`
$ PS1='$LOGNAME@$myhost $PWD \$ '

to get, e.g. 

bengsig@ieibm1 /u/bengsig $

In the C-shell, use:

% set myhost=`hostname`
% alias cd 'chdir \!* > /dev/null; set prompt="$LOGNAME@$myhost $cwd % "'
% cd

to get, e.g.

bengsig@dkunix9 /u/bengsig/aixfaq %

There is no easy solution in the Bourne Shell.  Use the Korn Shell instead.

------------------------------

1.401: How do I set up ksh for emacs mode command line editing?

The ksh has an undocumented way of binding the arrowkeys to the emacs
line editing commands. In your .kshrc, add:

alias __A=`echo "\020"`   # up arrow = ^p = back a command
alias __B=`echo "\016"`   # down arrow = ^n = down a command
alias __C=`echo "\006"`   # right arrow = ^f = forward a character
alias __D=`echo "\002"`   # left arrow = ^b = back a character
alias __H=`echo "\001"`   # home = ^a = start of line

Type "set -o emacs" or put this line in your .profile.

Also, you MUST have PTF U406855 for this to work in AIX 3.2.  The APAR #
for the problem is IX25982, which may have been superseded.

------------------------------

1.402: Listing files with ls causes a core dump
From: Julianne F. Haugh <jfh@austin.ibm.com>

Scenario: a directory that is shared by N users (N >= 200).
Run 'ls -l' in that directory.  It goes for a while, then
Seg fault(coredump)!

It only occurs when the usernames are displayed (almost every file is
owned by a different person).  The -g and -n options work fine; only -l
and -o (which shows owner and not group) cause it. 

I believe that this problem was corrected by U407548.  If you have that
many users that you are having core dump problems (it took over 200),
you might also want to look into getting the PTF that fixes IX31403. 
That APAR deals with large numbers of accounts and performance problems
associated with looking them up.

------------------------------

1.403: How do I put my own text into InfoExplorer?

With AIX 3.1, you cannot do it.  AIX 3.2 has a product called
InfoCrafter that allows you to do that.

------------------------------

1.404: InfoExplorer ASCII key bindings 
From: mycroft@hal.gnu.ai.mit.edu (Charles Hannum)

If you just press 'Return' when it starts up, with 'Basic Screen
Operations' highlighted, you'll get some help.

If you look long enough, you'll find a page named 'Using Keys and Key
Sequences in the InfoExplorer ASCII Interface'.  It describes the key
sequences and actions.  Here are a few to get you started.

Keys       Action

Ctrl-W     Moves between the Navigation screen and the Reading screen.
If the Navigation screen is displayed, you can press Ctrl-W to display
the Reading screen.  If the Reading screen is displayed, you can press
Ctrl-W to display the Navigation screen.

Ctrl-O     Makes the menu bar active or inactive.  If your text cursor is
located in the text area of the screen, you can press Ctrl-O to make the
menu bar active.  If the menu bar is already active, you can press
Ctrl-O to make it inactive, which moves the text cursor to the text area.

Tab     Moves to the next menu bar option in the menu bar.  If a pull-down
menu is not displayed and you press the Right Arrow key, the next menu
bar option is displayed in reverse video.
 
------------------------------

1.405: How can I add new man pages to the system?
From: horst@faui63.informatik.uni-erlangen.de (Horst Luehrsen)

Put the man pages in /usr/man, e.g. /usr/man/man1/tcsh.1 for the tcsh
man page.  Under AIX 3.1.10, /usr/lib/makewhatis can be used to update
the makewhatis-database /usr/man/whatis so apropos and whatis know about
the added manpages.  /usr/lib/makewhatis should be available on all 3.2
versions.

For AIX 4.x, you can store the man pages in the /usr/share/man hierarchy.
/usr/lib/makewhatis is still there.

------------------------------

1.406: Why can't I read man pages?  Where is nroff?

Nroff and troff aren't in the base installation.  It is shipped as
part of AIX 3.2.5 but may not be installed.  Use smit to install a
software package called txtfmt.tfs.obj from your 3.2.5 distribution
media.

In AIX 4.x, you need bos.txt.tfs.

------------------------------

1.407: Why is my environment only loaded once?

The .profile file is only loaded once (for your login shell) subsequent
shells should be initialized by setting ENV=$HOME/.kshrc (for ksh).

Bash users can use $HOME/.bash_profile for the login shell environment
and $HOME/.bashrc.

------------------------------

1.408: Where is the 'nawk' command on my AIX system?
From: Jeff Wang <hjiwa@nor.chevron.com>

The /bin/nawk that exists on many UNIX flavors is a superset of the
'awk' command, revised by the same original authors to include added
functionality.  All the extra options normally associated with 'nawk'
on other UNIXes have been incorporated into the AIX version of 'awk';
the AIX 'awk' InfoExplorer or man pages include nawk-specific features
such as the "-v" command line option and atan2(), rand(), srand(),
match(), sub(), gsub(), system(), close(), getline functions.

If your AIX version is missing /bin/nawk (as are most AIX 3.x
versions), the simplest way to get around this and maintain script
portability between UNIX platforms is to make a /bin/nawk link to
/bin/awk (as root, of course).  If you do not have root privilege or
do not want to create a /bin/nawk link, to make the script work on
different UNIXes, you may have to test `uname` first and set all
'nawk' references on AIX runs to /bin/awk.  If your script is to only
run on AIX systems, you can just change all references of 'nawk' to
'awk' and everything should still work okay...but check the AIX awk
script on test data prior to making actual runs.

[Editor's note: AIX 4.x already contains a link from /usr/bin/nawk
to /usr/bin/awk.]

------------------------------

1.409: How do I copy InfoExplorer (manpages and more) to my hard drive?
From: David Alexander <unilink@online.rednet.co.uk>

[Editor's note: While this is documented in one of the AIX manuals
and covered in /usr/lpp/bos/bsdadm (AIX 3 only), it comes up often
enough I thought I would include it here.]

Not all the Info databases are required, so do not copy them all unless the 
customer specifically requests them, or has asked for the software they 
refer to.  These instructions assume you have enough space on /usr.

	Install and mount the InfoExplorer CD-ROM as for use of Info 
	from CD-ROM.

	Log in as Root
	umount /usr/lpp/info/lib/$LANG
	mkdir /mnt/$LANG
	mount -v cdrfs -r /dev/cd0 /mnt/$LANG

	cd /
	cd /mnt/$LANG
	cp -r aix /usr/lpp/info/lib/$LANG
	cp -r aix2 /usr/lpp/info/lib/$LANG
	cp -r compnav /usr/lpp/info/lib/$LANG
	cp -r hardware /usr/lpp/info/lib/$LANG
	cp -r nav /usr/lpp/info/lib/$LANG
	cp -r prog /usr/lpp/info/lib/$LANG
	cp -r uiprog /usr/lpp/info/lib/$LANG

	Other sections can be copied if required:
	Section						Size
	cp -r ada /usr/lpp/info/lib/$LANG		7.2  Mb
	cp -r assemb /usr/lpp/info/lib/$LANG		5.23 Mb
	cp -r cxx /usr/lpp/info/lib/$LANG		6.52 Mb
	cp -r dce /usr/lpp/info/lib/$LANG		3.8  Mb
	cp -r encina /usr/lpp/info/lib/$LANG		2.67 Mb
	cp -r fortran /usr/lpp/info/lib/$LANG		6.85 Mb
	cp -r graph /usr/lpp/info/lib/$LANG		9.75 Mb
	cp -r graph2 /usr/lpp/info/lib/$LANG		4.1  Mb
	cp -r pascal /usr/lpp/info/lib/$LANG		3.23 Mb

	umount /mnt/$LANG
	eject the CD-ROM

------------------------------

1.410: Why can't I set my default shell to one we've just installed?

When adding new shells to the system, add them to the "shells=" line
in /etc/security/login.cfg so they can be used during ftp and rlogin
by users who use them as their default shell.

------------------------------
 
1.411: Why do I get the "Unable to connect socket: 3"
                starting Info-Explorer?

It's a bug in the way infod sets the initial permission on the            
/tmp/.info-help socket. Do a chmod 777 on /tmp/.info-help and the
message will go away. (Charlie McGuire, mcguire@cs.umt.edu)

This problem was fixed by APAR IX43230, PTF U432315
(Paul Sitz, psitz@empros.com)

------------------------------

1.412: Why can't I write a setuid shell script?
From: mww@microfocus.com (Michael Wojcik)

AIX, as of about the first release of 3.2.5* does not allow SUID scripts.
(It ignores the SUID and SGID bits on scripts.)  They're a huge security
hole.

If you really want to run a script SUID, you can create a small C program
that does a setuid(0) and then system()'s your script.  (Actually, the
setuid() call isn't necessary on all Unixes; IIRC, it's not on AIX 3.2.5,
but YYMV.)  Make the program SUID.  Be very careful.

There are other similar solutions.  You might also want to look into
sudo, which handles this sort of thing in a somewhat more controlled
manner

* Julianne Frances Haugh (jfh@tab.com) writes:

I raised an objection to set-ID shell scripts before AIX 3.1 was
golden.  ... it was finally done in the 3009 PTF for AIX 3.1.

------------------------------

1.500  Which release of X11 do I have?

AIX 4.x includes X11 R5 and Motif 1.2.

On AIX 3, Run 'lslpp -h X11rte.obj'.
If your output has a line similar to:

            01.02.0000.0000 COMPLETE   COMMIT     03/04/93   02:05:11 root

you have X11 R4. If your output has a line similar to:

    U491068 01.02.0003.0000 COMPLETE   COMMIT     07/28/93   12:50:42 root

you have X11 R5. Some people also call these AIXwindows 1.2.0 and
1.2.3.  'lslpp -h X11rte.motif1.2.obj' should tell you if you are
running Motif 1.2.

From: Jan Just Keijser <KeijserJJ@logica.com> 

AIX 4.1 and AIX 4.2 come with X11R5 and Motif 1.2.4

AIX 4.3.1 (and perhaps 4.3.0) comes with X11R6.1 and Motif 2.1

Some executables which run fine using the X11R5 libraries may not run
when using the X11R6.1 libraries; you can specify which X11 libraries to
use by setting
  LIBPATH=/usr/lpp/X11/lib/R5:/usr/lib:...
for X11R5 and
  LIBPATH=/usr/lpp/X11/lib/R6:/usr/lib:...
for X11R6.1; by default,
    /usr/lib/libX11.a -> /usr/lpp/X11/lib/R6/libX11.a
and also for the other libraries on AIX 4.3.1.

On most of the AIX 4.1.x and 4.2.1 boxes I have seen the default is
  /usr/lib/libX11.a -> /usr/lpp/X11/lib/R4/libX11.a
ie the default libraries are the X11R4 libraries and _NOT_ the R5
libraries; this may also be due to the setup at my site.

------------------------------

1.501: How to prevent ctrl-alt-backspace from killing the X session

Start X with 'xinit -T' to disable ctrl-alt-backspace from stopping X.

------------------------------

1.502: Who has a termcap/terminfo source for the HFT console?

The console used on the RISC System/6000, PS/2 and RT can be used as a
terminal on another system with the termcap below.  You can find this
and other termcaps in /lib/libtermcap/termcap.src, including IBM
specific ones.  The terminfo sources are stored in /usr/lib/terminfo/*.ti.
This termcap can also be used from an aixterm window.

hf|hft|hft-c|ibm8512|ibm8513|IBM_High_Function_Terminal:\
	:co#80:li#25:am:ht:\
	:cm=\E[%i%d;%dH:ti=\E[25;1H:te=\E[20h:\
	:nd=\E[C:up=\E[A:do=^J:ho=\E[H:\
	:bs:sf=\E[S:ec=\E[%dX:\
	:cl=\E[H\E[J:cd=\E[J:ce=\E[K:\
	:AL=\E[%dL:DL=\E[%dM:al=\E[L:dl=\E[M:\
	:im=\E[4h:ei=\E[4l:mi:\
	:dm=\E[4h:ed=\E[4l:\
	:so=\E[7m:se=\E[m:ul=\E[4m:ue=\E[m:\
	:md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:\
	:as=^N:ae=^O:sc=\E[s:rc=\E[u:\
	:kl=\E[D:kb=^H:kr=\E[C:ku=\E[A:kd=\E[B:kh=\E[H:\
	:kn#10:k1=\E[001q:k2=\E[002q:k3=\E[003q:k4=\E[004q:k5=\E[005q:\
	:k6=\E[006q:k7=\E[007q:k8=\E[008q:k9=\E[009q:k0=\E[010q:\
	:is=\Eb\E[m^O\E[?7h:rs=\Eb\E[m^O\E[?7h\E[H\E[J:

------------------------------

1.503: How can I look at PostScript files?  Why is "dpsexec" so lousy?
From: Marc Pawliger <marc@sti.com>

showps comes with the 1.2.3 (X11R5) version of the X11rte.ext.obj LPP.
Very nice PS file previewer from Adobe.  Replaces xpsview which came
with pre-1.2.3 Installed as /usr/lpp/DPS/showps/showps

From: VRBASS@ATLVMIC1 (Vance R. Bass)

You can look at PostScript files using either "xpreview" (in the
optionally installable text formatting services) or you can get
Ghostscript and Ghostview from a comp.sources.x server and build it
yourself.

>From the "xpreview" man page:
The xpreview command is an AIXwindows 1.2- and Motif 1.1-based
application that displays output from the troff command on an AIXwindows
display.  The troff command output file must be prepared for any one of
the devX100, devX100K or devpsc devices.  The xpreview command also
displays PostScript language files that begin with %!.

"dpsexec" is NOT intended to be a full-service document browser, but
rather a simple DPS code debugger.  If you insist on using it, you can
edit your PS code to remove the "showpage" (which will reset dpsexec
and clear the window) to view single-page files.  It does not handle
multi-page files gracefully.

------------------------------

1.504: unix:0 vs `hostname`:0

1.) Is there any way to get the machine to check its local host table
    first without renaming resolv.conf?

[AIX 3.2 only]
PTF U412845 implements an environment variable to set the resolver
time out in AIX 3.2.  This allows you to set RES_TIMEOUT to the number
of seconds before it times out, a failing a DNS query the machine will
consult /etc/hosts.  

2.) How do you tell X applications where you are if the console display 
    is unix:0?

From: David L. Crow <crow@waterloo.austin.ibm.com>

  I would suggest that if you have R5, use ":<display>.<screen>".  I do
  not believe that R4 clients will understand :0, so I would suggest
  unix:0 for them.

  Without specifying unix or the hostname, you will get the fastest
  transport mechanism.  While currently there are only two transport
  methods in the AIXwindows X server (Unix sockets and TCP sockets),
  many vendors are looking at using shared memory as a transport method. 
  If you use :0 (or :0.0 or :1, etc.), then you should get the best
  performance regardless of the available transport methods.

From: Marc Pawliger <marc@sti.com>

  Using "unix:0" or "hostname:0" when the X11 Shared Memory Transport
(SMT) is installed as part of the 1.2.3 X11rte.obj (X11R5) will incur
a penalty vs. using ":0" See /usr/lpp/X11/README.SMT

3.) Is there a significant performance penalty incurred by using
    `hostname`:0 as DISPLAY?

  Yes! Using unix:0, you are using Unix sockets.  These are much faster
  than their TCP socket counterparts.

------------------------------

1.505: VT100 key bindings for aixterm
From: haedener@iac.unibe.ch <Konrad Haedener>

Add this to your .Xdefaults file and start your VAX session with
'aixterm -v -name vt100 -e telnet MYVAXHOST'

-----
vt100.vt102: true
vt100.fullcursor: false
vt100.translations:    <Key>F1: string(0x1b) string("OP") \n\
                       <Key>F2: string(0x1b) string("OQ") \n\
                       <Key>F3: string(0x1b) string("OR") \n\
                       <Key>F4: string(0x1b) string("OS") \n\
                       <Key>KP_0: string(0x1b) string("Op") \n\
                       <Key>KP_1: string(0x1b) string("Oq") \n\
                       <Key>KP_2: string(0x1b) string("Or") \n\
                       <Key>KP_3: string(0x1b) string("Os") \n\
                       <Key>KP_4: string(0x1b) string("Ot") \n\
                       <Key>KP_5: string(0x1b) string("Ou") \n\
                       <Key>KP_6: string(0x1b) string("Ov") \n\
                       <Key>KP_7: string(0x1b) string("Ow") \n\
                       <Key>KP_8: string(0x1b) string("Ox") \n\
                       <Key>KP_9: string(0x1b) string("Oy") \n\
                       <Key>KP_Divide: string(0x1b) string("OQ") \n\
                       <Key>KP_Multiply: string(0x1b) string("OR") \n\
                       <Key>KP_Subtract: string(0x1b) string("OS") \n\
                       <Key>KP_Add: string(0x1b) string("Om") \n\
                       <Key>KP_Enter: string(0x1b) string("OM") \n\
                       <Key>KP_Decimal: string(0x1b) string("On") \n\
                       <Key>Next: string(0x1b) string("Ol") \n\
                       <Key>Left: string(0x1b) string("OD") \n\
                       <Key>Up: string(0x1b) string("OA") \n\
                       <Key>Right: string(0x1b) string("OC") \n\
                       <Key>BackSpace : string(0x7f) \n\
                       <Key>Down: string(0x1b) string("OB")

You should also add

XENVIRONMENT=$HOME/.Xdefaults
export XENVIRONMENT

to your .profile.

------------------------------

1.506: Is there a screen saver that does not use excessive CPU?
From: Don Buchholz <buchholz@ese.ogi.edu>

Try using xlock with these options:

	xlock -mode life -count 1500 -nice 20 -root


From: pranav@evolving.com (Pranav Vakil)

Use mlock -hide to hide the background. You can also modify the mlock
(/usr/local/tools/mlock) code to allow the standard X screen saver to
take effect. The timeout value is originally set to 0 which means the
screen saver is off. Modify this to be 120 (2 minutes) and set the
interval time to be 60 (1 minute). Using these intervals, I have found
that over a 24 hour period, it uses only .3 cpu minutes.

------------------------------

1.507: Where are the colors, available for an X session, listed.

/usr/lpp/x_st_mgr/bin/rgb.txt and on AIX 4.2, the file is
/usr/lpp/X11/lib/X11/rgb.txt

------------------------------

1.508: Why does my app hang the X server but not an X station?
From: Bjorn P. Brox <brox@corena.no>

/usr/lpp/X11/README.SMT X client/server communication uses a 64k
buffer by default.  The size of this buffer is controled by the
X_SHM_SIZE environment variable increasing the size of the buffer has
been used to prevent some applications from hanging the X server :)

------------------------------

1.509: How do I switch the control and caps lock key bindings?

If you are running the X window system, you can put the following into
.xmodmaprc

  remove Lock = Caps_Lock
  remove Control = Control_L
  keysym Control_L = Caps_Lock
  keysym Caps_Lock = Control_L
  add Lock = Caps_Lock
  add Control = Control_L

Hidden Hint: Use (xmodmap -e "pointer = 3 2 1") to make the mouse
lefty friendly.

------------------------------

1.510: Missing fonts?

If your Xserver supports X11R5 try running a font server (edit
/usr/lib/X11/fs/config and run fsconf && startsrc -s fs) Consult your
Xserver instructions on how to include a font server in your font
path.

------------------------------

1.511: What's the termcap entry for an IBM 3151 look like?

#
# Written by Aleksandar Milivojevic, alex@srce.hr
# 24.09.1994
#
I2|ibm3151|3151|IBM 3151 terminal:\
	:am:mi:cr=^M:sf=^J:co#80:li#24:cd=\EJ:ce=\EI:cm=\EY%+\040%+\040:\
	:cl=\EH\EJ:dc=\EQ:dl=\EO:do=\EB:le=\ED:mb=\E4$a:md=\E4(a:\
	:me=\E4@\E>B:mr=\E4!a:nd=\EC:se=\E4>b:so=\E4!a:ue=\E4=b:up=\EA:\
	:us=\E4"a:kb=^H:kd=\EB:kh=\EH:kl=\ED:kr=\EC:ku=\EA:\
	:k1=\Ea\r:k2=\Eb\r:k3=\Ec\r:k4=\Ed\r:k5=\Ee\r:\
	:k6=\Ef\r:k7=\Eg\r:k8=\Eh\r:k9=\Ei\r:k0=\Ej\r:\
	:ti=\E>B:te=\E>B:ms:ho=\EH:bl=^G:al=\EN:ta=^I:

------------------------------

1.512: Errors starting X11 application binaries from aixpdslib.
From: <URL:ftp://aixpdslib.seas.ucla.edu/pub/README_X11R5_Stuff>

We have been aware of the problem people have with dynamic links
when running the prebuilt of X-stuffs from this library.

The typical error messages will be:

    Could not load program [program_name]
    Member shr4.o not found or file not an archive
    Member shr4.o not found or file not an archive
    Could not load library libXt.a[shr4.o]
    Error was: No such file or directory

It's because that we built the programs using X11 libraries of MIT
which are not compatible with those of IBM.  If this is the case,
then please get the compressed tarred file of the source code instead,
and recompile them on your system using your libraries.

------------------------------
1.513: .XShm*, .sm* (Shared memory) Link errors building 
                 Xwindows applications.

Link errors that refer to .XShm* often times are a result of compiling
applications to take advantage of the Shared Memory extension of the X
server.  You may either compile without shared memory or load the
shared memory extensions. (see /usr/lpp/X11/README and README.SMT) A
script for rebuilding your X server with the shared memory can be found
in /usr/lpp/X11/Xamples/server.

------------------------------

1.514: How do I set my DISPLAY when I login to another machine?

Though this is not a question specific to AIX, it appears often enough
to warrant an answer here.  There are lots of approaches, some of which
are described in the X Windows FAQ.  Most involve a little login shell
programing to parse the output of `who` or `who am i`.
<URL:ftp://boogle.uchicago.edu/pub/aix/src/hostwhence.tar.Z> by
e-siebert@uchicago.edu will help if you are willing/able to install it
suid.  See the X Windows FAQ and newsgroup for more information.

Hostwhence is also availabile in the "lsof" smit-installable package on
www-frec.bull.com. The installation scripts use ACLs to allow hostwhence to
read /dev/kmem without being set-uid-root.

------------------------------

1.515:  Why doesn't Netscape work?
From: "Gary R. Hook" <hook@austin.ibm.com>

The problem is that Netscape has statically linked libc into 
Mozilla.  When the AIX 3 libc code (setlocale()) tries to
load an AIX 4 locale, the two are incompatible and a core
dump ensues.  AIX 4 locales have to be loaded by AIX 4 libc.
Using LANG=C causes a lot of locale code to be bypassed, allowing
the application to avoid loading a non-C locale, and to continue
execution.

>From: Colin <apollo@randomc.com>
Here is a shell script that works around Netscape's problems by
setting the LANG and CLASSPATH environment variables.

#!/bin/sh
LANG=C
CLASSPATH=/path/to/java_30
export LANG CLASSPATH
if [ $# -eq 0 ]; then
   /path/to/netscape http://your.home.page &
else
   /path/to/netscape $* &
fi

------------------------------

1.600: My named dies frequently, why?
From: jpe@ee.egr.duke.edu (John P. Eisenmenger)

Running on 3.2, named dies frequently on network's primary name server.


Try the following:

     stopsrc -s named		# stop running named
     setenv MALLOCTYPE 3.1	# use 3.1 memory allocation algorithm
     /etc/named ...		# don't use smit to start named

You might be able to use startsrc/smit after setting MALLOCTYPE and get
the same effect, but I'm not sure.

[According to John, the problem is malloc() in the named code. He
 also suggests using Berkeley's bind, which he has ported and can be
 ftp'ed from ftp://ftp.egr.duke.edu/archives/bind-4.8.3.tar.gz. -ed]

Two ptfs should fix this problem. Get U412332 and U414752.

Christophe Wolfhugel <Christophe.Wolfhugel@grasp.insa-lyon.fr> reports
that bind 4.9 works fine on AIX 3.2 and without MALLOCTYPE=3.1.

------------------------------

1.601: How do I trace ethernet packets on an AIX system?
From: afx@muc.ibm.de (Andreas Siegert)

Do the following:

     iptrace -i en0 /tmp/ipt

The iptrace backgrounds.  Find its process id and kill it when you are
ready.  Then run

     ipreport -rns /tmp/ipt >/tmp/ipr

and look at the output.  The current version of Info does not document
the r, n and s options but they are quite useful for layering the output.

------------------------------

1.602 What is the authorized way of starting automount at boot time?
From: curt@ekhadafi.austin.ibm.com (Curt Finch)

I put this in my /etc/inittab:

automount:2:once:/usr/etc/automount -T -T -T -v >/tmp/au.se 2>&1

I hereby dub it authorized.

Jim Salter <jsalter@netscape.com> writes: You can also use the command:
'mkitab "automount:2:once:/usr/etc/..."' to avoid editing the file by hand.

------------------------------

1.603: How do I set a tty port for both dial-in and dial-out?

Set the mode of the tty to be either 'shared' or 'delayed'. 

------------------------------

1.604: How to move or copy whole directory trees across a network

The following command will move an entire directory tree across a network 
while preserving permissions, uids and gids.

      $rsh RemoteHost "cd TargetDir; tar -cBf - ." | tar -xvBf -

Explanation:

The tar-create is rsh'd to the remote system and is written to
stdout (the pipe).

The local system is extracting the tar that is being read from
stdin (the pipe).

From: abeloni <abeloni@hstern.com.br>

Another method is:

	rcp -rp host1:/dir host2:/dir

------------------------------

1.605: How can I send mail to hosts that cannot be pinged?
From: jupiter.sun.csd.unb.ca!dedourek (John DeDourek)

AIX 3.2 as shipped is configured to only send mail to mail addresses
which include a host name.  Many organizations use a mail address whose
"host name" part is not a host name (technically an MX name).  To change
the configuration of the AIX mailer, login as root.  Then edit the file
/etc/sendmail.cf to remove the comment marker ("# ") at the beginning of
the line which reads:
    # OK MX

Now rebuild the machine readable form of the configuration with
    sendmail -bz

and finally restart signal sendmail to load the new configuration by one
of the following:
     reboot
or
     stopsrc -s sendmail
     startsrc -s sendmail
or 
     kill -1 `cat /etc/sendmail.pid`


1.606: How to configure dialup SLIP

IBM's WWW page <http://www.ibm.com/> can lead you to a helpful document
<http://www.austin.ibm.com/pub/www/services/aix_service/faxes/SLIP.DOC.zap>

From: marvin@tornado.oche.de (Christian Bode)

If you don't have problems with slattach you should have PTF 
bos.obj 3.2.0.0.U411505 installed.  I assume that you did the right
ifconfig commands to setup your slip-device (for example sl0).

1. Create a group called slip.

2. Create a user slip with smit like this:
                                                     [Entry Fields]
* User NAME                                          [slip]
  ADMINISTRATIVE User?                                true
  User ID                                            []
  LOGIN user?                                         true
  PRIMARY group                                      [slip]
  Group SET                                          [slip]
  ADMINISTRATIVE groups                              [system]
  SU groups                                          [slip]
  HOME directory                                     [/home/slip]
  Initial PROGRAM                                    [/bin/sh]
  User INFORMATION                                   [SLIP-Dialup]
  Another user can SU to user?                        false
  User can RLOGIN?                                    true
  TRUSTED PATH?                                       nosak
  Valid TTYs                                         [/dev/tty1]
  AUDIT classes                                      []
  PRIMARY authentication method                      [SYSTEM]
  SECONDARY authentication method                    [NONE]
  Max FILE size                                      [2097151]
  Max CPU time                                       [-1]
  Max DATA segment                                   [262144]
  Max STACK size                                     [65536]
  Max CORE file size                                 [2048]
  Max physical MEMORY                                [65536]
  File creation UMASK                                [022]
  EXPIRATION date (MMDDhhmmyy)                       [0]

3. Create a tty with getty on it:
                                   Add a TTY
                                               [Entry Fields]
  TTY type                                     tty
  TTY interface                                rs232
  Description                                  Asynchronous Terminal
  Parent adapter                               sa0
* PORT number                                  [s1]
  BAUD rate                                    [38400]
  PARITY                                       [none]
  BITS per character                           [8]
  Number of STOP BITS                          [1]
  TERMINAL type                                [dumb]
  STATE to be configured at boot time          [available]
  DMA                                          on
  Read Trigger                                 0,1,2,3
  Transmit buffer count                        [16]
  Name of initial program to run               [/etc/getty]

  Note: The following attributes are only applicable if /etc/getty is
        specified as the initial program to run.

  Enable program?                              respawn
  Run level                                    2
  Enable LOGIN                                 share
  TIME before advancing to next port setting   [0]
  STTY attributes for RUN TIME                 [hupcl,cread,brkint>
  STTY attributes for LOGIN                    [hupcl,cread,echoe,>
  RUN shell activity manager                   no
  Optional LOGGER name                         []

4. Change the hardware characteristics so that it uses NO XON/XOFF handshake
   section 1.613 also talks about tty flow control.

5. A (new) .profile template for slip accounts is provided in section
   8.07.  The author, David Migliavacca, writes, "I would also like to
   assert that, to my experience, it is NOT required that the SLIP user
   be made "administrative" or member of "system" as other parts of the
   FAQ (and the original script) say.  At least on my machine 8-).  I now
   create SLIP users as members of group slip, it being the ONLY group;
   allowed ttys are set to the available modem lines only; their home
   directory is owned by root and the .profile is only readable by group
   slip.

Here's another scenario:
From: oosten@angelo.ee.ualberta.ca (Brian Oostenbrink)

Operating System: IBM AIX 3.2.1 and 3.2.3

Configuring two RS6000s via a Serial Line Interface Protocol (SLIP) 
connection over two US Robotics Sportster 14,400 modems.

The AIX implementation of SLIP is slightly different from most others. 
The ifconfig command is used to bring up a serial interface, and the
slattach command is used to connect the interface to the serial port
used for the connection.  Dialer device commands can also be issued when
invoking the slattach command, using UUCP chat syntax.

The following describes a connection between two machines:

     local.j.k.l
         ethernet IP address 129.128.127.21
         slip interface IP address 129.1.2.1

     remote.a.b.c
         ethernet IP address 129.11.22.44
         slip interface address 129.11.22.1

1. Interface configuration

Each machine must have a separate IP address dedicated to the SLIP
interface. On remote.j.k.l, start the SLIP interface with:

         ifconfig sl0 129.11.22.1 129.128.127.1  up

and on local.a.b.c:

         ifconfig sl0 129.128.127.1 129.11.22.1  up

It is important in later versions of AIX 3.2.3+ to use the same SLIP
interface # as the ptty port #, ie. if you use tty12, use ifconfig sl12
instead of sl0.

At this point the interfaces are ready to be connected.

2. tty configuration
   The tty ports on both machines were configured in an identical manner
   using smit.
                                                 [Entry Fields]
 TTY type                                           tty
 TTY interface                                      rs232
 Description                                        Asynchronous Terminal
 Parent adapter                                     sa0
 PORT number                                        []                       +
 BAUD rate                                          [38400]                  +
 PARITY                                             [none]                   +
 BITS per character                                 [8]                      +
 Number of STOP BITS                                [1]                      +
 TERMINAL type                                      [dumb]
 STATE to be configured at boot time                [available]              +
 DMA                                                on                       +
 Read Trigger                                       0,1,2,3
 Transmit buffer count                              [16]                      #
 Name of initial program to run                     [etc/getty]

 Note: The following attributes are only applicable if /etc/getty is specified
 as the initial program to run.

 Enable program?                                    respawn
 Run level                                          2
 Enable LOGIN                                       disable                  +
 TIME before advancing to next port setting         [0]                      +#
 STTY attributes for RUN TIME                       [hupcl,cread,brkint,icr>
 STTY attributes for LOGIN                          [hupcl,cread,echoe,cs8,>
 RUN shell activity manager                         no                       +
 Optional LOGGER name                               []

On older versions of AIX, we encountered some problems disabling getty, and
resorted to changing the /etc/inittab file directly. For example, change

   tty0:2:respawn:/etc/getty /dev/tty0
to
   tty0:2:off:/etc/getty /dev/tty0

This will disable getty from running. After creating the SLIP tty device,
you will need to change its hardware configuration to disable Xon/Xoff
flow control. Software flow control should not be used for SLIP. Type
'smit chtty', and then select sub item 2: Hardware settings.

Most of the parameters in the tty configuration are the defaults.

3. Modem Configuration

   The modems were configured as follows:

   RTS/CTS flow control enabled.
   Xon/Xoff software flow control disabled. Usually this is automatic if
      RTS/CTS is enabled.
   Data rate, terminal to modem = fixed.
      This is the baud rate from the tty port to the modem. We used a
      fixed modem-port transfer rate, set to the fastest speed supported
      by both the tty port and the modem. Newer modems can use a higher
      transfer rate between the modem and serial port than the modem to
      modem rate, which is necessary to use data compression effectively.  
      In our setup, we used 14.4 kBaud modems with a port speed of 38.4
      kBaud. If your modem supports this feature, use it, otherwise set
      the port speed equal to the modem connection rate. On the USR
      Sportster at&b1 fixes the serial port rate to that of the last
      AT command. The speed parameter of the slattach command can be
      used to ensure that this rate is that set in the tty configuration.
   Error Correction enabled - not mandatory, but a good idea
   Data Compression - not required, but it helps, especially for text
      transfers.
   Auto Answer - If the SLIP connection is to be initiated from either
      machine, both modems should be set to auto answer, otherwise, just
      the answering modem.

   It is a good idea to configure the modem and then save the settings
   to NVRAM, so that the correct settings can always be restored by the
   slattach command.

4. UUCP configuration files

   /usr/lib/uucp/Devices
   /usr/lib/uucp/Dialers

   The Devices file must contain an entry with the tty and serial port
   speed used for the interface. In our example,
      Direct tty0 38400 slipdialer

   The keyword 'slipdialer' is merely an index into the Dialers file.
   For our purposes, the slipdialer entry in the Dialers file is simply:

      slipdialer

   This entry can also contain UUCP chat commands, or the chat commands
   can be included in the slattach command.

5. slattach invocation

   slattach connects the device on the tty port to the SLIP interface
   created by ifconfig, and sends any commands to the tty device if
   needed. For our example, remote.j.k.l would never initiate a call,
   only answer incoming calls. Therefore we execute:

         slattach tty0 38400 '"" ATZ OK ""'

   which connects the tty at 38400 baud. We could also simply run

         slattach tty0

   ie. without any modem commands, but the modem to port speed may not
   be correctly set this way. In addition, the ATZ command ensures the
   modem is set to the NVRAM settings.

   On local.a.b.c type:

         slattach tty0 38400 '"" ATZ OK \pATDT4925871 BIS ""' 4

   This establishes the link at 38400 baud, and executes the dial string
   as shown. The dial string is a UUCP chat string and are configured
   in an expect send expect send ... format. The string:

         '"" ATZ OK \pATDT4925871 BIS ""'

   is interpreted as:
   expect "" (null string) from modem
   send   ATZ              to modem
   expect OK               from modem
   send   \pATDT4925871    to modem
   expect BIS              from modem

   BIS is the end of the CONNECT STRING. You could use any portion of
   the string returned by the modem upon a connection as the expect
   string. It may be wiser to simply expect CONNECT since all
   connections should return this string.
   The null strings are necessary because the first parameter of the
   UUCP is an expected string from the modem, which can only be a null
   string until the modem has been given a command.

   The last parameter (4) of the slattach command is the debug level. 
   A debug level of 4 displays the UUCP chat strings, which is useful
   for checking the modem status.

6. Routing
   ifconfig is sufficient if all you want to do is talk between the
   two hosts.  If you are running SLIP so that you can talk to more
   than just that one other host you have to advertise your address.
   
   1) arp -s 802.5 iago 10:00:5a:b1:49:d8 pub
        where 802.5 is a token-ring network the hardware address can
        be obtained with `netstat -v` and iago was the SLIP client (My
        PC at home :)  pub is the important part it means "published"
        You may want to run this at boot time. 

   Routing through the SLIP link is similiar to routing of any gateway. 
   Invoking the ifconfig command automatically sets up a route between
   the two SLIP machines. An entry in /etc/hosts or the named database
   should be made, with the same machine name used for the SLIP address
   as the ethernet address on each machine. For example, in /etc/hosts
   on remote.a.b.c (and any other machine on remote.a.b.c ethernet):

     129.11.22.44 remote.a.b.c # ethernet address
     129.11.22.1  remote.a.b.c # slip address

   It is preferable to place the ethernet address in the hosts file
   before the SLIP address so remote.a.b.c will resolve to the
   ethernet address. When using named, it is important to have both
   addresses in the reverse file with the same name. We experienced
   difficulties with NFS mounting over the slip link, owing to some
   machine interpreting NFS requests from one of the two SLIP machines
   as coming from the SLIP address, while the SLIP machine believed it
   was sending the request from the ethernet address. This problem was
   eliminated by having both addresses reverse resolve to the same name.

7. Performance
   At a modem speed of 14.4 kBaud and a port speed of 38.4 kBaud, we
   realized a transfer rate through ftp of about 3.5 kB/s for text
   files, and 1.3 kB/s for compressed files.

------------------------------

1.607: Where is DCE discussed?

DCE is the Distributed Computing Environment, which is roughly a
flexible client-server architecture for heterogenous platforms.
For more information, take a look in comp.soft-sys.dce.


------------------------------

1.608: How do I make /var/spool/mail mountable?
From: petersen@pi1.physik.uni-stuttgart.de (Joerg Petersen)

In our cluster we share a /usr/local disk. We have a directory
/usr/local/spool/mail and /var/spool/mail is soft-linked to it.

From: fred@hal6000.thp.Uni-Duisburg.DE (Fred Hucht)

Several problems has been reported on sharing the mail directory via
NFS. The problems may occur when two or more sendmail daemons and/or
mail readers access a user's mail file simultanously, because of NFS'
file locking mechanism.

We use another method here: Every user has one line in his/her
$HOME/.forward file that reads

xxx@mainserver.domain.name

where xxx is the user node and mainserver.domain.name is the full
hostname of one of the machines. Then all incoming mail to all machines
is forwarded to mainserver, while mainserver ignores this line.


1.609: getty spawning too rapidly 
From: aslam@abaseen.lums.edu.pk (Sohail Aslam)

The problem can occur due a number of modem settings. The most
frequent is that the echo is not disabled on modems that are to
accept incoming calls. In hayes language, ATE0 disables echo.
If echo is enabled, the login prompt sent by the DTE (computer)
is echoed back to it. It then issues "password:" prompt which
the modem conveniently echoes back again. And the cycle goes on.

Another setting to check is the Q registers which controls the
modem's response to the DTE. The hayes command ATQ0 enables
results codes. The Q register in conjunction with the X and
the V registers, reports back to the DTE the status of the incoming
or outgoing call, and the type of connection established. For
outgoing calls, one would want to enable result codes but not
for incoming calls. If codes are enabled (via ATQ0), when a
call comes in, the modem will send strings (if ATV1 and ATX4 set)
"RINGING", "CONNECTED" etc. to the local DTE. The getty will think
some one is trying to login. It will send password prompt. Trouble
again. Telebit and other intelligent modems has ATQ2 setting
which says "reports codes only when calling out." For others,
you will need to disable it (ATQ1) and enable when calling out.

The DSR setting can be a source of problem. Ideally, modem should
raise DSR only when CD is detected and modem raises CTS. Computer,
such as the VAX, wait 30 seconds after the modem raises DSR. If
CD is not on by that time, the computer will drop DTR causing the
modem to reset. The DSR should be set to be raised only when
carrier has been detected. The hayes setting is AT&S1.

The DCD setting should be such that it reflects the true nature of
the carrier. The CD can be forced on at all times (AT&C0). This
is not good. Set it to AT&C1.

Most modems can reload saved settings from non-volatile memory
on a DTR transition. This is useful for resetting the modem
when a call drops. Use AT&D3 to get this effect. 

For dial in, thus, set AT E0 Q1 &C1 &D3 &S1 &W. The &W stores the
settings in memory. They will be reloaded due to &D3.


------------------------------

1.610: Does AIX support Compressed SLIP (CSLIP)?

No.  That means no VJ compression either :)  See PPP in section 5.07 
if you want more than standard SLIP.


------------------------------
1.611: How do I setup anonymous ftp on my AIX system?

(stolen from Peter Klee <klee@dhdibm1.bitnet> posting)

Have a look at '/usr/lpp/tcpip/samples/anon.ftp'. It is a shell script
and will set up a anonymous ftp site on your local RS/6000.  Note: the
ftpd that comes with AIX does not support the display messages every
time a user changes a directory or even when they login.

------------------------------

1.612: Talk, getting notification.

If you are not getting notification (that someone wants to talk to
you), use (swcons `tty` && mesg y) in one window.

There are many variations of 'talk' and finding compatible versions
for multiple operating systems can be tricky.


------------------------------

1.613: Disabling software flow control; using RTS/CTS.

Different versions of AIX 3.2.5 respond differently to attempts to
enable flow control (RTS/CTS signals).  This section is an attempt to
compile a list of different approaches.

The most straight forward is:
   chdev -l ttyxx -a rts=yes
   [ Note: ix40410 for AIX 3.2.5 should give you this functionality.  
   PTF U426113 and numerous other superceding ptfs should provide this.]

If carrier signal is high (its connected) you can try
   stty add rts </dev/ttyxx 

There is also a program that I first saw on the 800-IBM-4FAX number,
also found in INFO that will remedy the situation in some cases.  Note
that this code ignores the return code from ioctl (which on my machine
is <0 :)

------------------------------

1.614: NIS security
Ole.H.Nielsen@fysik.dtu.dk (Ole Holm Nielsen)

SUMMARY: AIX 3.2.4 and above includes support for a more secure setup
of the ypserv NIS daemon.  You can prevent any random host on the
entire Internet from reading your NIS maps, as is possible with the
default AIX setup.
 
The details:
------------
After starting the ypserv daemon, I noticed in the syslog the following line:
Jan 17 12:01:18 zeise syslog: /usr/etc/ypserv: no /var/yp/securenets file 
This indicates that ypserv is looking for the mentioned configuration
file, but did not find it, and hence will deliver the NIS maps to
anyone on the net who can guess the NIS domainname.  I installed the
/var/yp/securenets file and restarted ypserv, and it works !  Any
illegal attempt to read NIS maps will result in the following getting
logged to syslog (example):
Jan 18 13:37:27 zeise syslog: ypserv: access denied for 129.142.6.79 

How to enable this NIS security option:  
Install the /var/yp/securenets file, for example:

# /var/yp/securenets file
#
# The format of this file is one of more lines of
# netmask netaddr
# Both netmask and netaddr must be dotted quads.
#
# Note that for a machine with two Ethernet interfaces (i.e. a gateway
# machine), the IP addresses of both have to be in /var/yp/securenets.
#
# for example:
#255.255.255.0 128.185.124.00
# Loopback interface
255.255.255.255 127.0.0.1

Uncommenting the last line would limit access to hosts on the
128.185.124.*  net, only.  The loopback interface must be included, as
shown above.

To log violations, have a /etc/syslog.conf file containing the proper
events.  We use this line:

*.err;kern.debug;auth.notice;user.none          /var/adm/messages

Caveat emptor:  This works for us, and you will have to verify it at
your own installation.  Don't complain to us if you have troubles.  
I do not know what PTF level our AIX 3.2.4 is at.  Our ypserv daemon 
looks like this:

zeise> strings /usr/lib/netsvc/yp/ypserv | head -2
@(#)16
1.12  com/cmd/usr.etc/yp/ypserv.c, cmdnfs, nfs325, 9334325a 5/4/93 19:44:41

If your AIX doesn't have securenets support, ask your support centre
for the PTF which includes APAR IX32328.  That seems to have included
the securenets support.


------------------------------

1.615: Why can't non-anonymous users login using WU-FTP?
From: swcxt@boco.co.gov (Shane Castle)

You must create a file named /etc/shells (this is the real /etc not a
subdirectory of your false root), that contains all the shells that
are defined on your system.  Get the list from
/etc/security/login.cfg.  Also, if having proper group authentication
is important to you, apply the following patch:

--- ftpd.c.dist	Wed Apr 13 15:17:18 1994
+++ ftpd.c	Tue Jan 17 13:29:58 1995
@@ -1153,7 +1153,13 @@
        setgroups(NULL, NULL);
        if (setpriv(PRIV_SET|PRIV_INHERITED|PRIV_EFFECTIVE|PRIV_BEQUEATH,
                    &priv, sizeof(priv_t)) < 0 ||
-           setuidx(ID_REAL|ID_EFFECTIVE, (uid_t)pw->pw_uid) < 0 ||
+           initgroups(pw->pw_name, (gid_t)pw->pw_gid) < 0 ||
+           setgidx(ID_REAL|ID_EFFECTIVE, (gid_t)pw->pw_gid) < 0 ||
+           setegid((gid_t)pw->pw_gid) < 0) {
+               reply(550, "Can't set gid (AIX3).");
+               goto bad;
+       }
+       if (setuidx(ID_REAL|ID_EFFECTIVE, (uid_t)pw->pw_uid) < 0 ||
            seteuid((uid_t)pw->pw_uid) < 0) {
                reply(550, "Can't set uid (AIX3).");
                goto bad;

------------------------------

1.616: NIS users can't login, do I need '*' in /etc/passwd?
From: ohnielse@fysik.dtu.dk (Ole Holm Nielsen)

Aparently at least one version of AIX InfoExplorer suggests
administrators use "+:*:0:0:::" as the last entry in the /etc/passwd
file of NIS clients for security reasons.  If the configuration SMIT
is done using SMIT it will actually append "+::0:0:::" which works and
does not compromise security.  Using the '*' in the passwd field
actaully prevents NIS users from logging in.

"+::0:0:::" should not allow you to login as user "+" and without a
password even when NIS is disabled, but it never hurts to double
check.

------------------------------
1.617: HP JetDirect cards and virtual printers?  mkvirprt problems?

(stolen from many)

Since the release of AIX 3.2.5 adding a queue for JetDirect cards is as
easy as creating a virtual printer using "smit mkvirprt" or mkvirprt.
If the command hangs make sure you are using an HFT, aixterm or vt100
terminal.  The entire procedure is available from the IBM FAX
"Information Line" (800 IBM-4-FAX).

From: Mark Bergman <mark.bergman@syseca.co.uk>

SMIT complains that some required software is not present on the system.
It turns out that this software, "printers.hpJetDirect.attach (4.1.3.0)"
is on the installation CD.

HOWEVER, there is some bug somewhere, whereby the software may actually
be already installed, but the system cannot see it.  (Or maybe the bug
is that the software is actually NOT installed, but the system in one
place thinks it is! - I'm not sure).  Therefore, use smit to look at
Installed Software ("Software Installation and Maintenance", "Maintain
Installed Software", "List Installed Software" and look at all software,
then search through for "jet".  If it finds it (i.e. it thinks that it
is installed) - you must remove it (under smit's "Maintain Installed
Software" level), and then reinstall from the CD!

------------------------------

1.618: How can I hack libc.a to alter how hostnames are resolved?
From: <mlarsen@ptdcs2.intel.com> "L. Mark Larsen"

[ 
  Editors note:  The implications of corrupting libc.a should not be
  understated.  While recovering from a corrupt libc.a should be a
  matter of booting from floppy I wouldn't wish that on anyone with a 
  supervisor or users to support :)

  Before you attempt this,  you might want to read 2.07 first for
  advice on recovering from a destroyed or corrupted libc.a.
  Remember:  backups are a VERY GOOD IDEA.

  enough of the weak kneed quivering...
]

Nate Itkin (a colleague) is the individual who did the initial work.
I suspect he would rather not be troubled with any questions you may
have in this area and I can probably answer them just as easily.  The
motivation for this was to use DNS for MX records (we are using IDA
sendmail) but NIS for most hostname lookups.

Secondly, warnings:  IBM has not given any sort of stamp of approval on what
we have done (though they appear to have integrated resolv+ into AIX 4 based
on some release notes I saw).  While we have been using it successfully for
about one year and have seen no problems, we can't and won't promise the same
for you.  This procedure plays around with libc.a which, as you probably know,
is an XCOFF shared library under AIX and hence a critical part of the running
system.  You assume all the risk if you try to install this.  All the usual
disclaimers about liability, etc. apply - there is no warranty associated with
any of this.

Furthermore, know that any PTF you subsequently install that updates/replaces
libc.a implies that you have to execute most of these procedures again.

The details on how to use resolv+ under AIX 3 (it's only tested under
3.2.5 but should work for all point releases), have been moved to
section 8.09.

------------------------------

1.619: What modem settings do I need?

ATQ2  - result codes in originate only
AT&C1 - CD follows state of carrier 
AT&D2 - hangup on DTR drop


------------------------------
1.620: NIS slave server config with master on different subnet?
From: msidler@metronet.com (Mike Sidler)

Assuming AIX 3.2.5,the master server up and running and the hosts file
has the master name defined. On slave do:

    1) domainname <domain_name that matches master>
    2) startsrv -s ypserv
    3) startsrv -s ypbind (ypwhich should return "loopback")
    4) (/usr/sbin/)ypset -d <domainname> <master_server_name>
       (ypwhich should return "<master_server_name>"
    5) (/usr/sbin/)ypinit -s <master_server_name>
    6) Put "+::0:0:::" in /etc/passwd after last local login. 
       Note: InfoExplorer has this entry INCORRECT in some versions.
    7) Other cfg files (group, etc) may need configuring but this will
       get ypserv and ypbind running on the slave looking at the right stuff.


------------------------------

1.621: Why does my 64 port concentrator loose data and drop the queue?
[From: as@mynet.no (Arild Sletvold)]

This problem has been associated with upgrading machines to 3.2.5.
Try changing the values for the "Transmit buffer count" parameter in
the printer/plotter setup in smit. You need to experiment with this
parameter, to see which value that makes the printer print as fast as
possible.  If the value is too high, the printers will loose some of
the data, and the queue will be disabled.  If the value is too low,
the printers will print very slowly.

------------------------------

1.622: Netscape FastTrack server won't install on AIX 3.2.5 or 4.1.
From: Cameron Ferstat <cferstat@austin.ibm.com>

Before installing FastTrack on an AIX 3.2.5 or 4.1 system, you must 
first install the AIX Shared Library Hookable Symbols/6000 Version 
1.1.5.0, Reference RPQ No. P91153.  (Note:  This software should *not*
be installed on an AIX 4.2 system!)

If you try to install FastTrack on an AIX 3.2.5 or 4.1 system, without 
first installing the Hookable Symbols PRPQ, you will get the following 
error:

   > ./ns-setup
     0509-037 System error - error data is: ./ns-setup
     0509-022 Cannot load library libsvld.a[shr.o].
     0509-026 System error: A file or directory in the path name does not exist.

You can download the installp image by anonymous ftp from
<ftp://ftp.software.ibm.com/aix/products/netscape/tools/slhs.rte.inst_image>.

There is also an associated README.slhs file in that directory.

------------------------------

1.623: How can I share files/printers with Windows 95?

The freeware solution is Samba,  available from <http://www-frec.bull.com/>.

Commercial solutions include Fusion95 from Performance Technology
<http://www.perftech.com/> and Syntax <http://www.syntax.com/>.

------------------------------

1.624: Printing from AIX to WinNT/95/3.1
From: Charles J. Fisher <charles_fisher@bigfoot.com>

1. On your Windows system, share the printer. Assuming that you are
   running NT, make a user "root" with some password.

2. Get the Samba distribution from http://www.samba.org
   If you have a C compiler, get the source and compile it.
   If you don't have a C compiler, get a binary distribution for AIX.

3. Install Samba on AIX under /usr/local/samba. Specifically, make sure
   that /usr/local/samba/bin/smbclient is installed with execute rights
   for everyone.

4. You must also install a Samba configuration file under
   /usr/local/samba/lib/smb.conf

   If you intend to use your AIX as a file server for windows clients,
   you should modify smb.conf to accomplish this (see the Samba
   documentation).

   If you will be printing only, just use the sample smb.conf.

5. Make the directory /usr/local/samba/lib/printers

6. In that directory, install the following shell script as
   file "winprint":

#!/bin/sh

# This is a modification of the samba provided smbprint script
# changed to work under AIX as the backend for a queue. It does
# not read a config file.
#
# Variables below define the server and service. They are
# the content of the .config file when printing from
# /etc/printcap.
#
server="winserver"
service="winprinter"
user="root"
password="root"
#
# Debugging log file, change to /dev/null if you like.
#
#logfile=/tmp/${USER}-print.log
#
# Some debugging help, change the >> to > if you want to save space.
#
#echo "server $server, service $service" >> $logfile
#cat $1 | /usr/local/samba/bin/smbclient "\\\\$server\\$service" 
$password \
#       -N -P -c 'print -' >> $logfile

(
# NOTE You may wish to add the line `echo translate' if you want automatic
# CR/LF translation when printing.
        echo translate
        echo "print -"
        cat $*
) | /usr/local/samba/bin/smbclient "\\\\$server\\$service" $password \
	-U "$user" -N -P  > /dev/null

7. The above file assumes that you are using \\winserver\winprinter
   as the printer share, and that the user is "root" and the password
   is "root". If this is not the case, modify the shell variable
   declarations.

8. Mark the file with execute permissions with "chmod 755 winprint"

9. Test the script with the command: "./winprint /etc/passwd"
   If everything is ok, your password file should be spooled to your
   windows printer.

   If it doesn't work, remove the "> /dev/null" from the last line of
   the script and rerun it. Examine the output of smbclient for clues.

   Clue #1: The Windows printer server is on the other side of a router.
            AIX is sending broadcast packets to find the Windows machine,
            which the router will not forward. You must find the Windows
            server's IP address and specify it with the "-I" parameter
            to smbclient, i.e. "-I 1.2.3.4". DHCP makes this situation
            even more complex.

   Clue #2: You username or password is wrong. smbclient will tell you
            about this if you free its output from > /dev/null.

   Clue #3: You might be violating shell quoting rules if you use
            special characters in the server or share name, password,
            etc. Don't use $, ", ', etc., or escape them properly.
            A password of ";rm -rf /" could be catastrophic.

10. Once the script can print files, it must be defined as a printer in
    the /etc/qconfig file. Add the following lines to the end of your
    /etc/qconfig:

winprint:
        device = dwinprint
        up = TRUE
        discipline = sjn
dwinprint:
        backend = /usr/local/samba/lib/printers/winprint

11. Test the printer with the following command:
    "lp -d winprint /etc/passwd"
    (Your password file should be printed again.)

12. You might examine the queue with the command "lpq -P winprint"
    or "lpstat -t"

------------------------------

1.625: How do I get NFS mounting with Linux to work?

Linux by default requires any NFS mount to use a so called reserved port
below 1024 and AIX 4.3 does by default use ports above 1024. You can use
the nfso command to restrict AIX to the reserved port range as follows:

	nfso -o nfs_use_reserved_ports=1

------------------------------

1.626: Telnet takes a 45 seconds to produce a prompt.

This is in nearly all cases a DNS configuration problem, the AIX machine
can not resolve the IP address of the node initiating the telnet
connection. You can check the DNS reverse mapping by using the nslookup
command on the IP number in question, this will probably timeout as
well. Make sure that the nameserver lines in the /etc/resolv.conf file
point to valid name servers. Some folks have reported that putting the
following in /etc/netsvc.conf can help as well (see also Subject:
1.800):

	hosts=local,bind4

------------------------------

1.700: Free LVM lecture slides.
From: shieh@austin.ibm.com

If you want free LVM documentation (lecture notes) from the
SHARE conference in San Franciso where I presented last March
just:
 
 mail -s "S_basics.ps" shieh@austin.ibm.com < /dev/null
 mail -s "S_limits.ps" shieh@austin.ibm.com < /dev/null
 mail -s "S_lvm_extra.ps" shieh@austin.ibm.com < /dev/null

[Editor's note: Jens-Uwe Mager converted the slides to PDF format.  They
are available as <http://www.han.de/~jum/aix/lvm.pdf>.]

------------------------------

1.701: How do I shrink /usr?
From: mike@bria.UUCP (Michael Stefanik) and Richard Hasting

FOR AIX 3.1
-----------

 1) Make a backup of /usr

        find /usr -print | backup -ivf /dev/rmt0 (or appropriate device)

 2) shutdown to maintenance mode

        shutdown -Fm
 
 3) export LANG=C
 
 4) remove the filesystem and the logical volume
    ignore an error about the "dspmsg" command not found

        umount /usr
        rmfs /usr

 5) make a new logical volume hd2 and place it on rootvg with desired size

        mklv -yhd2 -a'e' rootvg NNN 

   where NNN is the number of 4 meg partitions

 6) create a filesystem on /dev/hd2

        crfs -vjfs -dhd2 -m'/usr' -Ayes -p'rw'

 7) mount the new /usr filesystem and check it

        /etc/mount /usr
        df -v

 8) restore from the tape; system won't reboot otherwise

        restore -xvf/dev/rmt0

 9) Sync and reboot the system; you now have a smaller /usr filesystem

FOR AIX 3.2
-----------

 0)  Experiences posted to comp.unix.aix lead me to suggest that
     many administrators find the following piece of information 
     useful after completing this procedure.  I thought some of you
     might like to read it BEFORE getting yourself into this
     predicament.  

     Call 1-800-IBM-4FAX and request document 2503 dated 1/26/94.  
     Title is "How to recover if all files are owned by root after
     restoration from a mksysb tape".

 1) Remove any unneeded files from /usr.

 2) Make sure all filesystems in the root volume group are mounted. If
    not, they will not be included in the re-installed system.

 3) Type mkszfile. This will create /.fs.size that contains a list of
    the active filesystems in the root volume group that will be
    included in the installation procedure.

 4) Edit .fs.size. Change the size of /usr to what you want.

    Example: This .fs.size file shows /usr to be 40MB.

	rootvg 4 hd2 /usr 10 40 jfs

    The 10 is the number of physical partitions for the filesystem and
    the 40 is 40 MB. Most systems have a physical partition size of 4 MB.
    Therefore, the second number (40) will always be 4 times the
    previous number (10). Note, however, that a model 320 with a 120 MB
    drive will have a physical partition size of only 2 MB, and the
    total MB is twice the number of physical partitions. The first
    number (4) in the .fs.size file represents the PP size.

    If you want to reduce the size of /usr from 40 MB to 32 MB, edit the
    /usr entry to:

        rootvg 4 hd2 /usr 8 32 jfs

    IMPORTANT: Make sure that you DO NOT enter a value which is less
    than the size of the filesystem required to contain the current
    data. Doing so will cause the re-installation procedure to fail.

 5) chdev -l rmt0 -a block=512 -T

 6) Unmount all filesystems that are NOT in the root volume group.
 
 7) Varyoff all user-defined volume groups, if any

        varyoffvg VGname

 8) Export the user-defined volume groups, if any

        exportvg VGname

 9) With a tape in the tape drive, type

        mksysb /dev/rmt0

     This will do a complete system backup, which will include
     information (in the .fs.size file) for the installation procedure
     on how large the filesystems are to be created.

 10) Follow the instructions in the Installation Kit under "How to
     Install and perform maintenance from Diskettes" (reportedly now 
     called "BOS Installation from a System Backup") using the
     diskettes and tape that you created in the previous steps.

     [ pre AIX 325: DO NOT select the option "Reinstall AIX with
     Current System Settings". Instead use "Install AIX with Current
     System Settings" for the logical volume size changes to take affect. ]

     [ w/ AIX 325: Select "Install from a mksysb image" ]

 11) When the installation is complete, you may then import any
     user-defined volume groups.

         importvg -y VGname PVname

     where "VGname" is the name of the volume group, and "PVname" is
     the name of any one of the physical volumes in the volume group.

 12) Varyon your user-defined volume groups

         varyonvg VGname

 The reduction of the filesystems is now complete.

COMMERCIAL OPTION
-----------------
There are also commercial tools availible to help you do this more
conviently.  I know of one vendor that can be reached at info@compunix.com

------------------------------

1.702: How do I make a filesystem larger than 2Gb?

AIX 3.2.5 and preceeding versions are limited to 2 Gigabytes per
filesystem.

With AIX 4.1 IBM allows filesystems up to 64Gb (reference:
Individual files are still limited to 2Gb.  AIX 4.2 allows 128Gb
filesystems and 64 Gb files.  (See also question 1.706.)

If you are having trouble creating a file greater than 1Mb it maybe
because that is the default limit for your account, see 'smit users'
or /etc/security/limit.

------------------------------

1.703: Chlv warning.  Is the first 4k of a LV safe?

The first 4k of a raw LV are used to store control block.
Applications that write to the raw disk can overwrite this section
(common applications that do this are Oracle and Sybase).  Commands
that call getlvcb will generate a warning but succeed (since the
control block exists in ODM.  Don't run synclvodm unless you really
want to erase the first 4k and replace it with the info from the ODM.

shieh@austin.ibm.com (Johnny Shieh) has kindly provided the following
explanation:

The logical volume control block (lvcb) is the first 512
bytes of a logical volume.  This area holds important
information such as the creation date of the logical volume,
information about mirrored copies, and possible mount points
in a journaled filesystem.  Certain LVM commands are required
to update the lvcb, as part of completeness algorithms in
LVM.  The old lvcb area is first read and analyzed to see if
it is a valid lvcb.  If the information is verified as valid
lvcb information, then the lvcb is updated.  If the
information is not valid, then the lvcb update is not
performed and the user is given the warning message:

	Warning, cannot write lv control block data

Most of the time, this is a result of database programs
accessing the raw logical volumes (and thus bypassing the
journaled filesystem) as storage media.  When this occurs, the
information for the database is literally written over the lvcb.
Although this may seem fatal, it is not the case.  Once the
lvcb has been overwritten, the user can still:

	1) Extend a logical volume
	2) Create mirrored copies of a logical volume
	3) Remove the logical volume
	4) Create a journaled filesystem with which to mount
		the logical volume (note that this will destroy any
		data sitting in the lvcb area)

However, there is a limitation caused by this deletion of the
lvcb.  The logical volumes with deleted lvcb's face possible,
incomplete importation into other AIX systems.  During an
"importvg", the LVM command will scan the lvcb's of all defined
logical volumes in a volume group for information concerning the
logical volumes.  Surprisingly, if the lvcb is deleted, the
imported volume group will still define the logical volume to
the new AIX system which is accessing this volume group, and
the user can still access the raw logical volume.  However, any
journaled filesystem information is lost and the logical volume
and its associated mount point won't be imported into the new AIX
system.  The user must create new mount points and the availability
of previous data stored in the filesystem is NOT assured.  Also, during
this import of a logical volume with an erased LVCB, some non-jfs
information concerning the logical volume, which is displayed with
the "lslv" command, cannot be found.  When this occurs, the system uses
default logical volume information to populate the logical volume's
ODM information.  Thus, some output from the "lslv" will be inconsistent
with the real logical volume.  If logical volume copies still exist on
the original disks, this information will not be correctly reflected in
the ODM database.  The user should use "rmlvcopy" and "mklvcopy" to
rebuild any logical volume copies and synchronize the ODM.  Finally,
with an erased lvcb, the output from the "lslv" command might be
misleading or unreliable.


------------------------------

1.704: What's the limit on Physical Partitions Per Volume Group?
From: shieh@austin.ibm.com (Johnny Shieh)

1016 Physical Partitions Per Disk in a Volume Group:

     In the design of LVM, each Logical Partition
maps to one Physical Partition.  And, each Physical
Partition maps to a number of disk sectors.  The design
of LVM limits the number of Physical Partitions that LVM
can track PER DISK in a volume group to 1016.  In most cases,
not all the possible 1016 tracking partitions are used by a disk.
The default size of each Physical Partition during a
"mkvg" command is 4 MB, which implies that individual
disks up to 4 GB can be included into a volume group.

     If a disk larger than 4 GB is added to a volume
group (based on usage of the default 4 MB size for
Physical Partition) the disk addition will fail with a
warning message that the Physical Partition size needs
to be increased.*  There are two instances where this
limitation will be enforced.  The first case is when the
user tries to use "mkvg" to create a volume group where
the number of physical partitions on one of the disks in
the volume group would exceed 1016.  In this case, the
user must pick from the available Physical Partition ranges of:

1, 2, (4), 8, 16, 32, 64, 128, 256

Megabytes and use the "-s" option to "mkvg".  The second
case is where the disk which violates the 1016 limitation
is attempting to join a pre-existing volume group with
the "extendvg" command.  The user can either recreate the
volume group with a larger Physical Partition size (which
will allow the new disk to work with the 1016 limitation)
or the user can create a standalone volume group (consisting
of a larger Physical Partition size) for the new disk.

     In AIX 4.1 and 3.2.5, if the install code detects
that the rootvg drive is larger than 4 GB, it will change
the "mkvg -s" value until the entire disk capacity can be
mapped to the available 1016 tracks.**  This install change
also implies that all other disks added to rootvg, regardless
of size, will also be defined at that new Physical Partitions size.

For RAID systems, the /dev/hdiskX name used by LVM in AIX may
really consist of many non-4GB disks.  In this case, the 1016
limitation still exists.  LVM is unaware of the size of the
individual disks that may really make up /dev/hdiskX.  LVM bases
the 1016 limitation on the AIX recognized size of /dev/hdiskX,
and not the real independent physical disks that make up /dev/hdiskX.

The questions asked of this issue are:
1) What are the symptoms of this problem?
2) How safe is my data?  What if I never use mirroring or migratepv?
3) Can I move this volume group between RS/6000 systems and versions
   of AIX?

Here are the answers:
A) What are the symptoms of this problem?
     The 1016 VGSA is used to track the "staleness of mirrors".
     If you are in violation of 1016, you may possibly get a false
     report of a non-mirrored logical volume being "stale" (which
     is an oxymoron) or you may get a false indication that one of
     the your mirror copies has gone stale.  Next, migratepv may
     fail because migratepv briefly uses mirroring to move a logical
     volume from one disk to another.  If the target logical
     partition is incorrectly considered "stale", then the migratepv
     cannot remove the source logical partition and the migratepv
     command will fail in the middle of migration.

B) How safe is my data?  What if I never use mirroring or migratepv?
     The data is as safe (in your mind) as the day before you found
     out about 1016 violations.  The only case where data may be
     lost is if one is mirroring a logical volume and ALL copies go
     bad at the same time and LVM isn't aware of it because the
     copies that go bad are beyond the 1016 tracking range.  However,
     in this case, you would lose data even if you were within the
     1016 range.  If you never mirror or use migratepv, then this
     issue shouldn't concern you.  But, it might be unwise to state
     you'll NEVER use either of those options.

C) Can I move this volume group between RS/6000 systems and versions
   of AIX?
     Yes you can.  The enforcement of this 1016 limit is only
     during mkvg and extendvg.  The "safeness" of the data on the
     volume group on AIX 3.2 is the same as it is on AIX 4.1.


* This bug was fixed in apar ix48926.  Current AIX 3.2.5 and
4.1.1, which do not have this fix on applied, will allow the
creation of volume groups with more than 1016 partitions.  The
implication of this bug allowing more than 1016 physical
partitions is that the user may access all portions of the logical
volume.  However during disk mirroring, the status of partitions
beyond the 1016 limit will not be tracked correctly.  If mirrors
beyond the 1016 range become "stale", LVM will not be aware of
their condition and data consistency may become an issue for
those partitions.  Additionally, the "migratepv" command creates
mirrors and deletes them as a method for moving logical volumes
around within/between disks.  If the 1016 limit is violated,
then the "migratepv" command may not behave correctly.
The user should pick up apar ix51754, which clarifies the error
message when this condition is detected.  Additionally, the user
can read the non-ptf documentation apar ix50874 which is a companion
to ix48926 and ix51754.

** This bug was fixed for AIX 3.2.5 rootvg install in apars
ix46862 and ix46863.  This bug does not exist in AIX 4.1.1.

------------------------------

1.705: Why am I having trouble adding another disk to my VG?
From: shieh@austin.ibm.com (Johnny Shieh)

In some instances, the user will experience a problem adding
a new disk to an existing volume group or in the creation of
a new volume group.  The warning message provided by LVM will
be:

	Not enough descriptor space left in this volume group.
	Either try adding a smaller PV or use another volume group.

On every disk in a volume group, there exists an area called the
Volume Group Descriptor Area (VGDA).  This space is what allows
the user to take a volume group to another AIX system and
"importvg" that volume group into that AIX system.  The VGDA
contains the names of disks that make up the volume group, their
physical sizes, partition mapping, logical volumes that exist in
the volume group, and other pertinent LVM management information.

When the user creates a volume group, the "mkvg" command
defaults to allowing the new volume group to have a maximum
of 32 disks in a volume group.  However, as bigger disks have
become more prevalent, this 32 disk limit is usually not
achieved because the space in the VGDA is used up faster, as
it accounts for the capacity on the bigger disks.  This
maximum VGDA space, for 32 disks, is a fixed size which is
part of the LVM design.  Large disks require more management
mapping space in the VGDA, which causes the number and size
of available disks to be added to the existing volume group
to shrink.  When a disk is added to a volume group, not only
does the new disk get a copy of the updated VGDA, but all
existing drives in the volume group must be able to accept
the new, updated VGDA.

The exception to this description of the maximum VGDA is
rootvg.  In order to provide AIX users more free space, when
rootvg is created, "mkvg" does not use the maximum limit of
32 disks that are allowed into a volume group.  Instead in
AIX 3.2, the number of disks picked in the install menu of
AIX is used as the reference number by "mkvg -d" during the
creation of rootvg.  For AIX 4.1, this "-d" number is 7 for
one disk and one more for each additional disk
picked. i.e. you pick two disks, the number is 8.  you pick
three disks, the number is 9, and so on.....  This limit does
not mean the user cannot add more disks to rootvg in the
post-install phase.  The amount of free space left in a VGDA,
and thus the number of size of the disks added to a volume
group, depends on the size and number of disks already
defined for a volume group.  However, this smaller size
during rootvg creation implies that the user will be able to
add fewer disks to rootvg than compared to a non-rootvg
volume group.

If the customer requires more VGDA space in the rootvg, then
they should use the "mksysb" and "migratepv" commands to
reconstruct and reorganize their rootvg (the only way to
change the "-d" limitation is recreation of the rootvg).

Note:  It is always strongly recommended that users do not place
user data onto rootvg disks.  This separation provides an extra
degree of system integrity.

------------------------------

1.706: What are the limits on a file, filesystem?

There are other limits but these come up most often.  Logical Volumes
do not _have_ to contain Journaled File Systems and therefore can be
larger than 2GB even in 3.2.5.

	File	jfs-Filesystem
3.2.5	2GB	2GB
4.1.x	2GB	64GB
4.2	64GB	128GB

While it *might* be possible to create larger file systems,  the limits
shown here represent values that IBM has supposedly tested.	

------------------------------

1.707:  Hints for Segate 9 GB and other disks larger than 4 GB? 

[read 1.704]


------------------------------

1.708: How do I fix Volume Group Locked?

>From /usr/lpp/bos/README (AIX 3.2.5) and 1.800.IBM.4FAX #2809

If you get '0516-266 publvodm: volume group rootvg is locked, try again'
or something similar, you can use (putlvodm -K `getlvodm -v <vgname>`)

------------------------------

1.709: How do I remove a volume group with no disks?
From: shieh@austin.ibm.com (Johnny Shieh)

This is a very common question about AIX LVM and I thought
I might take some time to explain what is going on.  Within
a volume group is the Volume Group Descriptor Area (VGDA) is
is kinda a "suitcase" of lvm information.  This is what allows
you to pick up your drives and take them to another machine,
importvg them, and get filesystems automatically defined.

What happens is that when you importvg the volume group,
the RS/6000 goes out and reads the VGDA and finds out about
all the logical volumes and filesystems that may exist on the
volume group.  It then checks for clashes (name conflicts, etc..)
on its own machine and then, here is the important part, populates
its own database with information about the new volume group and
its associated logical volumes.  In cases of filesystems, it will
go into the /etc/filesystems file and add the new filesystem entries
that came along with the imported volume group.

Okay, the key point is that you've got this independent volume group
that has "docked" at the new RS/6000.  What keeps the two tethered
to each other is the varyonvg command.  When this is started on the
volume group, a software link is created where you can't separate the
volume group from the AIX operating system unless the volume group
is no longer seen as active by the system.  In very rare cases, a
situation can occur where the VGDA thinks that someone has it (the
volume group) activated, but the operating system doesn't think it has the
volume group opened up.  This is pretty rare.

The main question I see is "I've taken away the disks, but how do
I get rid of the volume group".  The question should really say,
"How do I get rid of the volume group INFORMATION" since that's
all you have on the system.  You've got possible entries in
the /etc/filesystems and definitely entries in the ODM.  Just 
do:
	exportvg <vgname>

It does a reverse importvg, except it doesn't go off and read
the VGDA.  It nukes anything relating to the volume group in
the /etc/filesystems and ODM.  The only time this won't work is
if the system detects that the volume group is varied on.  Then,
it would be like trying to change tires on a moving car, we won't
let you do it!

Some people are concerned that doing an exportvg will somehow damage
the volume group and/or its VGDA. As I said, all it does is affect the
information about the volume group on the RS/6000 box, not on the actual
disk platter itself.  Thus, the volume group you exported is safe to
take to another system.  The only time the VGDA gets overwritten is when
you create a new volume on top of it.

The second most often asked question is "How do I get rid of a disk
that is no longer really in the volume group?"

In this case, you DON'T want to do an exportvg.  What you want to do
is tell the system you want to cut out the memory of the old, bad disk
from the RS/6000 AND from the VGDA of the volume group.  You simply
do:

		reducevg -d -f <vgname> <hdname>

or if the hdname can't be found:

		reducevg -d -f <vgname> <PVID>

Be careful with this command.  Unlike the exportvg command, actions done
with this command WILL affect the VGDA information on the platter.

Hope this clarifies some questions about volume groups.

------------------------------

1.710:  What are the theoritical limits within the LVM?
From: Gerry FitzGerald <G.FitzGerald@uk22p.bull.co.uk>

  -------------------------------------
  LVM Limits within AIX (my perception)
  -------------------------------------
  
  The system may have 1 to 255 Volumes Groups (VG's).
  Each VG may contain 1 to 32 Physical Volumes (PV's).
  Each PV may contain upto 1016 Physical Partitions (PP's).
  Each PP may have a size (square of 2) from 1 to 256MB (1024MB for AIX 4.3).
  
  Therefore, if you can get hold of a 260,096 MB disk (one PV with 1016 
  x 256MB PPs), you can install 32 of these in a single VG giving you 
  8,323,072MB per VG. You may have up to 255 VG's in one AIX system so 
  you could (in theory) create the maximum addressable AIX storage area 
  of 2,122,383,360 MB (2,072,640 GB or 2,024 TB or approx. 2 PB). This 
  is based on the current limitations of AIX V4.1.
  
  The limits for file and filesystem sizes are:

[Editor's note: the original values in this mail appeared to
 be slightly wrong, I have corrected that to the values as per
 my interpretation of the AIX manual.]
  
  AIX V3.2  Max filesystem size:  2,147,483,647 bytes (2 GB)
  Max single file size:  2,147,483,647 bytes (2 GB)
  
  AIX V4.1  Max filesystem size:  1,099,511,627,776 bytes (1 TB)
  Max single file size:  2,147,483,647 bytes (2 GB)
  
  AIX V4.2  Max filesystem size:  1,099,511,627,776 bytes (1 TB)
  Max single file size:  68,589,453,312 (~64 GB)

  AIX V4.3  Max filesystem size:  1,099,511,627,776 bytes (1 TB)
  Max single file size:  68,589,453,312 (~64 GB)

The 1TB maximum file system size is given by the rule that each
fragment must be addressable by an 28 bit number, with the largest
fragment size being 4096 bytes (4096*2^28).

------------------------------

1.800: How do I control how hostnames are resolved?
From: <kraem@ibm.de> Frank Kraemer

Information from AIX 4.1.2 Infoexplorer:

The default order can be overwritten by creating the configuration file,
/etc/netsvc.conf and specifying the desired order. Both the default and
/etc/netsvc.conf can be overwritten with the environment variable,
NSORDER. If either the /etc/netsvc.conf file or environment variable,
NSORDER are defined, then at least one value must be specified along with
the option.

examples: 
    echo hosts = local,nis,bind >/etc/netsvc.conf
    NSORDER=local,bind; export NSORDER

------------------------------

Subjet: 1.801: dtlogin ignores /etc/profile?
From: Trevor Bourget (trevor@thomsoft.com)

Read the /usr/dt/bin/Xsession script.  You can add a file to the
/etc/dt/config/Xsession.d and it will get sourced as part of the
startup.  The order is: $HOME/.dtprofile, /etc/dt/config/Xsession.d/*,
/usr/dt/config/Xsession.d/* (backwards, in my opinion, but CDE is a
committee result after all).

>From: Ed Ravin <eravin@panix.com>

If you want your terminal session to automatically read in
/etc/profile and your .profile when they start up, you need to either
invoke them with the "-ls" option (which I couldn't figure out how to
do, perhaps someone else can elaborate), or set up the default X
resources so that they set:

*Dtterm*loginShell:     true

You could always do this with the .Xresources file in your own account,
but that wouldn't fix any other users in the system.  To make this change
globally:

CDE configuration files are kept in /usr/dt/config
 
Those files warn you strenuously not to change them, since AIX upgrades
will overwrite them and lose your changes.  They recommend that you copy
the files to /etc/dt/config and change them there, so:

# cd /usr
# find dt/config -print | cpio -pdvum /etc
... (files get copied)
# cd /etc/dt/config/C
# echo "*Dtterm*loginShell:     true" >> sys.resources
# cd ../en_US
# echo "*Dtterm*loginShell:     true" >> sys.resources

From: Olaf Meeuwissen <olaf@IMSL.shinshu-u.ac.jp>

The problem is in /usr/dt/bin/Xsession.  This script only recognizes
the following login shells: sh, ksh and csh (as of $Revision: 1.6 $).
All other shells are considered non-standard.

The fix is to have your sys-admin add any other login shells in the
right places in the script (twice in the "Start the session" part).
Look for "case ${SHELL##*/} in" and add shells in the patterns.

Note that this script will be overwritten unconditionally by system
updates :-( and, unlike much other stuff in /usr/dt/, copying it to
/etc/dt/ does not work.

For which shells to add, you may want to:

   $ grep shells /etc/security/login.cfg

------------------------------

1.802:  Where's the C compiler?

As of AIX 4.1,  the C compiler has been "unbundled."  It's a separate product,
and you must purchase a separate license for it.  IBM does offer free
time limited trial licenses if you want to "try before you buy."

The GNU C compiler is available from various sources.  The most convenient
is probably <http://www-frec.bull.com/>.  <ftp://aixpdslib.seas.ucla.edu/>
is another source.

------------------------------

1.803:  Why doesn't Netscape work?

See question 1.515.

------------------------------

1.900: SCSI-1 and SCSI-2 "interoperability" got you confused?  

A.  SCSI-1 devices are supported on a SCSI-2 adapter.  This
    config will provide SCSI-1 performance.

B.  SCSI-2 devices are supported on a SCSI-1 adapter.  This
    config will provide SCSI-1 performance.

C.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-1
    adapter.  All devices will have SCSI-1 performance.

D.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-2
    adapter.  SCSI-2 devices will have SCSI-2 performance (10 MB/sec)
    and SCSI-1 devices will have SCSI-1 performance (4-5 MB/sec).

------------------------------

1.901: How to get your keyboard back after unplugging it from the 6000
From: Mickey Coggins and Anne Serre and L. Mark Larsen

When you unplug your keyboard from a running system, and plug it back
in, the key mapping is wrong.  For example, keys like Caps Lock and Ctrl
don't work as designed.

Solution: Type at the command line

        /usr/lpp/diagnostics/da/dkbd

Your screen goes black, you hear a few beeps, and your keyboard is reset.
It works with any environment, Xwindows, hft, NLS...

For Models 220, 230 and M20, use the following commands:

/usr/lpp/diagnostics/da/dkbd
/usr/lpp/diagnostics/da/dkbdsal   (for the 220)

After running the keyboard diagnostics to reset keyboard mappings, the
repeat rate is also reset to some slow value (11, according to the man
page).  If the user is in X, you need to open an hft window.  Do this
with "xopen /bin/csh".  Once you have an hft window, run "chhwkbd -r30".

------------------------------

1.902: How do I set up pcsim, the DOS emulator?

[Editor's Note: this product does not exist in AIX 4.x.]

You must have a bootable DOS diskette to install pcsim. Either DOS 3.3, 
4.x, or 5.0 will work. IBM do not officially support DOS 5.0 for pcsim
but I have no problems with it. Just don't try to be fancy with the UMB 
and memory manager stuff.

With a bootable DOS disk in the drive, do:
$touch /u/dosdrive (this is the AIX file for DOS emulation)
$pcsim -Adiskette 3 -Cdrive /u/dosdrive
You would now get an A prompt. Type:
A> fdisk
Create the virtual C drive of whatever size you choose. Make it large 
enough for your needs since you cannot enlarge it later.
A> format c: /s (to format the virtual C drive)
Now exit from pcsim with ESCpcsim (Esc key followed by pcsim).

Now create a simprof file. Following is a starter:

Adiskette   : 3
Cdrive      :/u/dosdrive
lpt1        : name of printer queue
refresh     : 50
dmode       : V
mouse       : com1

You can now start pcsim anytime by typing pcsim. Make sure no floppies
are in the drive. For further information, refer to publication
SC23-2452, Personal Computer Simulator/6000 Guide and Reference.
       
------------------------------

1.903: How do I transfer files between AIX and DOS disks?

In the AIX package bos.dosutils are commands for transferring files between
DOS diskettes and AIX. The commands are dosread, doswrite, dosdir, dosdel,
and dosformat. Many users have mentioned that the mtools package from
prep.ai.mit.edu is better than the native AIX programs.


------------------------------

1.904: Where is the crypt program?

The crypt *program* (as opposed to the crypt subroutine) has been
deleted, probably to conform to U.S. law regarding export of
cryptographic technology.

Other programs such as PGP are available,  but their use and/or
possesion may be subject to local laws and regulations.

If anyone has a better answer to this question,  feel free to
contribute it.

------------------------------

1.905: How do I play audio CDs?
From: woan@austin.ibm.com (Ronald S. Woan)

Get xmcd by anonymous FTP from ftp.x.org in /contrib/applications/xmcd/
<URL:ftp://ftp.x.org/contrib/applications/xmcd/>

------------------------------

1.906: How can I get the mouse back after unplugging it?

/usr/lpp/diagnostics/da/dmousea

------------------------------

1.907: Where can I get source code to the operating
                system binary xxxxx?

AIX source code is not generally available.  Two other UNIX OS' do
make their source available, Linux & freeBSD.  Check
<ftp://ftp.uu.net/systems/unix/bsd-sources/> and
<ftp://ftp.uu.net/systems/unix/linux/>

------------------------------

1.908: What's the difference between the POWER and
                POWERPC architectures?

Read the POWERPC FAQ at
<http://www.mot.com/SPS/PowerPC/library/ppc_faq/ppc_faq.html>

------------------------------

1.909: Will there be date rollover problems in the year 2000?
From: mbrown@austin.ibm.com (Mark Brown)

IBM has a major corporate-wide push for *all* of its software products
to be "safe" in this regard by the end of 1996.

<http://www.software.ibm.com/year2000/paper.html> is the general-purpose
[Year 2000] URL for IBM.

As far as AIX is concerned, we had to fix three things in AIXv4.1.4
(some logging commands handled date ranges wrong) as PTFs, but other
than that, we are there.

...and we handle the leap year issue correcly. also.

------------------------------

1.910: How can I build an "installp format" file?

Jim Abbey <jim@systelecom.com> has a tool called "lppbuild".
It is now available from "aixpdslib.seas.ucla.edu"
in either of

/pub/lppbuild/RISC/3.2/src/lppbuild.1.0.tar.Z
/pub/lppbuild/RISC/4.1/src/lppbuild.1.0.tar.Z

Both are identical and the procedures also work on 4.2.

Ciaran Diegnan <C.Diegnan@frec.bull.fr> has built a tool called
"mklpp".  You can retrieve a copy (along with many other
smit-installable freeware packages) from <http://www-frec.bull.com/>.

------------------------------

1.911: Is there a generic SCSI driver for AIX?
From: Rogan Dawes <rdawes@jhbelec.co.za>

Yes. Matthew Jacob (mjacob@feral.com) has written a generic SCSI driver
for AIX 4.1.  It can be found at <ftp://ftp.feral.com/pub/aix/gsc.tar.gz>.
------------------------------

1.912: Viruses or virus scanning on AIX?
From: mww@microfocus.com (Michael Wojcik)

FWIW, AIX comes with a virus-scanning utility (/usr/bin/virscan),
though IIRC the original version had an empty signature file (in
/usr/lib/security/scan/virsig.lst) and even the later populated
signature file only contains PC viruses.  Quoth the man page, "at
this time [virsig.lst] contains no known AIX virus signatures".
Apparently we are to infer that there *were* no known AIX virus
signatures.

I note that my 4.2.1 AIX system still has the 1991 signature file.

Even a DOS-only virus list could potentially be useful on a Unix
file server, though.  Provided, of course, that it had a recent
signature list (and preferably mutant-detection and similar
heuristics), which virscan probably does not.

And to be fair there are plenty of Unix vulnerabilities, and even
viruses potentially among them.  David Harley, keeper of the
alt.comp.virus FAQ, mentioned some "lab" Unix viruses when this
thread appeared in October '87, and I recall a discussion of using
crypto hashes to validate major system commands on some Unix group
not that long ago - which is essentially virus-scanning technology,
though not necessarily for the same purpose it generally serves
on PCs.

That said, viruses are not the problem for Unix systems that they
are for PCs.  Network security, guessable usernames and passwords,
and the like should generally be a higher priority.

------------------------------

2.00: C/C++

Contrary to many people's belief, the C environment on the RS/6000 is
not very special.  The C compiler has quite a number of options that can
be used to control how it works, which "dialect" of C it compiles, how
it interprets certain language constructs, etc.  InfoExplorer includes a
Users Guide and a Reference Manual.

The compiler can be invoked with either xlc for strict ANSI mode and cc
for RT compatible mode (i.e. IBM 6150 with AIX 2).  The default options
for each mode are set in the /etc/xlc.cfg file, and you can actually add
another stanza and create a link to the /bin/xlc executable.

The file /usr/lpp/xlc/bin/README.xlc has information about the C
compiler, and the file /usr/lpp/bos/bsdport (AIX 3 only) contains useful
information, in particular for users from a BSD background.

The file /etc/xlc.cfg also shows the symbol _IBMR2 that is predefined,
and therefore can be used for #ifdef'ing RS/6000 specific code.

------------------------------

2.01: I cannot make alloca work

A famous routine, in particular in GNU context, is the allocation
routine alloca().  Alloca allocates memory in such a way that it is
automatically free'd when the block is exited.  Most implementations
does this by adjusting the stack pointer.  Since not all C environments
can support it, its use is discouraged, but it is included in the xlc
compiler.  In order to make the compiler aware that you intend to use
alloca, you must put the line

#pragma alloca

before any other statements in the C source module(s) where alloca is
called.  If you don't do this, xlc will not recognize alloca as anything
special, and you will get errors during linking.

For AIX 3.2, it may be easier to use the -ma flag.

------------------------------

2.02: How do I compile my BSD programs?

The file /usr/lpp/bos/bsdport contains information on how to port
programs written for BSD to AIX 3.  This file may be very useful for
others as well.

A quick cc command for most "standard" BSD programs is:
  
  $ cc -D_BSD -D_BSD_INCLUDES  -o [loadfile] [sourcefile.c] -lbsd

If your software has system calls predefined with no prototype
parameters, also use the -D_NO_PROTO flag.

------------------------------

2.03: Isn't the linker different from what I am used to?

Yes.  It is not at all like what you are used to:

- The order of objects and libraries is normally _not_ important.  The
  linker reads _all_ objects including those from libraries into memory
  and does the actual linking in one go.  Even if you need to put a
  library of your own twice on the ld command line on other systems, it
  is not needed on the RS/6000 - doing so will even make your linking slower.

- One of the features of the linker is that it will replace an object in
  an executable with a new version of the same object:

  $ cc -o prog prog1.o prog2.o prog3.o		# make prog
  $ cc -c prog2.c				# recompile prog2.c
  $ cc -o prog.new prog2.o prog			# make prog.new from prog
						# by replacing prog2.o
  
- The standard C library /lib/libc.a is linked shared, which means that
  the actual code is not linked into your program, but is loaded only
  once and linked dynamically during loading of your program.

- The ld program actually calls the binder in /usr/lib/bind, and you can
  give ld special options to get details about the invocation of the
  binder.  These are found on the ld man page or in InfoExplorer.

- If your program normally links using a number of libraries (.a files),
  you can 'prelink' each of these into an object, which will make your
  final linking faster.  E.g. do:

  $ cc -c prog1.c prog2.c prog3.c
  $ ar cv libprog.a prog1.o prog2.o prog3.o
  $ ld -r -o libprog.o libprog.a
  $ cc -o someprog someprog.c libprog.o

This will solve all internal references between prog1.o, prog2.o and
prog3.o and save this in libprog.o Then using libprog.o to link your
program instead of libprog.a will increase linking speed, and even if
someprog.c only uses, say prog1.o and prog2.o, only those two modules
will be in your final program.  This is also due to the fact that the
binder can handle single objects inside one object module as noted above.

If you are using an -lprog option (for libprog.a) above, and still want
to be able to do so, you should name the prelinked object with a
standard library name, e.g. libprogP.a (P identifying a prelinked
object), that can be specified by -lprogP.  You cannot use the archiver
(ar) on such an object.

You should also have a look at section 3.01 of this article, in
particular if you have mixed Fortran/C programs.

Dave Dennerline (d.dennerline@bull.com) claims that his experiences
in prelinking on AIX does not save much time since most people have
separate libraries which do not have many dependencies between them,
thus not many symbols to resolve.

------------------------------

2.04: How do I statically link my program?

  cc -o prog -bnoso -bI:/lib/syscalls.exp obj1.o obj2.o obj3.o

will do that for a program consisting of the three objects obj1.o, etc.

[Editor's note: You should never link programs statically that are
supposed to leave your local environment, e.g. intended for
distribution. Statically linked programs may fail to work after
installing a new AIX version or even after installing a PTF.]

From: Marc Pawliger (marc@sti.com)

As of AIX 3.2.5, you can install a speedup for AIXwindows called
Shared Memory Transport.  To static link an X application after the
SMT PTF has been installed, you must link with
-bI:/usr/lpp/X11/bin/smt.exp and the executable will NOT run on a
machine where SMT is not installed.  See /usr/lpp/X11/README.SMT

2.05: How do I make my own shared library?

To make your own shared object or library of shared objects, you should
know that a shared object cannot have undefined symbols.  Thus, if your
code uses any externals from /lib/libc.a, the latter MUST be linked with
your code to make a shared object.  Mike Heath (mike@pencom.com) said it
is possible to split code into more than one shared object when externals
in one object refer to another one.  You must be very good at
import/export files.  Perhaps he or someone can provide an example. 

Assume you have one file, sub1.c, containing a routine with no external
references, and another one, sub2.c, calling stuff in /lib/libc.a.  You
will also need two export files, sub1.exp, sub2.exp.  Read the example
below together with the examples on the ld man page. 

---- sub1.c ----
    int addint(int a, int b)
    {
      return a + b;
    }
---- sub2.c ----
    #include <stdio.h>

    void printint(int a)
    {
      printf("The integer is: %d\n", a);
    }
---- sub1.exp ----
    #!
    addint
---- sub2.exp ----
    #!
    printint
---- usesub.c ----
    main()
    {
      printint( addint(5,8) );
    }

The following commands will build your libshr.a, and compile/link the
program usesub to use it.  Note that you need the ld option -lc for
sub2shr.o since it calls printf from /lib/libc.a.  [Note that you can leave
out the "-T512 -H512" on AIX 4. -- Ed.]

  $ cc  -c sub1.c
  $ ld -o sub1shr.o sub1.o -bE:sub1.exp -bM:SRE -T512 -H512 
  $ cc  -c sub2.c
  $ ld -o sub2shr.o sub2.o -bE:sub2.exp -bM:SRE -T512 -H512  -lc
  $ ar r libshr.a sub1shr.o sub2shr.o
  $ cc -o usesub usesub.c -L: libshr.a
  $ usesub
  The integer is: 13
  $

------------------------------

2.06: Linking my program fails with strange errors.  Why?

Very simple, the linker (actually called the binder), cannot get the
memory it needs, either because your ulimits are too low or because you
don't have sufficient paging space.  Since the linker is quite different
>from normal Unix linkers and actually does much more than these, it also
uses a lot of virtual memory.  It is not unusual to need 10000 pages (of
4k) or more to execute a fairly complex linking.

If you get 'BUMP error', either ulimits or paging is too low, if you get
'Binder killed by signal 9' your paging is too low.

First, check your memory and data ulimits; in korn shell 'ulimit -a' will
show all limits and 'ulimit -m 99999' and 'ulimit -d 99999' will
increase the maximum memory and data respectively to some high values. 
If this was not your problem, you don't have enough paging space.

If you will or can not increase your paging space, you could try this:

- Do you duplicate libraries on the ld command line? That is never
  necessary.

- Do more users link simultaneously? Try having only one linking going
  on at any time.

- Do a partwise linking, i.e. you link some objects/libraries with the
  -r option to allow the temporary output to have unresolved references,
  then link with the rest of your objects/libraries.  This can be split
  up as much as you want, and will make each step use less virtual memory.

  If you follow this scheme, only adding one object or archive at a
  time, you will actually emulate the behavior of other Unix linkers.

If you decide to add more paging space, you should consider adding a new
paging space on a second hard disk, as opposed to just increasing the
existing one.  Doing the latter could make you run out of free space on
your first harddisk. It is more involved to shrink a paging space
but easier to delete one.

------------------------------

2.07: Why does it take so long to compile "hello world" with xlc?

Some systems have experienced delays of more than 60 seconds in
compiling "#include <stdio.h> int main () {printf ("Hello world");}"
The problem is with the license manager contact IBM to make sure
you've got the latest PTF.

------------------------------

2.08: What's with malloc()?
 
malloc() uses a late allocation algorithm based on 4.3 BSD's malloc()
for speed.  This lets you allocate very large sparse memory spaces,
since the pages are not actually allocated until they are touched for
the first time.  Unfortunately, it doesn't die gracefully in the face of
loss of available memory.  See the "Paging Space Overview" under
InfoExplorer, and see the notes on the linker in this document for an
example of an ungraceful death.

If you want your program to get notified when running out of memory, you
should handle the SIGDANGER signal.  The default is to ignore it. 
SIGDANGER is sent to all processes when paging space gets low, and if
paging space gets even lower, processes with the highest paging space
usage are sent the SIGKILL signal.

malloc() is substantially different in 3.2, allocating memory more
tightly.  If you have problems running re-compiled programs on 3.2,
try running them with MALLOCTYPE=3.1.

Early Page Space Allocation (EPSA) added to AIX 3.2: see
/usr/lpp/bos/README.PSALLOC - IX38211 / U422496 Allows setting of
early allocation (vs. default late allocation) on a per-process basis.

------------------------------

2.09: Why does xlc complain about 'extern char *strcpy()'

The header <string.h> has a strcpy macro that expands strcpy(x,y) to
__strcpy(x,y), and the latter is then used by the compiler to generate
inline code for strcpy.  Because of the macro, your extern declaration
contains an invalid macro expansion.  The real cure is to remove your
extern declaration but adding -U__STR__ to your xlc will also do the
trick, although your program might run a bit more slowly as the compiler
cannot inline the string functions any more.

------------------------------

2.10: Why do I get 'Parameter list cannot contain fewer ....'

This is the same as above (2.9).

------------------------------

2.11: Why does xlc complain about
               '(sometype *)somepointer = something'

Software that is developed using gcc may have this construct. However,
standard C does not permit casts to be lvalues, so you will need to
change the cast and move it to the right side of the assignment. If you
compile with 'cc', removing the cast completely will give you a warning,
'xlc' will give you an error (provided somepointer and something are of
different types - but else, why would the cast be there in the first place?)

------------------------------

2.12: Some more common errors

Here are a few other common errors with xlc:

305 |     switch((((np)->navigation_type) ? (*((np)->navigation_type)) :
      ((void *)0)))
      .a...........  
a - 1506-226: (S) The second and third operands of the conditional
operator must be of the same type.

The reason for this is that xlc defines NULL as (void *)0, and it does
not allow two different types as the second and third operand of ?:. 
The second argument above is not a pointer and the code used NULL
incorrectly as a scalar. NULL is a nil pointer constant in ANSI C and
in some traditional compilers.

You should change NULL in the third argument above to an integer 0.


------------------------------

2.13: Can the compiler generate assembler code?

Starting with version 1.3 of xlc and xlf the -S option will generate a
.s assembly code file prior to optimization. The option -qlist will
generate a human readable one in a .lst file.

There is also a disassembler in /usr/lpp/xlc/bin/dis include with the
1.3 version of xlc (and in /usr/lpp/xlC/bin/dis with the 2.1 version
of xlC) that will disassemble existing object or executable files.

------------------------------

2.14: Curses

Curses based applications should be linked with -lcurses and _not_ with
-ltermlib. It has also been reported that some problems with curses are
avoided if your application is compiled with -DNLS.

Peter Jeffe <peter@ski.austin.ibm.com> also notes:

>the escape sequences for cursor and function keys are *sometimes*
>treated as several characters: eg. the getch() - call does not return
>KEY_UP but 'ESC [ C.'

You're correct in your analysis: this has to do with the timing of the
escape sequence as it arrives from the net. There is an environment
variable called ESCDELAY that can change the fudge factor used to decide
when an escape is just an escape. The default value is 500; boosting
this a bit should solve your problems.

Christopher Carlyle O'Callaghan <asdfjkl@wam.umd.edu> has more comments
concerning extended curses:

1) The sample program in User Interface Programming Concepts, page 7-13
   is WRONG. Here is the correct use of panes and panels.

#include <cur01.h>
#include <cur05.h>

main()
{
PANE *A, *B, *C, *D, *E, *F, *G, *H;
PANEL *P;

initscr();

A = ecbpns (24, 79, NULL, NULL, 0, 2500, Pdivszp, Pbordry, NULL, NULL);
D = ecbpns (24, 79, NULL, NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
E = ecbpns (24, 79, D,    NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
B = ecbpns (24, 79, A, D, Pdivtyh, 3000, Pdivszp, Pbordry, NULL, NULL);
F = ecbpns (24, 79, NULL, NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
G = ecbpns (24, 79, F,    NULL, 0, 5000, Pdivszp, Pbordry, NULL, NULL);
H = ecbpns (24, 79, G,    NULL, 0, 3000, Pdivszp, Pbordry, NULL, NULL);
C = ecbpns (24, 79, B, F, Pdivtyh, 0, Pdivszf, Pbordry, NULL, NULL);
P = ecbpls (24, 79, 0, 0, "MAIN PANEL", Pdivtyv, Pbordry, A);

ecdvpl (P);
ecdfpl (P, FALSE);
ecshpl (P); 
ecrfpl (P);
endwin();
}

2) DO NOT include <curses.h> and any other <cur0x.h> file together.
   You will get a bunch of redefined statements.

3) There is CURSES and EXTENDED CURSES. Use only one or the other. If the
   manual says that they're backwards compatible or some other indication 
   that you can use CURSES routines with EXTENDED, don't believe it. To 
   use CURSES you need to include <curses.h> and you can't (see above).

4) If you use -lcur and -lcurses in the same link command, you will get
   Memory fault (core dump) error. You CANNOT use both of them at the same
   time. -lcur is for extended curses, -lcurses is for regular curses.

5) When creating PANEs, when you supply a value (other than 0) for the
   'ds' parameter and use Pdivszf value for the 'du' parameter, the 'ds'
   will be ignored (the sample program on page 7-13 in User Interface
   Programming Concepts is wrong.) For reasons as yet undetermined,
   Pdivszc doesn't seem to work (or at least I can't figure out how to
   use it.)

6) If you're running into bugs and can't figure out what is happening,
   try the following:
   include -qextchk -g in your compile line
	-qextchk will check to make sure you're passing the right number of
  	 parameters to the functions
	-g enables debug

7) Do not use 80 as the number of columns if you want to use the whole
   screen. The lower right corner will get erased.  Use 79 instead.

8) If you create a panel, you must create at least 1 pane, otherwise you
   will get a Memory fault (core dump).

9) When creating a panel, if you don't have a border around it, any title
   you want will not show up.

10) to make the screen scroll down:
    wmove (win, 0, 0);
    winsertln (win)

11) delwin(win) doesn't work in EXTENDED WINDOWS

    To make it appear as if a window is deleted, you need to do the following:
    for every window that you want to appear on the screen
	touchwin(win)
	wrefresh(win)

    you must make sure that you do it in the exact same order as you put
    them on the screen (i.e., if you called newwin with A, then C, then B,
    then you must do the loop with A, then C, then B, otherwise you won't
    get the same screen back).  The best thing to do is to put them into
    an array and keep track of the last window index.

12) mvwin(win, line, col) implies that it is only used for viewports and
    subwindows. It can also be used for the actual windows themselves.

13) If you specify the attribute of a window using wcolorout(win), any
    subsequent calls to chgat(numchars, mode) or any of its relatives
    will not work. (or at least they get very picky.)

------------------------------

2.15: How do I speed up linking

Please refer to sections 2.03 and 2.06 above.

From: losecco@undpdk.hep.nd.edu (John LoSecco) and
      hook@chaco.aix.dfw.ibm.com (Gary R. Hook)

From oahu.cern.ch in /pub/aix3 you can get a wrapper for the existing
linker called tld which can reduce link times with large libraries by
factors of 3 to 4.

------------------------------

2.16: What is deadbeef?

When running the debugger (dbx), you may have wondered what the
'deadbeef' is you occasionally see in registers.  Do note, that
0xdeadbeef is a hexadecimal number that also happens to be some kind
of word (the RS/6000 was built in Texas!), and this hexadecimal number
is simply put into unused registers at some time, probably during
program startup.


------------------------------

2.17: How do I make an export list from a library archive?
From: d.dennerline@bull.com (Dave Dennerline)

[ This script has been moved to section 8.10 ]

------------------------------

2.19: Building imake, makedepend
From: crow@austin.ibm.com (David L. Crow)

[Editor's note: if you have AIX 4.x,  you need the X11.adt.imake LPP
and probably most if not all of the X11.adt.* LPPs.  Imake, xmkmf and
other utilities are delivered precompiled.]

    You need X11dev.src release 1.2.3.0 (ie the R5 release) [on AIX 3.2].


     Unless you have an R5 release of AIXwindows, there is no xmkmf.
  These are the steps that I use to make imake, makedepend and all
  of it's config files, and then install them in the working tree
  (ie not the Xamples) for daily use:
  
      cd /usr/lpp/X11/Xamples
      make Makefile
      make SUBDIRS="config util" Makefiles
      make SUBDIRS="config util" linklibs
      make SUBDIRS="config util" depend
      make SUBDIRS="config util" 
      make SUBDIRS="config util" install
      
  Then redo the steps everytime you apply an X11 update.

------------------------------

2.20: How can tell what shared libraries a binary is linked with?

Use "dump -H <execfilename>" and see if anything other than /unix is
listed in the loader section (at the bottom).  The first example is
/bin/sh (statically linked) and the second example is
/usr/local/bin/bash (shared).

INDEX  PATH                          BASE                MEMBER              
0      /usr/lib:/lib                                                         
1      /                             unix                                    

INDEX  PATH                          BASE                MEMBER              
0      ./lib/readline/:./lib/glob/:/usr/lib:/lib               
1                                    libc.a              shr.o               
2                                    libcurses.a         shr.o               

The freeware tool "ldd" lists all the shared libraries needed
by an executable, including those recursively included by other
shared libraries. See question 2.27 "Where can I find ldd for AIX?".

------------------------------

2.21: Can I get a PTF for my C/C++ compiler from the net?

<http://service.software.ibm.com/>  contains pointers to most PTFs, including
compilers.  You'll need the fixdist program (see 1.142) to retrieve them.

------------------------------

2.22: Why does "install"ing software I got from the net fail?

Note that the RS/6000 has two install programs, one with System V flavor
in the default PATH (/etc/install with links from /usr/bin and /usr/usg),
and one with BSD behavior in /usr/ucb/install.

------------------------------

2.23: What is Linker TOC overflow error 12?

There is a hard coded limit in the AIX 3.2.5 linker that is fixed in
AIX 4.1.  A kind soul donated the following information to help people
get the 3.2.5 fix

    The LPS (paperwork) 
      AIX TOC Data Binder/6000 #P91128
      Version 1.1
      Program Number 5799-QDY
      Reference No. GC23-2604-00, FC 5615
    Pre Reqs listed were AIX 3.2.5
      IBM C Set++ V2 (5765-186)

The above is not available any longer, see section 1.006.

You could also put some of the application code into shared libraries
or, in the case of gcc, use -mminimal-toc.

------------------------------

2.24: What is the limit on number of shared memory segments
               I can attach?

Each process has 16 segments.  One is used for private code, one for
stack, one for heap; those, if memory serves, are segments 0, 1, and
2.  (If you look in sys/shm.h, you'll see that SHMLOSEG is 3 -- the
lowest segment, in number and in the process' virtual address space,
available to shmat.)

SHMHISEG, the highest segment you can attach to (also defined in
sys/shm.h), is 12.  Segments 3 through 12 are available to shmat,
giving the 10 segments your program used successfully.  (NSHMSEGS in
sys/shm.h will give you this value, though it's of limited use, since
most platforms that I've seen don't define it.)

Segment 13 is used by shared code your program has attached to;
I think one of the others might be for kernel-mode data.

See also mmap.

------------------------------

2.25: I deleted libc.a by accident --- how do I recover?
From: Ed Ravin <eravin@panix.com>

You can recover from this without rebooting or reinstalling, if you
have another copy of libc.a available that is also named "libc.a".  If
you moved libc.a to a different directory, you're in luck -- do the
following:

export LIBPATH=/other/directory


And your future commands will work.  But if you renamed libc.a, this
won't do it.  If you have an NFS mounted directory somewhere, you can
put libc.a on the that host, and point LIBPATH to that directory as
shown above.

Failing that, turn off your machine, reboot off floppies or other
media, and get a root shell.  I don't think you should do "getrootfs"
as you usually do when accessing the root vg this way -- AIX may start
looking for libc.a on the disk, and you'll just run into the same
problem.  So do an importvg, varyonvg, and then mount /usr somewhere,
then manually move libc.a back or copy in a new one from floppy.

------------------------------

2.26: Where can I find dlopen, dlclose, and dlsym for AIX?

An implementation of these dynamic code loading functions was written by
Jens-Uwe Mager <jum@anubis.han.de> and can be found at
<http://www.han.de/~jum/aix/dlfcn.shar>

From: Gary R. Hook <hook@austin.ibm.com>

Starting with AIX 4.2 a dlopen et. al. are included in the base OS in
the libdl.a library. Under AIX 4.1 this is available as SLHS (Shared
Library Hookable Symbols) as APAR IX IX71849 for the runtime package and
APAR IX IX72973 for the development tools.

------------------------------

2.27: Where can I find ldd for AIX?
From: Jens-Uwe Mager <jum@anubis.han.de>

Try <http://www.han.de/~jum/aix/ldd.c>. Also the "aix.tools"
package from <http://www-frec.bull.com>

------------------------------

2.28:  How do I make my program binary executable on the
                POWER, POWER2, and POWERPC architecures?

AIX will emulate those instructions not available in POWERPC processors, but
you can avoid this emulation and consequent performance degradtation by
using only the common to all.

If you are using IBM's xlc (cc) compiler, the default is to use the common
instruction set.  If you want to be explicit, use the -qarch=com option.

The option -mcpu=common makes GCC use the common instruction set.  Please
note that (unlike xlc) this is *not* the default with GCC on AIX.

------------------------------

2.29: How do I access more than 256 Megabytes of memory?

By default each program gets one segment register (see 2.24) for its
data segment. As each segment register covers 256 MB, any calls to
malloc more will fail. Also programs that declare large global or static
arrays may fail to load. To allocate more segment registers to your
program, use the linker option -bmaxdata to specify the number of bytes
you need in the data segment as follows:

cc -o myprog -bmaxdata:0x20000000 myprog.c

The example above would allocate an additional segment register to allow
for 512MB of data.

------------------------------

2.30: How do I use POSIX threads with gcc 2.7.x?
From: David Edelsohn <dje@watson.ibm.com>

The code generated by GCC is compatible with threads, but gcc-2.7 
was released so long ago that it did not provide an option to perform
the extra link steps necessary to support threads:

1) Compile all source files with "-D_THREAD_SAFE" macro defined.
2) Link with "-L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a"
   to obtain the pthreads support 
   and add "-nostartfiles /usr/lib/crt0_r.o" to the beginning of the
   link command line (using gcc to link!) to initialize threads.

------------------------------

2.31: Why does pthread_create return the error code 22?

Using Posix threads under AIX requires a special C runtime startup
initialization as well as special versions of some libraries. The IBM C
compiler includes these special libraries if called by the name xlc_r
(or xlC_r for C++). There also other maing variations to support various
defaults, consult the file /etc/xlC.cf for details.

------------------------------

2.32: How do I build programs under a later AIX release that run
	under earlier releases as well?

IBM develops AIX only for binary compatibility with older AIX releases,
not the other way around. You will thus need to build programs on the
oldest AIX release the program is supposed to run on. You will also need
to link programs dynamically, if you link in the system libraries
statically the program will probably only run on the machine you
performed the link on.

With some preparation it is appearently possible to get around that
limitation. Bob Halblutzel has put together a web page describing the
detailed steps how to set up such a build environment at the following
web page:

<http://www.hablutzel.com/aix_compatibility_build.html>

Please not that this is not a supported way to build your programs, you
will probably receive not any support by IBM if you have problems with
that environment.

------------------------------

3.00: Fortran and other compilers

This section covers all compilers other than C/C++.  On Fortran, there
seem to have been some problems with floating point handling, in
particular floating exceptions.

------------------------------

3.01: I have problems mixing Fortran and C code, why?

A few routines (such as getenv, signal, and system) exist in both the
Fortran and C libraries but with different parameters. In the recent
past, if you have a mixed program that calls getenv from both C and
Fortran code, you have to link them carefully by specifying the correct
library first on your command line. This is no longer needed starting
with version 1.5 of the compilers.


------------------------------

3.02: How do I statically bind Fortran libraries and dynamically
               bind C libraries?
From: amaranth@vela.acs.oakland.edu (Paul Amaranth)

[ Editor's note: Part of this is also discussed above under the C compiler
  section, but I felt it was so valuable that I have left it all in. 
  I've done some minor editing, mostly typographical. ]

The linker and binder are rather versatile programs, but it is not
always clear how to make them do what you want them to.  In particular,
there are times when you do not want to use shared libraries, but
rather, staticly bind the required routines into your object.  Or, you
may need to use two versions of the same routine (eg, Fortran & C).  Here
are the results of my recent experiments.  I would like to thank Daniel
Premer and Brad Hollowbush, my SE, for hints.  Any mistakes or omissions
are my own and I have tended to interchange the terms "linker" and
"binder".  These experiments were performed on AIX 3.1.2.  Most of this
should be applicable to later upgrades of 3.1.

1)  I have some C programs, I want to bind in the runtime routines.  How
    do I do this? [Mentioned in section 2.04 of this article as well, ed.]

    You can put the -bnso binder command on the link line.  You should
    also include the -bI:/lib/syscalls.exp control argument:
      
      $ cc *.o -bnso -bI:/lib/syscalls.exp -o foo

    This will magically do everything you need.  Note that this will bind
    _all_ required routines in.  The -bI argument tells the linker that
    these entry points will be resolved dynamically at runtime (these are
    system calls).  If you omit this you will get lots of unresolved 
    reference messages.

2)  I want to statically bind in the Fortran runtime so a) my customers 
    do not need to buy it and b) I don't have to worry about the runtime
    changing on a new release.  Can I use the two binder arguments in
    1) to do this?

    You should be able to do so, but, at least under 3002, if you do
    you will get a linker error referencing getenv.  In addition, there
    are a number of potential conflicts between Fortran and C routines.
    The easy way just does not work.  See the section on
    2 stage linking for C and Fortran on how to do this.  The getenv
    problem is a mess, see the section on Comments & Caveats for more.

    From: Gary R. Hook <hook@austin.ibm.com>

    The xlf runtime is a no-charge feature, you can download and install
    it without having to buy it. This change was made >2 years ago.

3)  I have a mixture of C and Fortran routines, how can I make sure
    that the C routines reference the C getenv, while the Fortran routines
    reference the Fortran getenv (which has different parameters and, if
    called mistakenly by a C routine results in a segmentation fault)?

    From Mike Heath (mike@pencom.com):

    Use -brename:symbol1,symbol2 when pre-linking the modules from one
    of the languages. It does not matter which one you choose.

4)  I have C and Fortran routines.  I want to bind in the xlf library, while
    letting the rest of the libraries be shared.  How do I do this?

    You need to do a 2 stage link.  In the first stage, you bind in the
    xlf library routines, creating an intermediate object file.  The
    second stage resolves the remaining references to the shared libraries.

    This is a general technique that allows you to bind in specific system
    routines, while still referencing the standard shared libraries.

    Specifically, use this command to bind the xlf libraries to the Fortran
    objects:

       $ ld -bh:4 -T512 -H512 <your objects> -o intermediat.o \
         -bnso -bI:/lib/syscalls.exp -berok -lxlf -bexport:/usr/lib/libg.exp \
         -lg -bexport:<your export file>

    The argument -bexport:<your export file> specifies a file with the
    name of all entry points that are to be visible outside the intermediate 
    module.  Put one entrypoint name on a line.  The -bI:/lib/libg.exp line 
    is required for proper functioning of the program.  The -berok argument 
    tells the binder that it is ok to have unresolved references, at least 
    at this time (you would think -r would work here, but it doesn't seem to).  
    The -bnso argument causes the required modules to be imported
    into the object.  The -lxlf, of course, is the xlf library.

    Then, bind the intermediate object with the other shared libraries in
    the normal fashion:

       $ ld -bh:4 -T512 -H512 <C or other modules> intermediate.o \
         /lib/crt0.o -lm -lc

    Note the absence of -berok.  After this link, all references should
    be resolved (unless you're doing a multistage link and making another
    intermediate).

    NOTE THE ORDER OF MODULES.  This is extremely important if, for example,
    you had a subroutine named "load" in your Fortran stuff.  Putting the
    C libraries before the intermediate module would make the C "load"
    the operable definition, rather than the Fortran version EVEN THOUGH 
    THE FORTRAN MODULE HAS ALREADY BEEN THROUGH A LINK AND ALL REFERENCES 
    TO THE SYMBOL ARE CONTAINED IN THE FORTRAN MODULE.  This can
    be extremely difficult to find (trust me on this one :-)  Is this
    a bug, a feature, or what?
    
    [As mentioned in section 2.03 of this article, it is a feature that you
    can replace individual objects in linked files, ed.]

    The result will be a slightly larger object than normal.  (I say slightly
    because mine went up 5%, but then it's a 2 MB object :-)


Comments & Caveats:

   From the documentation the -r argument to the linker should do what
   -berok does.  It does not.  Very strange results come from using the
   -r argument.  I have not been able to make -r work in a sensible manner
   (even for intermediate links which is what it is supposed to be for).

       Note from Mike Heath (mike@pencom.com):

       'ld -r' is essentially shorthand for 'ld -berok -bnogc -bnoglink'.
       Certainly, using -berok with an export file (so garbage collection
       can be done) is preferable to ld -r, but the latter is easier.

   When binding an intermediate module, use an export file to define the
   entry points you want visible in the later link.  If you don't do this,
   you'll get the dreaded "unresolved reference" error.  Import files name
   entry points that will be dynamically resolved (and possibly where).

   If you are in doubt about what parameters or libraries to link, use the
   -v arg when linking and modify the exec call that shows up into 
   an ld command.  Some thought about the libraries will usually yield an
   idea of when to use what.  If you don't know what an argument is for,
   leave it in.  It's there for a purpose (even if you don't understand it).

   Watch the order of external definitions (ie, libraries) when more than
   one version of a routine may show up, eg "load".  The first one defined
   on the ld command line is the winner.  

   The getenv (and system and signal) problem is a problem that started out
   minor, got somewhat worse in 3003 and, eventually will be correctly fixed.
   Basically, you should extract the 3002 version of these three routines
   from xlf.a before doing the update and save them away, then link these
   routines in if you use these Fortran system services.  


------------------------------

3.03: How do I check if a number is NaN?
From: sdl@glasnost.austin.ibm.com (Stephen Linam)

NaN is "Not a Number".  It arises because the RISC System/6000 uses
IEEE floating point arithmetic.

To determine if a variable is a NaN you can make use of the property
that a NaN does not compare equal to anything, including itself.
Thus, for real variable X, use

	IF (X .NE. X) THEN	! this will be true if X is NaN

Floating point operations which cause exceptions (such as an overflow)
cause status bits to be set in the Floating Point Status and Control
Register (FPSCR).  There is a Fortran interface to query the FPSCR, and
it is described in the XLF Fortran manuals -- I don't have the manuals
right here, but look for FPGETS and FPSETS.

The IBM manual "Risc System/6000 Hardware Technical Reference - General
Information" (SA23-2643) describes what floating point exceptions can
occur and which bits are set in the FPSCR as a result of those exceptions.


------------------------------

3.04: Some info sources on IEEE floating point.

1. ANSI/IEEE STD 754-1985 (IEEE Standard for Binary Floating-Point
   Arithmetic) and ANSI/IEEE STD 854-1987 (IEEE Standard for
   Radix-Independent Floating-Point Arithmetic), both available from IEEE. 

2. David Goldberg, "What Every Computer Scientist Should Know About
   Floating-Point Arithmetic", ACM Computing Surveys, Vol. 23, No. 1,
   March 1991, pp. 5-48.

------------------------------

3.05: Why does it take so long to compile "hello world" with xlf? 

[read 2.07]

------------------------------

4.00: GNU and Public Domain software

GNU software comes from the Free Software Foundation and various other
sources. A number of ftp sites archive them. Read the GNU license for 
rules on distributing their software.

Lots of useful public domain software have been and continue to be ported
to the RS/6000. See below for ftp or download information.

------------------------------

4.01: How do I find sources?
From: jik@GZA.COM (Jonathan Kamens)

There is a newsgroup devoted to posting about how to get a certain
source, comp.sources.wanted.  An archive of information about sources,
including FTP sites is available from

------------------------------

4.02: Are there any ftp or WWW sites?

SMIT-installable precompiled packages of popular freeware for AIX 4.x at
<http://www-frec.bull.com/>.  Download the ".exe" files with your WWW
browser. These are auto-uncompressing files, just like on PCs (it uses
similar technology to PKZIP). Mark the file as executable (chmod +x),
then execute it to generate a .bff file. The .bff file can then be
installed using "smit install_latest". For more information
read the INSTALL.txt file on the server.

There are mirrors of this site at http://www.bull.de/ and
http://ftp.univie.ac.at/aix/.

The package explicitly referenced below are ones Ciaran consideres
"solid."  That is, the binary has been "tested by lots of people."

Bull provides many other freeware packages as well.  If you use the
service,  be sure and thank Ciaran and Bull.

Below are some ftp sites that are supposed to have RS/6000 specific
software.  I haven't verified all the entries.

US sites:
<ftp://aixpdslib.seas.ucla.edu/pub/>		128.97.2.211
<ftp://aix.boulder.ibm.com/>
<ftp://software.watson.ibm.com/>

European sites:
<ftp://nic.funet.fi/pub/unix/AIX/RS6000/>		128.214.6.100
<ftp://iacrs1.unibe.ch/pub/>			130.92.11.3
<ftp://ftp.zrz.TU-Berlin.DE/pub/aix/>		130.149.4.50
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>	129.104.3.60
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>		129.69.8.13

The first one is dedicated to software running on AIX.  It might not
always be the latest versions of the software, but it has been ported
to AIX (normally AIX version 3 only).  Please use the European sites
very sparingly.  They are primarily to serve people in Europe and most
of the software can be found in the US sites originally.

The remaining sites are simply ones that archie indicated contained
AIX related materials.

<ftp://ibminet.awdpa.ibm.com/>	#IBM announcements, oem hardware
<ftp://cac.toronto.ibm.com/>	#marketing-info
<ftp://ftp.egr.duke.edu/>
<ftp://straylight.acs.ncsu.edu/>
<ftp://alpha.gnu.ai.mit.edu/rs6000>
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>
<ftp://iacrs2.unibe.ch/pub/aix/>
<ftp://ftp.u.washington.edu/pub/RS6000/>
<ftp://aixive.unb.ca/>
<ftp://ftp.ans.net/pub/misc/>
<ftp://uvaarpa.virginia.edu/pub/misc/>
<ftp://ux1.cts.eiu.edu/pub/rs6000/>
<ftp://ftp.bsc.nopub/Src/>
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>
<ftp://aix1.segi.ulg.ac.be/pub/aix/>
<ftp://byron.u.washington.edu/pub/aix/>
<ftp://cunixf.cc.columbia.edu/aix/>
<ftp://files1zrz.zrz.tu-berlin.de/pub/aix/>
<ftp://ftp.rz.uni-augsburg.de/pub/aix/>
<ftp://fyvie.cs.wisc.edu/pub/aix/>
<ftp://solaria.cc.gatech.edu/pub/aix/>
<ftp://spot.colorado.edu/aix/>
<ftp://swdsrv.edvz.univie.ac.at/unix/systems/aix/>
<ftp://switek.uni-muenster.de/pub/aix/>
<ftp://wuarchive.wustl.edu/systems/aix/>
<ftp://cs.nyu.edu/pub/AIX/>
<ftp://karazm.math.uh.edu/pub/AIX/>
<ftp://minnie.zdv.uni-mainz.de/pub0/pub/AIX/>
<ftp://oersted.ltf.dth.dk/pub/AIX/>
<ftp://rs3.hrz.th-darmstadt.de/pub/incoming/AIX/>
<ftp://aeneas.mit.edu/pub/rs6000/>
<ftp://cameron.egr.duke.edu/rs6000/>
<ftp://ifi.informatik.uni-stuttgart.de/pub/rs6000/>
<ftp://metropolis.super.org/pub/rs6000/>
<ftp://ramses.cs.cornell.edu/pub/rs6000/>
<ftp://server.uga.edu/pub/rs6000/>
<ftp://uvaarpa.virginia.edu/pub/rs6000/>
<ftp://wayback.cs.cornell.edu/pub/rs6000/>
<ftp://alice.fmi.uni-passau.de/pub/RS6000/>
<ftp://byron.u.washington.edu/pub/aix/RS6000/>
<ftp://milton.u.washington.edu/pub/RS6000/>
<ftp://pascal.math.yale.edu/pub/RS6000/>
<ftp://uxc.cso.uiuc.edu/pub/RS6000/>

------------------------------
4.03: Why does "install"ing software I got from the net fail?

This answer was moved to section 2.22

------------------------------

4.04: GNU Emacs

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

If you get a segmentation fault in GNU EMACS 19.* during hilit19 use,
you can set locale to C (export LC_ALL=C) to get around the AIX bug.

Version 18.57 of GNU Emacs started to have RS/6000 support.  Use
s-aix3-2.h for AIX 3.2. Emacs is going through rapid changes recently.
Current release is 19.x.

Emacs will core-dump if it is stripped, so don't strip when you install
it.  You can edit a copy of the Makefile in src replacing all 'install -s' 
with /usr/ucb/install.

------------------------------

4.05: gcc/gdb

GNU C version 2.0 and later supports the RS/6000, and compiles straight
out of the box on AIX 3 and AIX 4.1 and 4.2.  You may, however,
experience that compiling it requires large amounts of paging space.

On AIX 4.3, compiling gcc appears to be much more difficult due to
changes for the 64 bit environment. A precompiled gcc is available in
the form of egcs in the Bull archive at <http://www-frec.bull.com/>.

From: Ciaran Deignan <Ciaran.Deignan@bull.net>

Note:
  - there is a link problem on AIX 4.3. Until I find a way of building
    a distribution on AIX 4.3, you'll have to use 'ld'.
  - The package gnu.egcs-1.1.0.0.exe does not contain the C++ compiler
    (G++). However since you can't link a G++ object file with 'ld',
    this is just part of the same problem.

[Editor's note: from the latest postings it appears that the latest
(post 1.1b) egcs snapshots fixes the problem with collect2. The problem
here is that there are no binary distributions yet, one has to bootstrap
this version using IBM's C compiler.]

From: Brent Burkholder <bburk@bicnet.net>

In order to compile and link using egcs on AIX you first
need to download and apply fix APAR IX87327
from
<http://service.boulder.ibm.com/cgi-bin/support/rs6000.support/downloads>
Looking up the APAR # should allow you to download
bos.rte.bind_cmds.4.3.2.2 which fixes all problems.

------------------------------

4.06: GNU Ghostscript 

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

The PostScript interpreter GNU Ghostscript Version 2.3 and later supports
the RS/6000 and can be found on various ftp sites. Current version is 2.6.1.

Compile time problems:
  Compile idict.c and zstack.c _without_ optimization, add the following
  to the Makefile:

  idict.o: idict.c
        $(CC) -c idict.c

  zstack.o: zstack.c
        $(CC) -c zstack.c

Run time problems:
  Running ghostview-1.5 with ghostscript-2.6.1, I get 
   gs: Malformed ghostview color property.
  Solution: replace buggy version of ghostscript-2.6.1 X11 driver
  with at least 2.6.1pl4 

------------------------------

4.07  TeX - Document processing
From: "Patrick TJ McPhee" <ptjm@ican.net>

TeX can be retrieved via ftp from the comprehensive TeX archive
network (CTAN). The principle sites are
ftp.tex.ac.uk (UK)
ftp.dante.de  (Deutschland)
ftp.tug.org  (USA)
but there are many mirrors. finger ctan@ftp.tex.ac.uk for a list.

------------------------------

4.08  Perl - Scripting language

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

If you want the source code, <http://www.perl.com/perl/> is good place
to start.

------------------------------

4.09: X-Windows

AIX 4.x ships with X11R5 and Motif 1.2.

On AIX 3.2 the base version has X11R4 and Motif 1.1 and the extended
version has X11R5 as AIXwindows 1.2.3.  See question 1.500 for more
information about determining your revision.

AIXwindows version 1.2.0 (X11rte 1.2.0) is X11R4 with Motif 1.1
AIXwindows version 1.2.3 (X11rte 1.2.3) is X11R5 with Motif 1.1
'lslpp -h X11rte.motif1.2.obj' should tell you if you are
running Motif 1.2.

------------------------------

4.10  Bash - /bin/ksh alternative from FSF

Bash is an alternative to ksh and is availible from prep.ai.mit.edu
and places that mirror the GNU software.  /etc/security/login.cfg
needs to be modified if this will be used as a default shell.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

------------------------------

4.11: Elm

A very nice replacement for mail. Elm should be pretty straightforward,
the only thing to remember is to link with -lcurses as the only
curses/termlib library. You may also run into the problem listed under
point 2.13 above.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

------------------------------

4.12: Oberon 2.2
From: afx@muc.ibm.de (Andreas Siegert)

Oberon is Wirth's follow on to Modula-2, but is not compatible. A free
version of Modula-3 is available from DEC/Olivetti at
gatekeeper.dec.com. This is not a Modula-2 replacement but a new
language. There are currently two M2 compilers for the 6000 that I
know of. One from Edinburgh Portable Compilers, +44 31 225 6262 (UK)
and the other from Gardens Point is availible through A+L in
Switzerland (+41 65 520311) or Real Time Associates in the UK
(info@rtal.demon.co.uk).

Oberon can be obtained via anonymous ftp from neptune.inf.ethz.ch
(129.132.101.33) under the directory Oberon/RS6000 or gatekeeper.dec.com
(16.1.0.2).

------------------------------

4.13: Kermit - Communications
From: Frank da Cruz <fdc@watsun.cc.columbia.edu>

Available for all versions of AIX on RS/6000, PowerPC, PS/2, RT PC,
and 370-Series mainframes.  For complete information on Kermit software
for AIX and hundreds of other platforms, visit the Kermit Web site:

  <http://www.columbia.edu/kermit/>

C-Kermit 6.0 was announced November 30, 1996:

  <http://www.columbia.edu/kermit/ck60.html>

The nonprofit Kermit Project is funded primarily by manual sales.
For C-Kermit 6.0 the manual is the new second edition of "Using C-Kermit":

  <http://www.columbia.edu/kermit/ck60manual.html>

For RS/6000 and PowerPC with AIX 3.x or 4.x:

  <ftp://kermit.columbia.edu/kermit/archives/cku192.tar.Z> (or .gz)

Uncompress, untar (tar xvf cku192.tar) then:

  make rs6aix32c  <--  For AIX 3.x
  make rs6aix41c  <--  For AIX 4.x

This produces an exutable called "wermit".  Before installing, read the
instructions in ckuins.doc from the tar file.

If you don't have a C compiler, you can get binaries at:

  <http://www.columbia.edu/kermit/ck60ubin.html>

Send questions to kermit-support@columbia.edu.

------------------------------

4.14: Gnu dbm
From: doug@cc.ysu.edu (Doug Sewell)

Here's the fixes for RS/6000's:

apply this to testgdbm.c:
158c158
<   char opt;
---
>   int opt;
166c166
<   while ((opt = getopt (argc, argv, "rn")) != -1)
---
>   while ((opt = getopt (argc, argv, "rn")) != EOF)

Apply this to systems.h:
111a112,114
> #ifdef RS6000
> #pragma alloca
> #else
112a116
> #endif

To compile, edit the Makefile.  Set CC to bsdcc (see /usr/lpp/bos/bsdport
if you don't have 'bsdcc' on your system) and set CFLAGS to -DRS6000 and
whatever options (-g, -O) you prefer.  Don't define SYSV.

------------------------------

4.15  tcsh - an alternative shell
From: cordes@athos.cs.ua.edu (David Cordes)

tcsh is available from <ftp://ftp.deshaw.com/pub/tcsh>
Compiles with no problems. You must edit /etc/security/login.cfg to
permit users to change to this shell (chsh), adding the path where the
shell is installed (in my case, /usr/local/bin/tcsh).

>From: "A. Bryan Curnutt" <bryan@Stoner.COM>

Under AIX 3.2.5, you need to modify the "config.h" file, changing
    #define BSDSIGS
to
    #undef BSDSIGS

------------------------------

4.16: Kyoto Common Lisp

The sources are available from cli.com. The kcl package is the needed
base; also retrieve the latest akcl distribution. akcl provides a
front-end that "ports" the original kcl to a number of different
platforms. The port to the 6000 worked with no problems. However, you
must be root for make to work properly with some memory protection
routines.

------------------------------

4.17  Tcl/Tk - X-Windows scripting

Current versions: Tcl 8.0b2 and Tk 8.0b2.  They are available from
<ftp://ftp.sunlabs.com/pub/tcl/>. The Tcl/Tk web page is at
<http://sunscript.sun.com/>.

Prebuilt installp (smit) installable packages for several versions of Tcl and
Tk are available from <http://www-frec.bull.com/>.

------------------------------

4.18: Expect
From: Doug Sewell <DOUG@YSUB.YSU.EDU>
   
To build the command-interpreter version, you must have the tcl library
built successfully. The expect library doesn't require tcl.  Note:
Expect and its library are built with bsdcc, so applications using
the library probably also need to be developed with bsdcc.

I ftp'd expect from ftp.cme.nist.gov.

You need to change several lines in the makefile.  First you need
to customize source and target directories and files:
#
TCLHDIR = /usr/include
TCLLIB = -ltcl
MANDIR = /usr/man/manl               (local man-pages)
MANEXT = l
BINDIR = /u/local/bin
LIBDIR = /usr/lib
HDIR = /usr/include
...
Next set the compiler, switches, and configuration options:
#
CC = bsdcc
CFLAGS = -O
...
PTY_TYPE = bsd
...
INTERACT_TYPE = select
...
Then you need to make these changes about line 90 or so:
comment out CFLAGS = $(CLFLAGS)
un-comment these lines:
CFLAGS = $(CLFLAGS) $(CPPFLAGS)
LFLAGS = ($CLFLAGS)

Then run 'make'.

You can't run some of the examples without modification (host name,
etc).  I don't remember if I ran all of them or not, but I ran enough
that I was satisfied it worked.

------------------------------

4.19: Public domain software on CD
From: mbeckman@mbeckman.mbeckman.com (Mel Beckman)

The Prime Time Freeware CD collection is a package of two CD's and docs
containing over THREE GIGABYTES of compressed Unix software. It costs $69
>from Prime Time Freeware, 415-112 N. Mary Ave., Suite 50, Sunnyvale, CA
94086. Phone 408-738-4832 voice, 408-738-2050 fax. No internet orders as
far as I can tell.

I've extracted and compiled a number of the packages, and all have worked
flawlessly so far on my 220. Everything from programming languages to 3D
solid modeling is in this bonanza!

[Ed: The O'Reilly book, Unix Power Tools, also contains a CD-ROM with lots
of useful programs compiled for the RS/6000, among other platforms.]

------------------------------

4.20: Andrew Toolkit

From: Gary Keim <gk5g+@andrew.cmu.edu>

The Andrew Toolkit Consortium of Carnegie Mellon University's School of
Computer Science has released new versions of the Andrew User
Environment, Andrew Toolkit, and Andrew Message System.

The Andrew User Environment (AUE) is an integrated set of applications
beginning with a 'generic object' editor, ez, a help system, a system
monitoring tool (console), an editor-based shell interface (typescript),
and support for printing multi-media documents. 

The Andrew Toolkit (ATK) is a portable user-interface toolkit that runs
under X11. It provides a dynamically-loadable object-oriented
environment wherein objects can be embedded in one another. Thus, one
could edit text that, in addition to containing multiple fonts, contains
embedded raster images, spreadsheets, drawing editors, equations, simple
animations, etc. These embedded objects can also be nested.

The Andrew Message System (AMS) provides a multi-media interface to mail
and bulletin-boards. AMS supports several mail management strategies
and implements many advanced features including authentication, return
receipts, automatic sorting of mail, vote collection and tabulation,
enclosures, audit trails of related messages, and subscription
management. It has interfaces that support ttys, personal computers, 
and workstations.

Release 5.1 of Andrew contains many bug fixes and updates. There is now
support for the new Internet MIME (Multipurpose Internet Mail Extensions)
standards for multipart, and multimedia mail. For more information on
MIME, please see the CHANGES files in the ftp directory on
emsworth.andrew.cmu.edu.

This release can be obtained as follows. The sources are available via
anonymous ftp from export.lcs.mit.edu (18.30.0.238) in the
./contrib/andrew tree. For details, see ./contrib/andrew/README.

PATCH for AIX3.2: A patch to the AUIS 5.1 sources can be ftp'ed from
emsworth.andrew.cmu.edu (128.2.45.40) in ./aixpatch. For those without
internet access, a 3.5" diskette can be ordered for a nominal fee of $10
by sending, or faxing, a purchase order to the Consortium address below.

Andrew, as well as a variety of other CMU software, can also be ftp'ed
>from emsworth.andrew.cmu.edu (128.2.30.62). Those with AFS access look
at /afs/andrew.cmu.edu/itc/sm/releases/X.V11R5/ftp.

Remote Andrew Demo Service 

This network service allows you to run Andrew Toolkit applications
without obtaining or compiling the Andrew software. You need a host
machine running X11 on the Internet. A simple "finger" command will let
you experience ATK applications firsthand. You'll be able to compose
multimedia documents, navigate through the interactive Andrew Tour, and
use the Andrew Message System to browse through CMU's three thousand
bulletin boards and newsgroups.

To use the Remote Andrew Demo service, run the following command:

    finger help@atk.itc.cmu.edu 

The service will give you further instructions.

Information Sources

Your bug reports are welcome; kindly send them to
info-andrew-bugs@andrew.cmu.edu and we will periodically post a status
report to the mailing list info-andrew@andrew.cmu.edu. To be added to
the mailing list or make other requests, send mail to
info-andrew-request@andrew.cmu.edu.

We also distribute the following related materials:

ATK and AMS sources and binaries on CDROM. Binaries are available
for the following system types: 

        	IBM RiscSystem/6000 
		Sun SparcStation 
		HP 700 Series 
		DECstation 

ATK and AMS sources on QIC and Iotamat tapes Hardcopies of the
documentation for ATK and AMS. Introductory video tape: Welcome to
Andrew: An Overview of the Andrew System. Technical video tape: The
Andrew Project: A Session at the Winter 1988 Usenix Conference.

More information about these materials is available from:

    Information Requests
    Andrew Toolkit Consortium
    Carnegie Mellon University
    4910 Forbes Avenue, UCC 214
    Pittsburgh, PA 15213-3890
    USA
    phone: +1-412-268-6710
    fax: +1-412-621-8081
    info-andrew-request@andrew.cmu.edu

There is also a netnews distribution list, comp.soft-sys.andrew, which
is identical to the info-andrew list except that it does not support the
multi-media capabilities of info-andrew.

------------------------------

4.21: sudo


Sudo (superuser do) allows a system administrator to give certain users (or
groups of users) the ability to run some (or all) commands as root while
logging all commands and arguments. Sudo operates on a per-command basis, it
is not a replacement for the shell. 

The latest version of sudo is cu-sudo v1.5.  There is a web page for sudo at
<http://www.courtesan.com/courtesan/products/sudo/sudo.html>.  The program
itself can be obtained from <ftp://ftp.courtesan.com/pub/sudo/>.  Sudo's
author, Todd Miller < Todd.Miller@courtesan.com> reports that sudo works on
both AIX 3.2.X and 4.1.X. 


------------------------------

4.22: Flexfax/HylaFax and other fax software

From: Christian Zahl <czahl@cs.tu-berlin.de>

Sam Leffler has released a new version of FlexFax called HylaFax.  It
is availible from <ftp://sgi.com/sgi/fax/>.  There is a HlyaFax web
page at <http://www.vix.com/hylafax/>.  Version V3.0pl1
supported many types of Class 1/2 fax modems and several UNIX systems
including AIX 3.2.3 or greater.  There is also a fax modem review
document at the same site as <ftp://sgi.com/pub/fax/bakeoff>. The FlexFax
related files on sgi.com are replicated on ftp.bsc.no as well.

>From: michael@hal6000.thp.Uni-Duisburg.DE (Michael Staats)

We're using mgetty+sendfax for the basic modem I/O, I wrote a printer
backend for the modem so that users can send faxes as easy as they print
postscript. I also wrote a little X interface composer to generate a
fax form that makes sending faxes very easy. You can find these
programs at hal6000.thp.Uni-Duisburg.DE under /pub/source.

program				comment

mgetty+sendfax-0.14.tar.gz	basic modem I/O, needs hacking for AIX
X11/xform-1.1.tar.gz	     	small and simple X interface composer
				with an example fax form. Needs
				libxview.a incl. headers.
faxiobe.tar.gz			fax backend, needs configuring for
				your local site

If you need a binary version of libxview.a and the headers you'll find
them under /pub/binaries/AIX-3-2/lxview.tar.gz.

------------------------------

4.23: lsof - LiSt Open Files

From: abe@purdue.edu (Vic Abell)

Q. How can I determine the files that a process has opened?
Q. How can I locate the process that is using a specific network address?
Q. How can I locate the processes that have files open on a file system?

A. Use lsof (LiSt Open Files).

From: "Juan G. Ruiz Pinto" <jgruiz@cyber1.servtech.com>

Lsof is available via anonymous ftp from
<ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/lsof.tar.Z>
(for the most current version). There are binary distributions in the
"binary" directory.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>. The installation scripts in this package
automatically creates a group "kmem" during the install
and uses "acledit" to allow the kmem group to read /dev/mem and /dev/kmem.
This configuration is recommended by Vic Abell <abe@purdue.edu>, the
author of lsof.

------------------------------

4.24: popper - POP3 mail daemon


The POP server is available via anonymous ftp from 
ftp.qualcomm.com:/quest/unix/servers/popper
  The makefile supports AIX
ftp.CC.Berkeley.EDU (128.32.136.9, 128.32.206.12).
  There are two versions in the pub directory: a compressed tar file
  popper-version.tar.Z and a Macintosh StuffIt archive in BinHex format
  called MacPOP.sit.hqx.

Problems building some versions of popper can sometimes be resolved by
compiling with bsdcc or -D_BSD.

The pine 3.95 package on <http://www-frec.bull.com/> contains "plug
and play" support for both POP3 and IMAP mail reading protocols.  You
can also get a compiled version of qpopper 2.2 there also.

------------------------------

4.26: mpeg link errors version 2.0

From: Nathan Lane <nathan@seldon.foundation.tricon.com>

.XShmCreateImage
.XShmDetach
.XShmAttach
.XShmGetEventBase
.XShmPutImage
.XShmQueryExtension

... are for the Shared Memory extension of the X server.
You can either choose to build it with shared memory or without.  I
always do it without the performance increase is not really
incredible, except on something like a 2x0 machine with the local bus
graphics adapter.  Just take out "DSH_MEM" in the CFLAGS in the
makefile for mpeg_play.  There is more information about shared memory
link errors in section 1.513.

Also, in the module "video.c" for mpeg_play it will complain about not
having enough memory to fully optimize one of the loops.  You can get
around that by specificying "qmaxmem=8000" in your cflags line, BUT,
the extra optimization does little good in my tests.

------------------------------

4.27: NNTP, INN


Link errors compiling nntp may occur because your machine lacks the
"patch" command.  Patch can be obtained from GNU repositories.  See question

4.29 for more information on patch.


------------------------------

4.28: Zmodem - File transfer

RZSZ is Chuck Forsberg's script for Z-modem. It is available by ftp at
<ftp://oak.oakland.edu/pub/unix-c/xyzmodem/rzsz9305.tar.Z> or
directly from Forsberg at Omen Technology BBS at 503-621-3746.

Hints:
0. Build with "make posix"
1. Use an 8-bit clean version of rlogin or telnet (Note: below)
2. Set the system to be transparent, I use "terminal download" 
3. Ensure hardware flow-control

Note, carlson@xylogics.com (James Carlson) suggests: Rlogin is
"slightly" unclean -- if an FF FF 73 73 appears in the datastream, it
can be ripped out by rlogind as a 'window size change' request.

[Ed note: The important part is using an 8-bit clean application,
since there are several implemenations of rlogin and telnet availible
you may need to try both and hunt down manuals to find the right flags
for your system]

------------------------------

4.29: Patch - automated file updates


AIX 3.2.5 does not ship with patch, a utility to apply the differences
between two files to make them identical.  This tool is often used to
update source code.

<ftp://ftp.x.org/pub/R6untarred/xc/util/patch/>
<ftp://prep.ai.mit.edu/pub/gnu/patch-2.1.tar.gz>

------------------------------

4.30: XNTP - network time protocol, synchronizes clocks

From: Joerg Schumacher <schuma@ips.cs.tu-bs.de>

   AIX 4:   xntpd in bos.net.tcp.client
   source:  ftp://ftp.udel.edu/pub/ntp/
   WWW:     http://www.eecis.udel.edu/~ntp/


------------------------------

4.31: GNU Screen and AIX 4.1.x


Once again,  binaries can be had from <http://www-frec.bull.com/>.

------------------------------

4.32: SCSI scanner software


There is the SANE project that strives to deliver an open source scanner
solution for Unix:

<http://www.mostang.com/sane/>

------------------------------

4.33: Pager/Paging software


There is information on Paging, Paging programs and  listing of the
Archive sites to download at the web site:
<ftp://ftp.airnote.net:/pub/paging-info/ixo.faq>.

HylaFAX (see 4.22) supports sending messages to alphanumeric pagers.

Commercially there is: AlphaPage(r) MD2001 from Information Radio
Technology, Inc. in Cleveland, OH. 

------------------------------

4.34: JAVA Development Kit

From: Curt Finch <curt@tkg.com>

<http://ncc.hursley.ibm.com/javainfo/>

------------------------------

4.35: Sendmail


<ftp://ftp.sendmail.org/sendmail/>

If you want to use SRC to start and stop BSD sendmail,  do the following 
after installing it:

chssys -s sendmail -S -n 15 -f 9 -a -d99.100

This tells SRC that sendmail may be stopped with signals 15 and 9.  It also
arranges for sendmail not to daemonize itself,  since it will run under SRC.

------------------------------

4.2 already has a similar feature.


------------------------------

1.149 How to install LPPs on a shared disk?
From: Ciaran Deignan <C.Deignan@frec.bull.fr>

I have an LPP that I want to install on all my AIX machines (for
example the "perl" freeware), but I want to minimize the disk-space
used on the network of machines. Can I selectively mount part of /usr
on another machine?

In general it is not possible to share an LPP with several machines.
Sometimes it is possible to use a dedicated filesystem to install
freeware which can then be shared.

However for anything packaged as an LPP it is possible to use
a script that replaces /usr/sbin/inurest, and that redirects files
delivered by the LPP to the shared disk.

One script that does this is called Ninstallp, and it is available
(with instructions) from
http://www.geocities.com/ResearchTriangle/5428/ninstallp.html

------------------------------

1.150 How can I reduce the size of /var/adm/wtmp ?

The file /var/adm/wtmp grows with each login, but is never reduced.
The contents of wtmp is used (only?) by the command "last",
which shows, in reverse order, all the logins and reboots that
happened since the start of the wtmp file.

The file should not be deleted, but the contents can be discarded using
the following command:
# > /var/adm/wtmp

Alternatively the freeware utility "tidysys" can remove all the entries
from wtmp that are older than (say) 15 days. Tidysys was written by
Terry Murray <terry@weavel.demon.co.uk> for AIX 3.2 and is available
from ftp://ftp.frontiernet.net/pub/aix/tsys220.tar.

Tidysys was ported to AIX 4.1 by C. Deignan and is available from
<http://www-frec.bull.com/>.

------------------------------

1.151: How do I start local daemons at system startup?

AIX does neither use the BSD style rc.local file nor the System V style
/etc/rc*.d startup files directories. To add local daemons to the system
startup sequence in a BSD rc.local style use the following command to
create an /etc/inittab entry:

# mkitab -i rcnfs "rclocal:2:wait:/etc/rc.local >/dev/console 2>&1"
# touch /etc/rc.local
# chmod 700 /etc/rc.local

Then put the command lines to start the daemons in /etc/rc.local.

------------------------------

1.152  How do I set the TZ variable to automatically change to
		daylight savings time?

The TZ variable can be set in /etc/environment file so the time
automatically switches to daylight savings time in spring and back to
normal in autumn. The actual rules when to switch vary by country, the
following should work in middle europe:

TZ=MET-1MET DST,M3.5.0/02:00:00,M10.5.0/03:00:00

The exact definition for the rules can be found with infoexplorer under
the environment page.

------------------------------

1.153  Why does init not reap its zombie child processes?

If you have lots of zombie (defunct) processes with parent process id 1,
the init process is probably waiting for some bad /etc/inittab
configuration line to finish. Check the inittab file for entries that
specify the wait keyword for processes that do not terminate. These
lines should probably specify "once" or "respawn" instead.

1.200: Some info about tape backups
From: Craig Anderson

The following supplements the information on rmt devices in
InfoExplorer. It is based on my own personal experience with IBM tape
drives running on AIX 3.1. No warranty is expressed or implied.

CONFIGURING THROUGH SMIT:
    BLOCK size (0=variable length)		(ALL)
	Sets the tape block size.  When reading, the block size must be
	set to the block size set when the tape was written.  When
	using some commands, tapes written with ANY block size can be
	read if the block size is set to 0 (variable length) (see
	"BLOCK SIZES" below).

    Use DEVICE BUFFERS during writes		(ALL)
	Set to yes, the device will buffer data internally on writes.
	This greatly improves performance, but under certain cases may
	be undesirable since the data is not written to tape before
	returning a good indication.

    Use EXTENDED file marks			(8mm only)
	Extended file marks take up much more space than short (or
	non-extended) file marks.  But extended file marks can be
	overwritten, allowing data not at the beginning of tape to be
	overwritten (see "FILE MARKS" below).

    RETENSION on tape change or reset		(1/4" only)
	If set to "no" then the tape will not be retentioned
	automatically when the tape is inserted.  Note that this will
	take effect only after the device is used.


FILE MARKS:
     Tape devices support multiple tape files.  Tape files are the
     result of a backup/cpio/tar/dd type command, where the device is
     opened, written to, and closed.  Because tapes allow large
     quantities of data to be written on a single tape, several backups
     (that is, tape files), may be combined on one physical tape.
     Between each tape file is a "tape file mark" or simply "file
     mark".  These file marks are used by the device driver to indicate
     where one tape file ends and another begins.

                              B       E
                   <-------   O       O   ------->
                              T       T
     physical | \            |       |      \             |physical
     beginning|  \           | tape  |       \            | end
       of     |   \          | file  |        \           |  of
      tape    |    \         | mark  |         \          | tape
              |_____\________|_______|__________\_________|
 
     Note that there is a distinction between the beginning of tape
     (BOT) side of a file mark and the end of tape (EOT) side of a file
     mark.  If the head is on the BOT side of a file- mark, "tctl fsf
     1" command will move only to the EOT side of the same file mark.

     With the 1/4" tape drive, writing can only take place
     sequentially, or after blank tape has been detected.  You cannot
     write over data on the tape (except at BOT).  If you wish to add
     data to a tape which has been written and then rewound you should
     space forward file mark until an error occurs.  Only then can
     you start writing again.

     With an 8mm tape drive, writing can only take place before blank
     tape, an EXTENDED file mark, or at BOT.  Thus if several backups
     have been made on one tape and you wish to overwrite one of the
     backups, position the tape to the place you wish to start writing
     and issue the following commands:
	tctl bsf 1
	tctl eof 1
     The first command skips back to the BOT side of the same file
     mark.  The second command rewrites the file mark (writing is
     allowed before extended file marks).  The erase head will erase
     data ahead of the write head, so that after writing the file mark
     the head will be positioned before blank tape.  Only after this
     may you start writing over data in the middle of the tape.  (All
     data beyond where you are currently writing will be lost).  Note
     that you cannot write over short file marks.  In order for this to
     work, the tape must have been written with extended file marks
     (use smit to change this).

     With the 9-track drive writing can take place anywhere on the
     tape although overwriting single blocks of data is not supported.

     On the 8mm drive extended filemarks use 2.2 megabytes of tape and
     can take up to 8.5 seconds to write.  Short filemarks use 184K
     and take up to 1.5 seconds to write.

BLOCK SIZES:
     When data is written to tape it is written in blocks.  The blocks
     on a tape are separated by inter-record gaps.  It is important to
     understand the structure of the written tape in order to
     understand the problems which can occur with changing block
     sizes.

     In fixed block size mode all blocks on the tape are the same
     size.  They are the size of the block size set in the device
     configuration.  All read()s and write()s to the tape drive must be
     a multiple of the fixed block size.

     In fixed block mode a read() will return as many blocks as needed
     to satisfy the read() request.  If a file mark is encountered
     while reading the tape only the data up until the file mark will
     be returned.

     It is not possible for the tape drive to read a tape whose block
     size is not the same as the block size in the device
     configuration.  (Unless the device configuration is in variable
     size blocks.)

     In variable block size (0) mode, the blocks written on the tape
     are the size of the read() and write() requests to the device
     driver.  In this case, the actual block sizes on the tape can be
     changed using the options to the backup commands (tar -C, cpio -C,
     backup -C).

     In variable mode, read() requests greater than size of the block
     on the tape will return only the data from the next block on the
     tape.  It is this feature that allows tapes written in any block
     size (fixed or variable) to read with the dd command (the output
     from the dd command may be piped to restore, tar, or cpio for
     example.)  Note that backup, tar, and cpio cannot read all tapes
     by using a large block size because they assume there is an error
     if they get a short read().
		dd ibs=128k obs=16k if=/dev/rmt0 | ...

     The tape head is always positioned at an inter-record gap, file
     mark, or blank tape after reading or writing.

     With the 8mm tape drive, using a fixed block size which is not a
     multiple of 1K is inefficient.  The 8mm tape drive always writes
     internally in 1K blocks.  It simulates the effect of variable
     block sizes, but, for example, using a fixed block size of 512
     bytes (or using variable block size and write()ing 512 bytes at a
     time) wastes one half of the tape capacity and gives only one half
     the maximum transfer rate.

     To figure out a tape's actual block size try:

     1). Set the tape to variable block size.
     2). "dd if=<tape> of=/tmp/dummy bs=128k count=1"
     3). "ls -l /tmp/dummy"
     4). The number of bytes in "/tmp/dummy" is the physical block size.

EXCHANGING DATA WITH NON-UNIX AND OTHER VENDORS MACHINES:
     Many tape drives support both variable and fixed block sizes.

     Variable block mode writes block sizes the size of the write
     command issued (tar and backup specify this with the -b option). 
     In fixed mode, block sizes are fixed and all writes must be a
     multiple of the fixed block size.

     Unix often internally chops larger reads and writes up into
     manageable pieces (often 65535, 65534, or 65532 bytes) before
     doing the actual reads and writes.  This means reads and writes of
     64K bytes are often broken up into a 65535 byte record and a 1
     byte record (In fixed mode the write will fail).  Block sizes >=
     64K (-C128 and greater) should be avoided for this reason.  AIX
     does not break up read and write requests, but be aware of the
     situation on other machines.

     If the tape is written in an unknown block size then set the
     device configuration in smit to use variable size blocks, use the
     "dd" command with a large input block size, and pipe it to the
     restore command.  For example:
	  chdev -l rmt0 -a block_size=0
	  dd if=/dev/rmt0 ibs=128k obs=16k | tar -tvf-

------------------------------

1.201: How do I do remote backup?

There seems to be several ways of doing this.  The first approach is a
one-liner to allow tar to reference another machine's device.  The
second is more complete but uses a similar approach.  The latest
addition to this section claims to be able to support mksysb on a
remote machine.  Thanks to all the contibutors.

  tar -b1 -cf - . | rsh REMOTEHOST "dd ibs=512 obs=1024 of=/dev/TAPEDEVICE"

[Ed.: The usave.sh script has been moved to section 8.06.  I've verified
this script works fine. However, it may be slow for large filesystems
since it creates a temp file of filenames in /tmp.]

There are also several commercial solutions.  One is IBM's SYSBACK/6000
product.  See Question 1.209 for more information.

Open Microsystems sells a product called DistribuTAPE which supports
mksysb to a remote tape drive under AIX 3.2, 4.1 and 4.2.  DistribuTAPE
supports remote tape drives by placing a pseudo tape driver on the
client system, and a server daemon on the server.  More information at
http://www.openmic.com/

------------------------------

1.202: How do I backup a multi-disk volume group?
From: pack@acd.ucar.edu (Daniel Packman)

[ Ed.: I have not verified this procedure. I would actually recommend
  NOT to have one volume group span multiple disks unless you really
  need such big logical volumes. ]

  1. If you have a set of three or more disks in a volume group
     (typically 3 for 5xx machines with three internal drives;
     with only two, the procedures outlined here have to be modified
     to ignore the fact that you don't have a quorum in the volume group)

  2. If one drive has failed (usually only one fails at a time :-) )

It is possible to go through a service boot (the volume group is called
rootvg and one of the 2 good disks on it is called hdisk0):

  importvg -y rootvg hdisk0
  varyonvg -f -n -m1 rootvg

These commands will work, but give error messages. If you wish to mount
a user filesystem, say /u on logical volume /dev/lv00, then

  mount -f /dev/lv00 /v

will work only if jfslog, the journaled file system log device, is not
on the damaged disk. If it is, you must (and can in any case) mount the
filesystem read-only:

  mount -f -r /dev/lv00 /v

This crucial and rather obvious point baffled several level 3 support
personnel at Austin as well as myself for almost a week. Once the file
system(s) of interest are available, they can be saved to tape for
restoration later. Of course, one can expect only about two thirds of a
filesystem to be recoverable if it spans all 3 physical disks. One
other point to remember is that the standard boot procedure from floppy
includes the restore command but does not include the backup command.

*****************************************************************************
* If you do not have other RS6000 machines at your site it is imperative    * 
* that you either build a bootable tape which includes either restore or    * 
* tar or cpio (a bootable floppy set will not have enough space) or at the  *
* very least copy onto a spare floppy backup, cpio, or tar.  The floppy     *
* should be created with backup -ivq so that its contents can be read into  *
* the memory resident system after booting.                                 *
*****************************************************************************

All is not lost if tar, cpio or backup are available on an undamaged
disk that can be mounted. Since tar and cpio are in /bin, they may both
very well be unavailable.

It is a very good idea for those who have tape devices to build a
bootable tape with their desired extra commands in it. Follow the
instructions from IBM but add your desired commands to the following
three files:

    /usr/lpp/bosinst/tape2
    /usr/lpp/bosinst/diskette/boot2
    /usr/lpp/bosinst/diskette/inslist

If you have anything other than a minimum memory configuration, you
should be able to add many commands.

------------------------------

1.203: How do I put multiple backups on a single 8mm tape?
From: kerm@mcnc.org (Cary E. Burnette)

There are two possible solutions to this, both of which use /dev/rmt0.1
which is non-rewinding.

SOLUTION #1
-----------

To put multiple backups on a single tape, use /dev/rmt0.1, which is a
no-rewind device, using either rdump or backup (both by name & inode
work). Using rdump or backup "byinode" both generate the message that
the tape is rewinding but actually do not. This is an example that
works on my system:

# rsh remote1 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
# rsh remote2 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
# tctl -f /dev/rmt0.1 rewind       # rewinds the tape

where I am implementing the command from host.

# restore -f /dev/rmt0.1 -s1 -tv

where the -s1 flag tells restore to go to the first record on the tape. 
Type the exact command again to get the second record. The -s(Number)
means go to Number record from this spot. It works pretty well.


SOLUTION #2
-----------
Steve Knodle, Educational Resources Center, Clarkson University

I use:
------------------- Dump.sh --------------------
CONTENTSFILE=`date |dd conv=lcase |sed -e 's/19//' |awk '{print $6 $2 $3}'`
set -x
LEVEL=$1
shift

backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /
backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /usr
backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /u
tctl -f /dev/rmt0 rewind

touch /usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /usr" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /u" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
tctl -f /dev/rmt0 rewind

I process the table-of-contents first by a little program that does
common prefix encoding, and then compress.

is reused.


Solution #3
-----------
   mount | grep jfs | cut -c27- | cut -d" " -f1 | \
     xargs -i backup -${LEVEL} -u -f /dev/rmt1.1 {} > ${DATE}.backup 2>&1

------------------------------

1.204: How can I make an exact duplicate of a tape over the network?

The challenge here is not to have to create a temporary file (disk space
limitation) and work across heterogeneous networks.

This script might work:

LOCAL=/dev/tape_dev
REMOTE=/dev/tape_dev
dd if=$LOCAL ibs=64k obs=512 | rsh remote_host dd ibs=512 obs=64k of=$REMOTE


From: pack@acd.ucar.edu (Daniel Packman)

Daniel provides the following perl script to convert from the known
world's function codes to AIX for compatibility.

#!/bin/perl
# Wrapper to convert input rmt requests to
# AIX 3.2 ioctl numbers.  We pass on all commands we don't understand
# I0 MTWEOF -> I10  STWEOF write and end-of-file record
# I1 MTFSF  -> I11  STFSF  forward space file
# I2 MTBSF  -> I12  STRSF  reverse space file
# I3 MTFSR  -> I13  STFSR  forward space record
# I4 MTBSR  -> I14  STRSR  reverse space record
# I5 MTREW  -> I6   STREW  rewind
# I6 MTOFFL -> I5   STOFFL rewind and unload tape
# I7 MTNOP  -> I0   (no-op? should ignore following count)
# I8 MTRETEN-> I8   STRETEN retension tape, leave at load point
# I9 MTERASE-> I7   STERASE erase tape, leave at load point
#I10 MTEOM (position to end of media ... no ibm equivalent?)
#I11 MTNBSF  (backward space file to BOF ... no ibm equivalent?)
@iocs = (10,11,12,13,14,6,5,0,8,7);
open(RMT,"|/usr/sbin/rmt") || die "Can't open pipe to rmt\n";
select(RMT);
$| = 1;
while (<STDIN>) {
  s/(^I)(\d$)/I$iocs[$2]/;
  exit 0 if $_ =~ /^[Qq]/;
  print RMT $_ ; }
exit 0;

------------------------------

1.205: What is tape block size of 0?
From: benson@odi.com (Benson I. Margulies)

Tape devices are generally split into two categories: fixed block and
variable block.  1/4" tape is the fixed block, and 8mm is variable.

On a fixed block size device, the kernel always sends data to the device
in suitable block size lumps, and varying the size passed to write(2)
(e.g., via the bs option to dd) gives the kernel more data to stream. 
On a variable block size device, the kernel writes to the device
whatever passed to it. On an 8mm, it had better be a multiple of 1024
to get efficient tape usage.

AIX has the World's Only Variable Block Size 1/4" tape drive. If you
use SMIT to set the block size to a nonzero value, AIX treats the device
as fixed block size, whether it is or not. By default, 8mm drives are
set to the same size as 1/4", 512 bytes. This is wasteful, but
otherwise mksysb and installp would fail.

If you set the block size to 0, the device is treated as variable block
size, and the size passed to write becomes the physical block size. 
Then if you use a sensible block size to dd, all should be wonderful.

------------------------------

1.206: Resetting a hung tape drive
From: Craig_Anderson@kcbbs.gen.nz (Craig Anderson)

A process accesses the tape drive. The process stops, exits, or whatever,
but still hold on to the drive. When this happens, the process cannot be
killed by any signal and the tape drive cannot be used by any other
process until the machine is rebooted.

The following should help:

RESET:

AIX, like most UNIX systems has no reset function for tape drives. You
can however send a Bus Device Reset (a standard SCSI message) to the
tape drive using the following piece of code. If the tape drive does
not respond to the BDR, then a SCSI Bus Reset will be sent (and this
will reset every device on the SCSI Bus). SCSI Bus resets are rather
extreme so you should refrain from using this program unnecessarily. 
But there are times (like after you've inserted a jammed/old/bad tape in
an 8mm drive), when there's no other way to reset the device other than
to shutdown and reboot (obviously you can power down and up an external
drive to reset it - and this would be the better choice).

This is actually documented in info, but can be hard to find and
there's no complete program.

/* taperst: resets the tape drive by sending a BDR to the drive. */
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/scsi.h>

int main(int argc, char **argv)
{
         /* This can be run only by root */

         if (argc != 2) {
             fprintf(stderr, "Usage: %s /dev/rmt#\n", argv[0]);
             return 1;
         }

         if (openx(argv[1], O_RDONLY, 0, SC_FORCED_OPEN) < 0) {
             perror(argv[0]);
             return 2;
         }
         return 0;
}

------------------------------

1.207: How do I restore specific files from a mksysb tape?
From: Marc Pawliger (marc@sti.com)

To recover specific files from a backup made with mksysb, try
$ tctl fsf 3
$ tar xvf /dev/rmt0.1 ./your/file/name

From: Matt Willman (Willman.matt@cnf.com)

The procedure changed with AIX 4, which uses backup instead of tar to
write the tape. For AIX 4 the procedure is as follows:

$ tctl fsf 3
$ restore -xvf /dev/rmt0.1 ./your/file/name

------------------------------

1.208: How do I read a 5Gbyte tape on a 2Gbyte drive?
Posted by: bobmet@clam.com (Robert Metcalf)

To read a 5Gbyte tape on a 2Gbyte drive, the
tape needs to have been created with a density setting of 20.

The following is from IBM's electronic ASKSUPPORT repository:
  
   R: The 7208 011 5 GB tape drive has various density settings which are
      as follows:
  
     +-------+--------------------------+
     | DENSIT| DESCRIPTION              |
     | SETTIN|                          |
     +-------+--------------------------+
     | 140   | Writes in 5.0GB mode and |
     |       | will enable data com-    |
     |       | pression; also, to do    |
     |       | compression you must use |
     |       | "DATA COMPRESSION = yes" |
     +-------+--------------------------+
     | 21    | Writes in 5.0GB mode and |
     |       | will NOT do data com-    |
     |       | pression                 |
     +-------+--------------------------+
     | 20    | Writes in 2.3GB mode and |
     |       | will NOT do data com-    |
     |       | pression                 |
     +-------+--------------------------+
     | 00    | Factory power-on default |
     |       | for 5.0GB data com-      |
     |       | pression mode            |
     +-------+--------------------------+
  
     The density setting of the 7208 011 must be 20 for it to make a tape
     that is readable by the 7208 001.


------------------------------

1.209: What can Sysback do for me?
From: johnsont@austin.ibm.com (Tony Johnson)

Sysback provides the flexibility of restoring onto the same system in
the exact same manner, or onto a completely different system with
differnet disk configuration, platform type, kernel, etc, while
reporting any inconsistencies and allowing you to adjust to fit. For
instance, you will get warnings if a particular volume group cannot be
created because the original disks to not exist, or that mirroring
cannot be accomplished because there is no longer enough disk space
because the disks are smaller. You can then select the disks for each
volume group, reduce or add space to filesystems and LVs, exclude
entire VGs or filesystems, etc.  You can even add and delete mirrors,
stripe or un-stripe logical volumes, etc.

In addition, all of the Sysback functions can be performed across the
network, including network boot and network install, and you can
perform striped backups across multipel tape drives, use sequential
tape autoloaders, and perform unattended multi-volume backups with
cron.

ON AIX 3.2, mksysb does not retain paging space config, disk LV
placement, mirroring, etc.

On AIX 4.1, it does these on an EXACT same configuration, but does not
allow any flexibility, and still does not retain non-rootvg volume
groups (although you can now use additional commands to backupa nd
restore these).  mksysb also does not allow you to clone onto
different platforms (i.e.  rspc -> rs6k -> rs6ksmp).


------------------------------

1.210: How can I get my HP 4mm DAT to work?

For HP25470/80A DDS:
   MRS disabled: Set switches 3,6,7,8=0 and 1,2,4,5=1
   MRS enabled:  Set switches 3,6,7=0 and 1,2,4,5,8=1

------------------------------

1.211: How do I copy DAT tapes?

If you have two drives try tcopy(1).  Otherwise the traditional UNIX
approach is ( dd if=/dev/rmt0 bs=1024b | dd of=/dev/rmt1 bs=1024b )
Put that in a while loop using a non-rewinding device to do multiple
files.  To use drives from two different machines either get the GNU
dd (bundled with GNU tar) or use something like.

  $ dd if=/dev/rmt0 bs=1024b | rsh hostname dd of=/dev/rmt0 bs=1024b


------------------------------

1.212: How do I speed up backups to DLT tapes?

DLT tapes need high data rates to stay in streaming mode. To achieve
higher data rates, use a variable length block size by setting the fixed
length block size to zero. Also use a buffer size of about 64KB for
backup (128 blocks for tar).

------------------------------

1.300: Some info about the memory management system
From: Michael Coggins (MCOG@CHVM1.VNET.IBM.COM).

1. Does AIX use more paging space than other unix systems?

Under many scenarios, AIX requires more paging space than other unix
systems. The AIX VMM implements a technique called "early allocation of
paging space". When a page is allocated in RAM, and it is not a
"client" (NFS) or a "persistent" (disk file) storage page, then it is
considered a "working" storage page. Working storage pages are commonly
an application's stack, data, and any shared memory segments. So, when
a program's stack or data area is increased, and RAM is accessed, the
VMM will allocate space in RAM and space on the paging device. This
means that even before RAM is exhausted, paging space is used. This
does not happen on many other unix systems, although they do keep track
of total VM used.

Example 1: 
Workstation with 64mb RAM is running only one small application that
accesses a few small files. Everything fits into RAM, including all
accessed data. On AIX, some paging space will already be used. On
other unix systems, paging space will be 100% free. Clearly, this is an
example that shows where we use more paging space than the other machines.

Example 2:

Same machine as above, except we are in an environment where many
applications are running with inadequate RAM. Also, the system is
running applications that are started, run, left idle, and not in
constant use. A session of FRAME running in a window, for example. 
What happens is that eventually (theoretically) all applications will be
paged out at least once. On the AIX system and the other systems the
total paging requirements will be the same (assuming similar malloc
algorithm). The major difference is that the AIX system allocated the
paging space pages before they were actually needed, and the other
systems did not allocate them until they were needed. However, most
other systems have an internal variable that gets incremented as virtual
memory pages are used. AIX does not do this. This can cause the AIX
system to run out of paging space (virtual memory), even though malloc()
continues to return memory. This "feature" allows sparse memory
segments to work, but requires that all normal users of malloc()
(sbrk()) know how much virtual memory will be available (actually
impossible), and to handle a paging space low condition. A big problem. 
There are some pretty obvious pros and cons to both methods of doing
Virtual Memory.

2. How much paging space do I need?

Concerning the rule of thumb of having 2 times RAM for paging space:
this is rather simplistic, as are most rules of thumb.  If the machine
is in a "persistent storage environment", meaning that they have a few
small programs, and lots of data, they may not need even as much as 1
times RAM for paging space.  For example, a 1GB database server running
on a 6000 with 256MB of RAM, and only running about 50MB of "working"
storage does not need 512MB of paging space, or even 256MB.  They only
need the amount of paging space that will allow all their working
storage to be paged out to disk.  This is because the 1GB database is
mostly "persistent storage", and will require little or no paging space. 
Excessive paging space may simply mean wasted disk space.  However,
avoid insufficient paging space.  Tip: Don't have more than one paging
space per disk.  Tip: Put lots of RAM in your system - it will use it.

3. Why does vmstat show no free RAM pages?

AIX uses RAM as a possibly huge disk buffer.  If you read a file in the
morning, that file is read into RAM, and left there.  If no other
programs need that RAM, that file will be left in RAM until the machine
is halted.  This means that if you need the file again, access will be
quick.  If you need that RAM, the system will simply use the pages the
file were using. The pages were flushed back to disk earlier.  This
means that you can get a huge speedup in disk access if you have enough
RAM.  For example, a 200MB database will just ease into RAM if you have
a 256MB system.

4. Since vmstat shows no free RAM pages, am I out of RAM?

Probably not. Since disk files will be "mapped" into RAM, if vmstat
shows lots of RAM pages FREE, then you probably have too much RAM (not
usual on a RISC System/6000)!

5. Shouldn't the "avm" and the "fre" fields from vmstat add up to something?

No. The "avm" field tells you how much "Active Virtual Memory" AIX
thinks you are using. This will closely match the amount of paging
space you are using. This number has *ABSOLUTELY* nothing to do with
the amount of RAM you are using, and does *NOT* include your mapped
files (disk files).  The amount of RAM can be determined with
/usr/sbin/bootinfo -r

6. Why does the "fre" field from vmstat sometimes show lots of free
   RAM pages?

This will happen after an application that used a lot of RAM via
"working" storage (not NFS storage, and not disk file or "persistent"
storage) exits. When RAM pages that were used by working storage (a
program's stack and data area) are no longer needed, there is no need to
leave them around. AIX completely frees these RAM pages. The time to
access these pages versus a RAM page holding a "sync'd" mapped file is
almost identical. Therefore, there is no need to periodically "flush" RAM.

7. Is the vmstat "fre" field useful?

The vmstat "fre" field represents the number of free page frames.  If
the number is consistently small (less than 500 pages), this is normal. 
If the number is consistently large (greater than 4000 pages), then you
have more memory than you need in this machine.

------------------------------

1.301: How much should I trust the ps memory reports?
From: chukran@austin.VNET.IBM.COM

Using "ps vg" gives a per process tally of memory usage for each running
process.  Several fields give memory usage in different units, but these
numbers do not tell the whole story on where all the memory goes.

First of all, the man page for ps does not give an accurate description
of the memory related fields.  Here is a better description:

RSS - This tells how much RAM resident memory is currently being used
for the text and data segments for a particular process in units of
kilobytes.  (this value will always be a multiple of 4 since memory is
allocated in 4 KB pages).

%MEM - This is the fraction of RSS divided by the total size of RAM for
a particular process.  Since RSS is some subset of the total resident
memory usage for a process, the %MEM value will also be lower than actual.

TRS - This tells how much RAM resident memory is currently being used
for the text segment for a particular process in units of kilobytes. 
This will always be less than or equal to RSS.

SIZE - This tells how much paging space is allocated for this process
for the text and data segments in units of kilobytes.  If the executable
file is on a local filesystem, the page space usage for text is zero. 
If the executable is on an NFS filesystem, the page space usage will be
nonzero.  This number may be greater than RSS, or it may not, depending
on how much of the process is paged in.  The reason RSS can be larger is
that RSS counts text whereas SIZE does not.

TSIZ - This field is absolutely bogus because it is not a multiple of 4
and does not correlate to any of the other fields.

These fields only report on a process text and data segments.  Segment
size which cannot be interrogated at this time are:

       Text portion of shared libraries (segment 13)

       Files that are in use. Open files are cached in memory as
       individual segments.  The traditional kernel cache buffer
       scheme is not used in AIX 3.

       Shared data segments created with shmat.

       Kernel segments such as kernel segment 0, kernel extension
       segments, and virtual memory management segments.

Speaking of kernel segments, the %MEM and RSS report for process zero
are totally bogus for AIX 3.1.  The reason why RSS is so big is that the
kernel segment zero is counted twice.  For AIX 3.2, this has been
changed, but the whole story is still not known.  The RSS value for
process 0 will report a very small number of the swapper private data
segment.  It does not report the size of the kernel segment 0, where the
swapper code lives.

In summary, ps is not a very good tool to measure system memory usage. 
It can give you some idea where some of the memory goes, but it leaves
too many questions unanswered about the total usage.

------------------------------

1.302: Which simms do RS6000's use?

This answer is under construction... I'm trying to collect details
about compatable simms.

RS/6000 220,230 USE 2 pair 70ns PS/2 style simms
RS/6000 250,C10 USE 4 pair 70ns PS/2 style simms

------------------------------

1.303: What is kproc?

kproc (always PID 514 on AIX 3 and PID 516 on AIX 4) is the kernel's
idle process.

------------------------------

1.304: How do I create a RAM disk in AIX?
From: Jeff Wang <hjiwa@nor.chevron.com>

You can't create a RAM disk in AIX.  The closest related functionality
the operating system gives you is the RAM disk buffer. Read 1.300
sub-section 3.

------------------------------

1.305: How much RAM (real memory) does my machine have?
From: Michael Abel/resnova
	<Michael_Abel/resnova%RESNOVAD@notesgw.compuserve.com>

As     root:  bootinfo -r
As any user:  lsattr -E -l sys0 -a realmem

lsdev -C -c memory

shows all memory adapters.  On MCA systems one may add up the values
displayed for each memory card in order to sum up to the amount of
total memory.  On PCI systems only one item (mem0) is
displayed. Additional information may be displayed with

lsattr -E -lmem0

These commands were tested on various IBM systems running AIX relases
3.2.5 and 4.1.4

------------------------------

1.306: Why do PIDs run non-sequentially?
From: Julianne F. Haugh <jfh@austin.ibm.com>

The answer (I was there, consider me an authority ...) is that the
PIDs needed to be somewhat unpredictable.  This is because AIX was
originally designed with a number of C2 and B1 features, and one of those
is the notion of covert channel analysis.  Sequential PIDs are a covert
channel (assuming the system has one PID namespace ...) since the value
of the "next" PID is shared by all currently running processes.  So if I
want to sneak some of my classified data out to your co-operating
non-classified program, I can do it by carefully controlling the value
of the "next" PID.

------------------------------

1.400: How do I make an informative prompt in the shell?

In the Korn Shell (ksh), the PS1 variable is expanded each time it is
printed, so you can use:

$ export myhost=`hostname`
$ PS1='$LOGNAME@$myhost $PWD \$ '

to get, e.g. 

bengsig@ieibm1 /u/bengsig $

In the C-shell, use:

% set myhost=`hostname`
% alias cd 'chdir \!* > /dev/null; set prompt="$LOGNAME@$myhost $cwd % "'
% cd

to get, e.g.

bengsig@dkunix9 /u/bengsig/aixfaq %

There is no easy solution in the Bourne Shell.  Use the Korn Shell instead.

------------------------------

1.401: How do I set up ksh for emacs mode command line editing?

The ksh has an undocumented way of binding the arrowkeys to the emacs
line editing commands. In your .kshrc, add:

alias __A=`echo "\020"`   # up arrow = ^p = back a command
alias __B=`echo "\016"`   # down arrow = ^n = down a command
alias __C=`echo "\006"`   # right arrow = ^f = forward a character
alias __D=`echo "\002"`   # left arrow = ^b = back a character
alias __H=`echo "\001"`   # home = ^a = start of line

Type "set -o emacs" or put this line in your .profile.

Also, you MUST have PTF U406855 for this to work in AIX 3.2.  The APAR #
for the problem is IX25982, which may have been superseded.

------------------------------

1.402: Listing files with ls causes a core dump
From: Julianne F. Haugh <jfh@austin.ibm.com>

Scenario: a directory that is shared by N users (N >= 200).
Run 'ls -l' in that directory.  It goes for a while, then
Seg fault(coredump)!

It only occurs when the usernames are displayed (almost every file is
owned by a different person).  The -g and -n options work fine; only -l
and -o (which shows owner and not group) cause it. 

I believe that this problem was corrected by U407548.  If you have that
many users that you are having core dump problems (it took over 200),
you might also want to look into getting the PTF that fixes IX31403. 
That APAR deals with large numbers of accounts and performance problems
associated with looking them up.

------------------------------

1.403: How do I put my own text into InfoExplorer?

With AIX 3.1, you cannot do it.  AIX 3.2 has a product called
InfoCrafter that allows you to do that.

------------------------------

1.404: InfoExplorer ASCII key bindings 
From: mycroft@hal.gnu.ai.mit.edu (Charles Hannum)

If you just press 'Return' when it starts up, with 'Basic Screen
Operations' highlighted, you'll get some help.

If you look long enough, you'll find a page named 'Using Keys and Key
Sequences in the InfoExplorer ASCII Interface'.  It describes the key
sequences and actions.  Here are a few to get you started.

Keys       Action

Ctrl-W     Moves between the Navigation screen and the Reading screen.
If the Navigation screen is displayed, you can press Ctrl-W to display
the Reading screen.  If the Reading screen is displayed, you can press
Ctrl-W to display the Navigation screen.

Ctrl-O     Makes the menu bar active or inactive.  If your text cursor is
located in the text area of the screen, you can press Ctrl-O to make the
menu bar active.  If the menu bar is already active, you can press
Ctrl-O to make it inactive, which moves the text cursor to the text area.

Tab     Moves to the next menu bar option in the menu bar.  If a pull-down
menu is not displayed and you press the Right Arrow key, the next menu
bar option is displayed in reverse video.
 
------------------------------

1.405: How can I add new man pages to the system?
From: horst@faui63.informatik.uni-erlangen.de (Horst Luehrsen)

Put the man pages in /usr/man, e.g. /usr/man/man1/tcsh.1 for the tcsh
man page.  Under AIX 3.1.10, /usr/lib/makewhatis can be used to update
the makewhatis-database /usr/man/whatis so apropos and whatis know about
the added manpages.  /usr/lib/makewhatis should be available on all 3.2
versions.

For AIX 4.x, you can store the man pages in the /usr/share/man hierarchy.
/usr/lib/makewhatis is still there.

------------------------------

1.406: Why can't I read man pages?  Where is nroff?

Nroff and troff aren't in the base installation.  It is shipped as
part of AIX 3.2.5 but may not be installed.  Use smit to install a
software package called txtfmt.tfs.obj from your 3.2.5 distribution
media.

In AIX 4.x, you need bos.txt.tfs.

------------------------------

1.407: Why is my environment only loaded once?

The .profile file is only loaded once (for your login shell) subsequent
shells should be initialized by setting ENV=$HOME/.kshrc (for ksh).

Bash users can use $HOME/.bash_profile for the login shell environment
and $HOME/.bashrc.

------------------------------

1.408: Where is the 'nawk' command on my AIX system?
From: Jeff Wang <hjiwa@nor.chevron.com>

The /bin/nawk that exists on many UNIX flavors is a superset of the
'awk' command, revised by the same original authors to include added
functionality.  All the extra options normally associated with 'nawk'
on other UNIXes have been incorporated into the AIX version of 'awk';
the AIX 'awk' InfoExplorer or man pages include nawk-specific features
such as the "-v" command line option and atan2(), rand(), srand(),
match(), sub(), gsub(), system(), close(), getline functions.

If your AIX version is missing /bin/nawk (as are most AIX 3.x
versions), the simplest way to get around this and maintain script
portability between UNIX platforms is to make a /bin/nawk link to
/bin/awk (as root, of course).  If you do not have root privilege or
do not want to create a /bin/nawk link, to make the script work on
different UNIXes, you may have to test `uname` first and set all
'nawk' references on AIX runs to /bin/awk.  If your script is to only
run on AIX systems, you can just change all references of 'nawk' to
'awk' and everything should still work okay...but check the AIX awk
script on test data prior to making actual runs.

[Editor's note: AIX 4.x already contains a link from /usr/bin/nawk
to /usr/bin/awk.]

------------------------------

1.409: How do I copy InfoExplorer (manpages and more) to my hard drive?
From: David Alexander <unilink@online.rednet.co.uk>

[Editor's note: While this is documented in one of the AIX manuals
and covered in /usr/lpp/bos/bsdadm (AIX 3 only), it comes up often
enough I thought I would include it here.]

Not all the Info databases are required, so do not copy them all unless the 
customer specifically requests them, or has asked for the software they 
refer to.  These instructions assume you have enough space on /usr.

	Install and mount the InfoExplorer CD-ROM as for use of Info 
	from CD-ROM.

	Log in as Root
	umount /usr/lpp/info/lib/$LANG
	mkdir /mnt/$LANG
	mount -v cdrfs -r /dev/cd0 /mnt/$LANG

	cd /
	cd /mnt/$LANG
	cp -r aix /usr/lpp/info/lib/$LANG
	cp -r aix2 /usr/lpp/info/lib/$LANG
	cp -r compnav /usr/lpp/info/lib/$LANG
	cp -r hardware /usr/lpp/info/lib/$LANG
	cp -r nav /usr/lpp/info/lib/$LANG
	cp -r prog /usr/lpp/info/lib/$LANG
	cp -r uiprog /usr/lpp/info/lib/$LANG

	Other sections can be copied if required:
	Section						Size
	cp -r ada /usr/lpp/info/lib/$LANG		7.2  Mb
	cp -r assemb /usr/lpp/info/lib/$LANG		5.23 Mb
	cp -r cxx /usr/lpp/info/lib/$LANG		6.52 Mb
	cp -r dce /usr/lpp/info/lib/$LANG		3.8  Mb
	cp -r encina /usr/lpp/info/lib/$LANG		2.67 Mb
	cp -r fortran /usr/lpp/info/lib/$LANG		6.85 Mb
	cp -r graph /usr/lpp/info/lib/$LANG		9.75 Mb
	cp -r graph2 /usr/lpp/info/lib/$LANG		4.1  Mb
	cp -r pascal /usr/lpp/info/lib/$LANG		3.23 Mb

	umount /mnt/$LANG
	eject the CD-ROM

------------------------------

1.410: Why can't I set my default shell to one we've just installed?

When adding new shells to the system, add them to the "shells=" line
in /etc/security/login.cfg so they can be used during ftp and rlogin
by users who use them as their default shell.

------------------------------
 
1.411: Why do I get the "Unable to connect socket: 3"
                starting Info-Explorer?

It's a bug in the way infod sets the initial permission on the            
/tmp/.info-help socket. Do a chmod 777 on /tmp/.info-help and the
message will go away. (Charlie McGuire, mcguire@cs.umt.edu)

This problem was fixed by APAR IX43230, PTF U432315
(Paul Sitz, psitz@empros.com)

------------------------------

1.412: Why can't I write a setuid shell script?
From: mww@microfocus.com (Michael Wojcik)

AIX, as of about the first release of 3.2.5* does not allow SUID scripts.
(It ignores the SUID and SGID bits on scripts.)  They're a huge security
hole.

If you really want to run a script SUID, you can create a small C program
that does a setuid(0) and then system()'s your script.  (Actually, the
setuid() call isn't necessary on all Unixes; IIRC, it's not on AIX 3.2.5,
but YYMV.)  Make the program SUID.  Be very careful.

There are other similar solutions.  You might also want to look into
sudo, which handles this sort of thing in a somewhat more controlled
manner

* Julianne Frances Haugh (jfh@tab.com) writes:

I raised an objection to set-ID shell scripts before AIX 3.1 was
golden.  ... it was finally done in the 3009 PTF for AIX 3.1.

------------------------------

1.500  Which release of X11 do I have?

AIX 4.x includes X11 R5 and Motif 1.2.

On AIX 3, Run 'lslpp -h X11rte.obj'.
If your output has a line similar to:

            01.02.0000.0000 COMPLETE   COMMIT     03/04/93   02:05:11 root

you have X11 R4. If your output has a line similar to:

    U491068 01.02.0003.0000 COMPLETE   COMMIT     07/28/93   12:50:42 root

you have X11 R5. Some people also call these AIXwindows 1.2.0 and
1.2.3.  'lslpp -h X11rte.motif1.2.obj' should tell you if you are
running Motif 1.2.

From: Jan Just Keijser <KeijserJJ@logica.com> 

AIX 4.1 and AIX 4.2 come with X11R5 and Motif 1.2.4

AIX 4.3.1 (and perhaps 4.3.0) comes with X11R6.1 and Motif 2.1

Some executables which run fine using the X11R5 libraries may not run
when using the X11R6.1 libraries; you can specify which X11 libraries to
use by setting
  LIBPATH=/usr/lpp/X11/lib/R5:/usr/lib:...
for X11R5 and
  LIBPATH=/usr/lpp/X11/lib/R6:/usr/lib:...
for X11R6.1; by default,
    /usr/lib/libX11.a -> /usr/lpp/X11/lib/R6/libX11.a
and also for the other libraries on AIX 4.3.1.

On most of the AIX 4.1.x and 4.2.1 boxes I have seen the default is
  /usr/lib/libX11.a -> /usr/lpp/X11/lib/R4/libX11.a
ie the default libraries are the X11R4 libraries and _NOT_ the R5
libraries; this may also be due to the setup at my site.

------------------------------

1.501: How to prevent ctrl-alt-backspace from killing the X session

Start X with 'xinit -T' to disable ctrl-alt-backspace from stopping X.

------------------------------

1.502: Who has a termcap/terminfo source for the HFT console?

The console used on the RISC System/6000, PS/2 and RT can be used as a
terminal on another system with the termcap below.  You can find this
and other termcaps in /lib/libtermcap/termcap.src, including IBM
specific ones.  The terminfo sources are stored in /usr/lib/terminfo/*.ti.
This termcap can also be used from an aixterm window.

hf|hft|hft-c|ibm8512|ibm8513|IBM_High_Function_Terminal:\
	:co#80:li#25:am:ht:\
	:cm=\E[%i%d;%dH:ti=\E[25;1H:te=\E[20h:\
	:nd=\E[C:up=\E[A:do=^J:ho=\E[H:\
	:bs:sf=\E[S:ec=\E[%dX:\
	:cl=\E[H\E[J:cd=\E[J:ce=\E[K:\
	:AL=\E[%dL:DL=\E[%dM:al=\E[L:dl=\E[M:\
	:im=\E[4h:ei=\E[4l:mi:\
	:dm=\E[4h:ed=\E[4l:\
	:so=\E[7m:se=\E[m:ul=\E[4m:ue=\E[m:\
	:md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:\
	:as=^N:ae=^O:sc=\E[s:rc=\E[u:\
	:kl=\E[D:kb=^H:kr=\E[C:ku=\E[A:kd=\E[B:kh=\E[H:\
	:kn#10:k1=\E[001q:k2=\E[002q:k3=\E[003q:k4=\E[004q:k5=\E[005q:\
	:k6=\E[006q:k7=\E[007q:k8=\E[008q:k9=\E[009q:k0=\E[010q:\
	:is=\Eb\E[m^O\E[?7h:rs=\Eb\E[m^O\E[?7h\E[H\E[J:

------------------------------

1.503: How can I look at PostScript files?  Why is "dpsexec" so lousy?
From: Marc Pawliger <marc@sti.com>

showps comes with the 1.2.3 (X11R5) version of the X11rte.ext.obj LPP.
Very nice PS file previewer from Adobe.  Replaces xpsview which came
with pre-1.2.3 Installed as /usr/lpp/DPS/showps/showps

From: VRBASS@ATLVMIC1 (Vance R. Bass)

You can look at PostScript files using either "xpreview" (in the
optionally installable text formatting services) or you can get
Ghostscript and Ghostview from a comp.sources.x server and build it
yourself.

>From the "xpreview" man page:
The xpreview command is an AIXwindows 1.2- and Motif 1.1-based
application that displays output from the troff command on an AIXwindows
display.  The troff command output file must be prepared for any one of
the devX100, devX100K or devpsc devices.  The xpreview command also
displays PostScript language files that begin with %!.

"dpsexec" is NOT intended to be a full-service document browser, but
rather a simple DPS code debugger.  If you insist on using it, you can
edit your PS code to remove the "showpage" (which will reset dpsexec
and clear the window) to view single-page files.  It does not handle
multi-page files gracefully.

------------------------------

1.504: unix:0 vs `hostname`:0

1.) Is there any way to get the machine to check its local host table
    first without renaming resolv.conf?

[AIX 3.2 only]
PTF U412845 implements an environment variable to set the resolver
time out in AIX 3.2.  This allows you to set RES_TIMEOUT to the number
of seconds before it times out, a failing a DNS query the machine will
consult /etc/hosts.  

2.) How do you tell X applications where you are if the console display 
    is unix:0?

From: David L. Crow <crow@waterloo.austin.ibm.com>

  I would suggest that if you have R5, use ":<display>.<screen>".  I do
  not believe that R4 clients will understand :0, so I would suggest
  unix:0 for them.

  Without specifying unix or the hostname, you will get the fastest
  transport mechanism.  While currently there are only two transport
  methods in the AIXwindows X server (Unix sockets and TCP sockets),
  many vendors are looking at using shared memory as a transport method. 
  If you use :0 (or :0.0 or :1, etc.), then you should get the best
  performance regardless of the available transport methods.

From: Marc Pawliger <marc@sti.com>

  Using "unix:0" or "hostname:0" when the X11 Shared Memory Transport
(SMT) is installed as part of the 1.2.3 X11rte.obj (X11R5) will incur
a penalty vs. using ":0" See /usr/lpp/X11/README.SMT

3.) Is there a significant performance penalty incurred by using
    `hostname`:0 as DISPLAY?

  Yes! Using unix:0, you are using Unix sockets.  These are much faster
  than their TCP socket counterparts.

------------------------------

1.505: VT100 key bindings for aixterm
From: haedener@iac.unibe.ch <Konrad Haedener>

Add this to your .Xdefaults file and start your VAX session with
'aixterm -v -name vt100 -e telnet MYVAXHOST'

-----
vt100.vt102: true
vt100.fullcursor: false
vt100.translations:    <Key>F1: string(0x1b) string("OP") \n\
                       <Key>F2: string(0x1b) string("OQ") \n\
                       <Key>F3: string(0x1b) string("OR") \n\
                       <Key>F4: string(0x1b) string("OS") \n\
                       <Key>KP_0: string(0x1b) string("Op") \n\
                       <Key>KP_1: string(0x1b) string("Oq") \n\
                       <Key>KP_2: string(0x1b) string("Or") \n\
                       <Key>KP_3: string(0x1b) string("Os") \n\
                       <Key>KP_4: string(0x1b) string("Ot") \n\
                       <Key>KP_5: string(0x1b) string("Ou") \n\
                       <Key>KP_6: string(0x1b) string("Ov") \n\
                       <Key>KP_7: string(0x1b) string("Ow") \n\
                       <Key>KP_8: string(0x1b) string("Ox") \n\
                       <Key>KP_9: string(0x1b) string("Oy") \n\
                       <Key>KP_Divide: string(0x1b) string("OQ") \n\
                       <Key>KP_Multiply: string(0x1b) string("OR") \n\
                       <Key>KP_Subtract: string(0x1b) string("OS") \n\
                       <Key>KP_Add: string(0x1b) string("Om") \n\
                       <Key>KP_Enter: string(0x1b) string("OM") \n\
                       <Key>KP_Decimal: string(0x1b) string("On") \n\
                       <Key>Next: string(0x1b) string("Ol") \n\
                       <Key>Left: string(0x1b) string("OD") \n\
                       <Key>Up: string(0x1b) string("OA") \n\
                       <Key>Right: string(0x1b) string("OC") \n\
                       <Key>BackSpace : string(0x7f) \n\
                       <Key>Down: string(0x1b) string("OB")

You should also add

XENVIRONMENT=$HOME/.Xdefaults
export XENVIRONMENT

to your .profile.

------------------------------

1.506: Is there a screen saver that does not use excessive CPU?
From: Don Buchholz <buchholz@ese.ogi.edu>

Try using xlock with these options:

	xlock -mode life -count 1500 -nice 20 -root


From: pranav@evolving.com (Pranav Vakil)

Use mlock -hide to hide the background. You can also modify the mlock
(/usr/local/tools/mlock) code to allow the standard X screen saver to
take effect. The timeout value is originally set to 0 which means the
screen saver is off. Modify this to be 120 (2 minutes) and set the
interval time to be 60 (1 minute). Using these intervals, I have found
that over a 24 hour period, it uses only .3 cpu minutes.

------------------------------

1.507: Where are the colors, available for an X session, listed.

/usr/lpp/x_st_mgr/bin/rgb.txt and on AIX 4.2, the file is
/usr/lpp/X11/lib/X11/rgb.txt

------------------------------

1.508: Why does my app hang the X server but not an X station?
From: Bjorn P. Brox <brox@corena.no>

/usr/lpp/X11/README.SMT X client/server communication uses a 64k
buffer by default.  The size of this buffer is controled by the
X_SHM_SIZE environment variable increasing the size of the buffer has
been used to prevent some applications from hanging the X server :)

------------------------------

1.509: How do I switch the control and caps lock key bindings?

If you are running the X window system, you can put the following into
.xmodmaprc

  remove Lock = Caps_Lock
  remove Control = Control_L
  keysym Control_L = Caps_Lock
  keysym Caps_Lock = Control_L
  add Lock = Caps_Lock
  add Control = Control_L

Hidden Hint: Use (xmodmap -e "pointer = 3 2 1") to make the mouse
lefty friendly.

------------------------------

1.510: Missing fonts?

If your Xserver supports X11R5 try running a font server (edit
/usr/lib/X11/fs/config and run fsconf && startsrc -s fs) Consult your
Xserver instructions on how to include a font server in your font
path.

------------------------------

1.511: What's the termcap entry for an IBM 3151 look like?

#
# Written by Aleksandar Milivojevic, alex@srce.hr
# 24.09.1994
#
I2|ibm3151|3151|IBM 3151 terminal:\
	:am:mi:cr=^M:sf=^J:co#80:li#24:cd=\EJ:ce=\EI:cm=\EY%+\040%+\040:\
	:cl=\EH\EJ:dc=\EQ:dl=\EO:do=\EB:le=\ED:mb=\E4$a:md=\E4(a:\
	:me=\E4@\E>B:mr=\E4!a:nd=\EC:se=\E4>b:so=\E4!a:ue=\E4=b:up=\EA:\
	:us=\E4"a:kb=^H:kd=\EB:kh=\EH:kl=\ED:kr=\EC:ku=\EA:\
	:k1=\Ea\r:k2=\Eb\r:k3=\Ec\r:k4=\Ed\r:k5=\Ee\r:\
	:k6=\Ef\r:k7=\Eg\r:k8=\Eh\r:k9=\Ei\r:k0=\Ej\r:\
	:ti=\E>B:te=\E>B:ms:ho=\EH:bl=^G:al=\EN:ta=^I:

------------------------------

1.512: Errors starting X11 application binaries from aixpdslib.
From: <URL:ftp://aixpdslib.seas.ucla.edu/pub/README_X11R5_Stuff>

We have been aware of the problem people have with dynamic links
when running the prebuilt of X-stuffs from this library.

The typical error messages will be:

    Could not load program [program_name]
    Member shr4.o not found or file not an archive
    Member shr4.o not found or file not an archive
    Could not load library libXt.a[shr4.o]
    Error was: No such file or directory

It's because that we built the programs using X11 libraries of MIT
which are not compatible with those of IBM.  If this is the case,
then please get the compressed tarred file of the source code instead,
and recompile them on your system using your libraries.

------------------------------
1.513: .XShm*, .sm* (Shared memory) Link errors building 
                 Xwindows applications.

Link errors that refer to .XShm* often times are a result of compiling
applications to take advantage of the Shared Memory extension of the X
server.  You may either compile without shared memory or load the
shared memory extensions. (see /usr/lpp/X11/README and README.SMT) A
script for rebuilding your X server with the shared memory can be found
in /usr/lpp/X11/Xamples/server.

------------------------------

1.514: How do I set my DISPLAY when I login to another machine?

Though this is not a question specific to AIX, it appears often enough
to warrant an answer here.  There are lots of approaches, some of which
are described in the X Windows FAQ.  Most involve a little login shell
programing to parse the output of `who` or `who am i`.
<URL:ftp://boogle.uchicago.edu/pub/aix/src/hostwhence.tar.Z> by
e-siebert@uchicago.edu will help if you are willing/able to install it
suid.  See the X Windows FAQ and newsgroup for more information.

Hostwhence is also availabile in the "lsof" smit-installable package on
www-frec.bull.com. The installation scripts use ACLs to allow hostwhence to
read /dev/kmem without being set-uid-root.

------------------------------

1.515:  Why doesn't Netscape work?
From: "Gary R. Hook" <hook@austin.ibm.com>

The problem is that Netscape has statically linked libc into 
Mozilla.  When the AIX 3 libc code (setlocale()) tries to
load an AIX 4 locale, the two are incompatible and a core
dump ensues.  AIX 4 locales have to be loaded by AIX 4 libc.
Using LANG=C causes a lot of locale code to be bypassed, allowing
the application to avoid loading a non-C locale, and to continue
execution.

>From: Colin <apollo@randomc.com>
Here is a shell script that works around Netscape's problems by
setting the LANG and CLASSPATH environment variables.

#!/bin/sh
LANG=C
CLASSPATH=/path/to/java_30
export LANG CLASSPATH
if [ $# -eq 0 ]; then
   /path/to/netscape http://your.home.page &
else
   /path/to/netscape $* &
fi

------------------------------

1.600: My named dies frequently, why?
From: jpe@ee.egr.duke.edu (John P. Eisenmenger)

Running on 3.2, named dies frequently on network's primary name server.


Try the following:

     stopsrc -s named		# stop running named
     setenv MALLOCTYPE 3.1	# use 3.1 memory allocation algorithm
     /etc/named ...		# don't use smit to start named

You might be able to use startsrc/smit after setting MALLOCTYPE and get
the same effect, but I'm not sure.

[According to John, the problem is malloc() in the named code. He
 also suggests using Berkeley's bind, which he has ported and can be
 ftp'ed from ftp://ftp.egr.duke.edu/archives/bind-4.8.3.tar.gz. -ed]

Two ptfs should fix this problem. Get U412332 and U414752.

Christophe Wolfhugel <Christophe.Wolfhugel@grasp.insa-lyon.fr> reports
that bind 4.9 works fine on AIX 3.2 and without MALLOCTYPE=3.1.

------------------------------

1.601: How do I trace ethernet packets on an AIX system?
From: afx@muc.ibm.de (Andreas Siegert)

Do the following:

     iptrace -i en0 /tmp/ipt

The iptrace backgrounds.  Find its process id and kill it when you are
ready.  Then run

     ipreport -rns /tmp/ipt >/tmp/ipr

and look at the output.  The current version of Info does not document
the r, n and s options but they are quite useful for layering the output.

------------------------------

1.602 What is the authorized way of starting automount at boot time?
From: curt@ekhadafi.austin.ibm.com (Curt Finch)

I put this in my /etc/inittab:

automount:2:once:/usr/etc/automount -T -T -T -v >/tmp/au.se 2>&1

I hereby dub it authorized.

Jim Salter <jsalter@netscape.com> writes: You can also use the command:
'mkitab "automount:2:once:/usr/etc/..."' to avoid editing the file by hand.

------------------------------

1.603: How do I set a tty port for both dial-in and dial-out?

Set the mode of the tty to be either 'shared' or 'delayed'. 

------------------------------

1.604: How to move or copy whole directory trees across a network

The following command will move an entire directory tree across a network 
while preserving permissions, uids and gids.

      $rsh RemoteHost "cd TargetDir; tar -cBf - ." | tar -xvBf -

Explanation:

The tar-create is rsh'd to the remote system and is written to
stdout (the pipe).

The local system is extracting the tar that is being read from
stdin (the pipe).

From: abeloni <abeloni@hstern.com.br>

Another method is:

	rcp -rp host1:/dir host2:/dir

------------------------------

1.605: How can I send mail to hosts that cannot be pinged?
From: jupiter.sun.csd.unb.ca!dedourek (John DeDourek)

AIX 3.2 as shipped is configured to only send mail to mail addresses
which include a host name.  Many organizations use a mail address whose
"host name" part is not a host name (technically an MX name).  To change
the configuration of the AIX mailer, login as root.  Then edit the file
/etc/sendmail.cf to remove the comment marker ("# ") at the beginning of
the line which reads:
    # OK MX

Now rebuild the machine readable form of the configuration with
    sendmail -bz

and finally restart signal sendmail to load the new configuration by one
of the following:
     reboot
or
     stopsrc -s sendmail
     startsrc -s sendmail
or 
     kill -1 `cat /etc/sendmail.pid`


1.606: How to configure dialup SLIP

IBM's WWW page <http://www.ibm.com/> can lead you to a helpful document
<http://www.austin.ibm.com/pub/www/services/aix_service/faxes/SLIP.DOC.zap>

From: marvin@tornado.oche.de (Christian Bode)

If you don't have problems with slattach you should have PTF 
bos.obj 3.2.0.0.U411505 installed.  I assume that you did the right
ifconfig commands to setup your slip-device (for example sl0).

1. Create a group called slip.

2. Create a user slip with smit like this:
                                                     [Entry Fields]
* User NAME                                          [slip]
  ADMINISTRATIVE User?                                true
  User ID                                            []
  LOGIN user?                                         true
  PRIMARY group                                      [slip]
  Group SET                                          [slip]
  ADMINISTRATIVE groups                              [system]
  SU groups                                          [slip]
  HOME directory                                     [/home/slip]
  Initial PROGRAM                                    [/bin/sh]
  User INFORMATION                                   [SLIP-Dialup]
  Another user can SU to user?                        false
  User can RLOGIN?                                    true
  TRUSTED PATH?                                       nosak
  Valid TTYs                                         [/dev/tty1]
  AUDIT classes                                      []
  PRIMARY authentication method                      [SYSTEM]
  SECONDARY authentication method                    [NONE]
  Max FILE size                                      [2097151]
  Max CPU time                                       [-1]
  Max DATA segment                                   [262144]
  Max STACK size                                     [65536]
  Max CORE file size                                 [2048]
  Max physical MEMORY                                [65536]
  File creation UMASK                                [022]
  EXPIRATION date (MMDDhhmmyy)                       [0]

3. Create a tty with getty on it:
                                   Add a TTY
                                               [Entry Fields]
  TTY type                                     tty
  TTY interface                                rs232
  Description                                  Asynchronous Terminal
  Parent adapter                               sa0
* PORT number                                  [s1]
  BAUD rate                                    [38400]
  PARITY                                       [none]
  BITS per character                           [8]
  Number of STOP BITS                          [1]
  TERMINAL type                                [dumb]
  STATE to be configured at boot time          [available]
  DMA                                          on
  Read Trigger                                 0,1,2,3
  Transmit buffer count                        [16]
  Name of initial program to run               [/etc/getty]

  Note: The following attributes are only applicable if /etc/getty is
        specified as the initial program to run.

  Enable program?                              respawn
  Run level                                    2
  Enable LOGIN                                 share
  TIME before advancing to next port setting   [0]
  STTY attributes for RUN TIME                 [hupcl,cread,brkint>
  STTY attributes for LOGIN                    [hupcl,cread,echoe,>
  RUN shell activity manager                   no
  Optional LOGGER name                         []

4. Change the hardware characteristics so that it uses NO XON/XOFF handshake
   section 1.613 also talks about tty flow control.

5. A (new) .profile template for slip accounts is provided in section
   8.07.  The author, David Migliavacca, writes, "I would also like to
   assert that, to my experience, it is NOT required that the SLIP user
   be made "administrative" or member of "system" as other parts of the
   FAQ (and the original script) say.  At least on my machine 8-).  I now
   create SLIP users as members of group slip, it being the ONLY group;
   allowed ttys are set to the available modem lines only; their home
   directory is owned by root and the .profile is only readable by group
   slip.

Here's another scenario:
From: oosten@angelo.ee.ualberta.ca (Brian Oostenbrink)

Operating System: IBM AIX 3.2.1 and 3.2.3

Configuring two RS6000s via a Serial Line Interface Protocol (SLIP) 
connection over two US Robotics Sportster 14,400 modems.

The AIX implementation of SLIP is slightly different from most others. 
The ifconfig command is used to bring up a serial interface, and the
slattach command is used to connect the interface to the serial port
used for the connection.  Dialer device commands can also be issued when
invoking the slattach command, using UUCP chat syntax.

The following describes a connection between two machines:

     local.j.k.l
         ethernet IP address 129.128.127.21
         slip interface IP address 129.1.2.1

     remote.a.b.c
         ethernet IP address 129.11.22.44
         slip interface address 129.11.22.1

1. Interface configuration

Each machine must have a separate IP address dedicated to the SLIP
interface. On remote.j.k.l, start the SLIP interface with:

         ifconfig sl0 129.11.22.1 129.128.127.1  up

and on local.a.b.c:

         ifconfig sl0 129.128.127.1 129.11.22.1  up

It is important in later versions of AIX 3.2.3+ to use the same SLIP
interface # as the ptty port #, ie. if you use tty12, use ifconfig sl12
instead of sl0.

At this point the interfaces are ready to be connected.

2. tty configuration
   The tty ports on both machines were configured in an identical manner
   using smit.
                                                 [Entry Fields]
 TTY type                                           tty
 TTY interface                                      rs232
 Description                                        Asynchronous Terminal
 Parent adapter                                     sa0
 PORT number                                        []                       +
 BAUD rate                                          [38400]                  +
 PARITY                                             [none]                   +
 BITS per character                                 [8]                      +
 Number of STOP BITS                                [1]                      +
 TERMINAL type                                      [dumb]
 STATE to be configured at boot time                [available]              +
 DMA                                                on                       +
 Read Trigger                                       0,1,2,3
 Transmit buffer count                              [16]                      #
 Name of initial program to run                     [etc/getty]

 Note: The following attributes are only applicable if /etc/getty is specified
 as the initial program to run.

 Enable program?                                    respawn
 Run level                                          2
 Enable LOGIN                                       disable                  +
 TIME before advancing to next port setting         [0]                      +#
 STTY attributes for RUN TIME                       [hupcl,cread,brkint,icr>
 STTY attributes for LOGIN                          [hupcl,cread,echoe,cs8,>
 RUN shell activity manager                         no                       +
 Optional LOGGER name                               []

On older versions of AIX, we encountered some problems disabling getty, and
resorted to changing the /etc/inittab file directly. For example, change

   tty0:2:respawn:/etc/getty /dev/tty0
to
   tty0:2:off:/etc/getty /dev/tty0

This will disable getty from running. After creating the SLIP tty device,
you will need to change its hardware configuration to disable Xon/Xoff
flow control. Software flow control should not be used for SLIP. Type
'smit chtty', and then select sub item 2: Hardware settings.

Most of the parameters in the tty configuration are the defaults.

3. Modem Configuration

   The modems were configured as follows:

   RTS/CTS flow control enabled.
   Xon/Xoff software flow control disabled. Usually this is automatic if
      RTS/CTS is enabled.
   Data rate, terminal to modem = fixed.
      This is the baud rate from the tty port to the modem. We used a
      fixed modem-port transfer rate, set to the fastest speed supported
      by both the tty port and the modem. Newer modems can use a higher
      transfer rate between the modem and serial port than the modem to
      modem rate, which is necessary to use data compression effectively.  
      In our setup, we used 14.4 kBaud modems with a port speed of 38.4
      kBaud. If your modem supports this feature, use it, otherwise set
      the port speed equal to the modem connection rate. On the USR
      Sportster at&b1 fixes the serial port rate to that of the last
      AT command. The speed parameter of the slattach command can be
      used to ensure that this rate is that set in the tty configuration.
   Error Correction enabled - not mandatory, but a good idea
   Data Compression - not required, but it helps, especially for text
      transfers.
   Auto Answer - If the SLIP connection is to be initiated from either
      machine, both modems should be set to auto answer, otherwise, just
      the answering modem.

   It is a good idea to configure the modem and then save the settings
   to NVRAM, so that the correct settings can always be restored by the
   slattach command.

4. UUCP configuration files

   /usr/lib/uucp/Devices
   /usr/lib/uucp/Dialers

   The Devices file must contain an entry with the tty and serial port
   speed used for the interface. In our example,
      Direct tty0 38400 slipdialer

   The keyword 'slipdialer' is merely an index into the Dialers file.
   For our purposes, the slipdialer entry in the Dialers file is simply:

      slipdialer

   This entry can also contain UUCP chat commands, or the chat commands
   can be included in the slattach command.

5. slattach invocation

   slattach connects the device on the tty port to the SLIP interface
   created by ifconfig, and sends any commands to the tty device if
   needed. For our example, remote.j.k.l would never initiate a call,
   only answer incoming calls. Therefore we execute:

         slattach tty0 38400 '"" ATZ OK ""'

   which connects the tty at 38400 baud. We could also simply run

         slattach tty0

   ie. without any modem commands, but the modem to port speed may not
   be correctly set this way. In addition, the ATZ command ensures the
   modem is set to the NVRAM settings.

   On local.a.b.c type:

         slattach tty0 38400 '"" ATZ OK \pATDT4925871 BIS ""' 4

   This establishes the link at 38400 baud, and executes the dial string
   as shown. The dial string is a UUCP chat string and are configured
   in an expect send expect send ... format. The string:

         '"" ATZ OK \pATDT4925871 BIS ""'

   is interpreted as:
   expect "" (null string) from modem
   send   ATZ              to modem
   expect OK               from modem
   send   \pATDT4925871    to modem
   expect BIS              from modem

   BIS is the end of the CONNECT STRING. You could use any portion of
   the string returned by the modem upon a connection as the expect
   string. It may be wiser to simply expect CONNECT since all
   connections should return this string.
   The null strings are necessary because the first parameter of the
   UUCP is an expected string from the modem, which can only be a null
   string until the modem has been given a command.

   The last parameter (4) of the slattach command is the debug level. 
   A debug level of 4 displays the UUCP chat strings, which is useful
   for checking the modem status.

6. Routing
   ifconfig is sufficient if all you want to do is talk between the
   two hosts.  If you are running SLIP so that you can talk to more
   than just that one other host you have to advertise your address.
   
   1) arp -s 802.5 iago 10:00:5a:b1:49:d8 pub
        where 802.5 is a token-ring network the hardware address can
        be obtained with `netstat -v` and iago was the SLIP client (My
        PC at home :)  pub is the important part it means "published"
        You may want to run this at boot time. 

   Routing through the SLIP link is similiar to routing of any gateway. 
   Invoking the ifconfig command automatically sets up a route between
   the two SLIP machines. An entry in /etc/hosts or the named database
   should be made, with the same machine name used for the SLIP address
   as the ethernet address on each machine. For example, in /etc/hosts
   on remote.a.b.c (and any other machine on remote.a.b.c ethernet):

     129.11.22.44 remote.a.b.c # ethernet address
     129.11.22.1  remote.a.b.c # slip address

   It is preferable to place the ethernet address in the hosts file
   before the SLIP address so remote.a.b.c will resolve to the
   ethernet address. When using named, it is important to have both
   addresses in the reverse file with the same name. We experienced
   difficulties with NFS mounting over the slip link, owing to some
   machine interpreting NFS requests from one of the two SLIP machines
   as coming from the SLIP address, while the SLIP machine believed it
   was sending the request from the ethernet address. This problem was
   eliminated by having both addresses reverse resolve to the same name.

7. Performance
   At a modem speed of 14.4 kBaud and a port speed of 38.4 kBaud, we
   realized a transfer rate through ftp of about 3.5 kB/s for text
   files, and 1.3 kB/s for compressed files.

------------------------------

1.607: Where is DCE discussed?

DCE is the Distributed Computing Environment, which is roughly a
flexible client-server architecture for heterogenous platforms.
For more information, take a look in comp.soft-sys.dce.


------------------------------

1.608: How do I make /var/spool/mail mountable?
From: petersen@pi1.physik.uni-stuttgart.de (Joerg Petersen)

In our cluster we share a /usr/local disk. We have a directory
/usr/local/spool/mail and /var/spool/mail is soft-linked to it.

From: fred@hal6000.thp.Uni-Duisburg.DE (Fred Hucht)

Several problems has been reported on sharing the mail directory via
NFS. The problems may occur when two or more sendmail daemons and/or
mail readers access a user's mail file simultanously, because of NFS'
file locking mechanism.

We use another method here: Every user has one line in his/her
$HOME/.forward file that reads

xxx@mainserver.domain.name

where xxx is the user node and mainserver.domain.name is the full
hostname of one of the machines. Then all incoming mail to all machines
is forwarded to mainserver, while mainserver ignores this line.


1.609: getty spawning too rapidly 
From: aslam@abaseen.lums.edu.pk (Sohail Aslam)

The problem can occur due a number of modem settings. The most
frequent is that the echo is not disabled on modems that are to
accept incoming calls. In hayes language, ATE0 disables echo.
If echo is enabled, the login prompt sent by the DTE (computer)
is echoed back to it. It then issues "password:" prompt which
the modem conveniently echoes back again. And the cycle goes on.

Another setting to check is the Q registers which controls the
modem's response to the DTE. The hayes command ATQ0 enables
results codes. The Q register in conjunction with the X and
the V registers, reports back to the DTE the status of the incoming
or outgoing call, and the type of connection established. For
outgoing calls, one would want to enable result codes but not
for incoming calls. If codes are enabled (via ATQ0), when a
call comes in, the modem will send strings (if ATV1 and ATX4 set)
"RINGING", "CONNECTED" etc. to the local DTE. The getty will think
some one is trying to login. It will send password prompt. Trouble
again. Telebit and other intelligent modems has ATQ2 setting
which says "reports codes only when calling out." For others,
you will need to disable it (ATQ1) and enable when calling out.

The DSR setting can be a source of problem. Ideally, modem should
raise DSR only when CD is detected and modem raises CTS. Computer,
such as the VAX, wait 30 seconds after the modem raises DSR. If
CD is not on by that time, the computer will drop DTR causing the
modem to reset. The DSR should be set to be raised only when
carrier has been detected. The hayes setting is AT&S1.

The DCD setting should be such that it reflects the true nature of
the carrier. The CD can be forced on at all times (AT&C0). This
is not good. Set it to AT&C1.

Most modems can reload saved settings from non-volatile memory
on a DTR transition. This is useful for resetting the modem
when a call drops. Use AT&D3 to get this effect. 

For dial in, thus, set AT E0 Q1 &C1 &D3 &S1 &W. The &W stores the
settings in memory. They will be reloaded due to &D3.


------------------------------

1.610: Does AIX support Compressed SLIP (CSLIP)?

No.  That means no VJ compression either :)  See PPP in section 5.07 
if you want more than standard SLIP.


------------------------------
1.611: How do I setup anonymous ftp on my AIX system?

(stolen from Peter Klee <klee@dhdibm1.bitnet> posting)

Have a look at '/usr/lpp/tcpip/samples/anon.ftp'. It is a shell script
and will set up a anonymous ftp site on your local RS/6000.  Note: the
ftpd that comes with AIX does not support the display messages every
time a user changes a directory or even when they login.

------------------------------

1.612: Talk, getting notification.

If you are not getting notification (that someone wants to talk to
you), use (swcons `tty` && mesg y) in one window.

There are many variations of 'talk' and finding compatible versions
for multiple operating systems can be tricky.


------------------------------

1.613: Disabling software flow control; using RTS/CTS.

Different versions of AIX 3.2.5 respond differently to attempts to
enable flow control (RTS/CTS signals).  This section is an attempt to
compile a list of different approaches.

The most straight forward is:
   chdev -l ttyxx -a rts=yes
   [ Note: ix40410 for AIX 3.2.5 should give you this functionality.  
   PTF U426113 and numerous other superceding ptfs should provide this.]

If carrier signal is high (its connected) you can try
   stty add rts </dev/ttyxx 

There is also a program that I first saw on the 800-IBM-4FAX number,
also found in INFO that will remedy the situation in some cases.  Note
that this code ignores the return code from ioctl (which on my machine
is <0 :)

------------------------------

1.614: NIS security
Ole.H.Nielsen@fysik.dtu.dk (Ole Holm Nielsen)

SUMMARY: AIX 3.2.4 and above includes support for a more secure setup
of the ypserv NIS daemon.  You can prevent any random host on the
entire Internet from reading your NIS maps, as is possible with the
default AIX setup.
 
The details:
------------
After starting the ypserv daemon, I noticed in the syslog the following line:
Jan 17 12:01:18 zeise syslog: /usr/etc/ypserv: no /var/yp/securenets file 
This indicates that ypserv is looking for the mentioned configuration
file, but did not find it, and hence will deliver the NIS maps to
anyone on the net who can guess the NIS domainname.  I installed the
/var/yp/securenets file and restarted ypserv, and it works !  Any
illegal attempt to read NIS maps will result in the following getting
logged to syslog (example):
Jan 18 13:37:27 zeise syslog: ypserv: access denied for 129.142.6.79 

How to enable this NIS security option:  
Install the /var/yp/securenets file, for example:

# /var/yp/securenets file
#
# The format of this file is one of more lines of
# netmask netaddr
# Both netmask and netaddr must be dotted quads.
#
# Note that for a machine with two Ethernet interfaces (i.e. a gateway
# machine), the IP addresses of both have to be in /var/yp/securenets.
#
# for example:
#255.255.255.0 128.185.124.00
# Loopback interface
255.255.255.255 127.0.0.1

Uncommenting the last line would limit access to hosts on the
128.185.124.*  net, only.  The loopback interface must be included, as
shown above.

To log violations, have a /etc/syslog.conf file containing the proper
events.  We use this line:

*.err;kern.debug;auth.notice;user.none          /var/adm/messages

Caveat emptor:  This works for us, and you will have to verify it at
your own installation.  Don't complain to us if you have troubles.  
I do not know what PTF level our AIX 3.2.4 is at.  Our ypserv daemon 
looks like this:

zeise> strings /usr/lib/netsvc/yp/ypserv | head -2
@(#)16
1.12  com/cmd/usr.etc/yp/ypserv.c, cmdnfs, nfs325, 9334325a 5/4/93 19:44:41

If your AIX doesn't have securenets support, ask your support centre
for the PTF which includes APAR IX32328.  That seems to have included
the securenets support.


------------------------------

1.615: Why can't non-anonymous users login using WU-FTP?
From: swcxt@boco.co.gov (Shane Castle)

You must create a file named /etc/shells (this is the real /etc not a
subdirectory of your false root), that contains all the shells that
are defined on your system.  Get the list from
/etc/security/login.cfg.  Also, if having proper group authentication
is important to you, apply the following patch:

--- ftpd.c.dist	Wed Apr 13 15:17:18 1994
+++ ftpd.c	Tue Jan 17 13:29:58 1995
@@ -1153,7 +1153,13 @@
        setgroups(NULL, NULL);
        if (setpriv(PRIV_SET|PRIV_INHERITED|PRIV_EFFECTIVE|PRIV_BEQUEATH,
                    &priv, sizeof(priv_t)) < 0 ||
-           setuidx(ID_REAL|ID_EFFECTIVE, (uid_t)pw->pw_uid) < 0 ||
+           initgroups(pw->pw_name, (gid_t)pw->pw_gid) < 0 ||
+           setgidx(ID_REAL|ID_EFFECTIVE, (gid_t)pw->pw_gid) < 0 ||
+           setegid((gid_t)pw->pw_gid) < 0) {
+               reply(550, "Can't set gid (AIX3).");
+               goto bad;
+       }
+       if (setuidx(ID_REAL|ID_EFFECTIVE, (uid_t)pw->pw_uid) < 0 ||
            seteuid((uid_t)pw->pw_uid) < 0) {
                reply(550, "Can't set uid (AIX3).");
                goto bad;

------------------------------

1.616: NIS users can't login, do I need '*' in /etc/passwd?
From: ohnielse@fysik.dtu.dk (Ole Holm Nielsen)

Aparently at least one version of AIX InfoExplorer suggests
administrators use "+:*:0:0:::" as the last entry in the /etc/passwd
file of NIS clients for security reasons.  If the configuration SMIT
is done using SMIT it will actually append "+::0:0:::" which works and
does not compromise security.  Using the '*' in the passwd field
actaully prevents NIS users from logging in.

"+::0:0:::" should not allow you to login as user "+" and without a
password even when NIS is disabled, but it never hurts to double
check.

------------------------------
1.617: HP JetDirect cards and virtual printers?  mkvirprt problems?

(stolen from many)

Since the release of AIX 3.2.5 adding a queue for JetDirect cards is as
easy as creating a virtual printer using "smit mkvirprt" or mkvirprt.
If the command hangs make sure you are using an HFT, aixterm or vt100
terminal.  The entire procedure is available from the IBM FAX
"Information Line" (800 IBM-4-FAX).

From: Mark Bergman <mark.bergman@syseca.co.uk>

SMIT complains that some required software is not present on the system.
It turns out that this software, "printers.hpJetDirect.attach (4.1.3.0)"
is on the installation CD.

HOWEVER, there is some bug somewhere, whereby the software may actually
be already installed, but the system cannot see it.  (Or maybe the bug
is that the software is actually NOT installed, but the system in one
place thinks it is! - I'm not sure).  Therefore, use smit to look at
Installed Software ("Software Installation and Maintenance", "Maintain
Installed Software", "List Installed Software" and look at all software,
then search through for "jet".  If it finds it (i.e. it thinks that it
is installed) - you must remove it (under smit's "Maintain Installed
Software" level), and then reinstall from the CD!

------------------------------

1.618: How can I hack libc.a to alter how hostnames are resolved?
From: <mlarsen@ptdcs2.intel.com> "L. Mark Larsen"

[ 
  Editors note:  The implications of corrupting libc.a should not be
  understated.  While recovering from a corrupt libc.a should be a
  matter of booting from floppy I wouldn't wish that on anyone with a 
  supervisor or users to support :)

  Before you attempt this,  you might want to read 2.07 first for
  advice on recovering from a destroyed or corrupted libc.a.
  Remember:  backups are a VERY GOOD IDEA.

  enough of the weak kneed quivering...
]

Nate Itkin (a colleague) is the individual who did the initial work.
I suspect he would rather not be troubled with any questions you may
have in this area and I can probably answer them just as easily.  The
motivation for this was to use DNS for MX records (we are using IDA
sendmail) but NIS for most hostname lookups.

Secondly, warnings:  IBM has not given any sort of stamp of approval on what
we have done (though they appear to have integrated resolv+ into AIX 4 based
on some release notes I saw).  While we have been using it successfully for
about one year and have seen no problems, we can't and won't promise the same
for you.  This procedure plays around with libc.a which, as you probably know,
is an XCOFF shared library under AIX and hence a critical part of the running
system.  You assume all the risk if you try to install this.  All the usual
disclaimers about liability, etc. apply - there is no warranty associated with
any of this.

Furthermore, know that any PTF you subsequently install that updates/replaces
libc.a implies that you have to execute most of these procedures again.

The details on how to use resolv+ under AIX 3 (it's only tested under
3.2.5 but should work for all point releases), have been moved to
section 8.09.

------------------------------

1.619: What modem settings do I need?

ATQ2  - result codes in originate only
AT&C1 - CD follows state of carrier 
AT&D2 - hangup on DTR drop


------------------------------
1.620: NIS slave server config with master on different subnet?
From: msidler@metronet.com (Mike Sidler)

Assuming AIX 3.2.5,the master server up and running and the hosts file
has the master name defined. On slave do:

    1) domainname <domain_name that matches master>
    2) startsrv -s ypserv
    3) startsrv -s ypbind (ypwhich should return "loopback")
    4) (/usr/sbin/)ypset -d <domainname> <master_server_name>
       (ypwhich should return "<master_server_name>"
    5) (/usr/sbin/)ypinit -s <master_server_name>
    6) Put "+::0:0:::" in /etc/passwd after last local login. 
       Note: InfoExplorer has this entry INCORRECT in some versions.
    7) Other cfg files (group, etc) may need configuring but this will
       get ypserv and ypbind running on the slave looking at the right stuff.


------------------------------

1.621: Why does my 64 port concentrator loose data and drop the queue?
[From: as@mynet.no (Arild Sletvold)]

This problem has been associated with upgrading machines to 3.2.5.
Try changing the values for the "Transmit buffer count" parameter in
the printer/plotter setup in smit. You need to experiment with this
parameter, to see which value that makes the printer print as fast as
possible.  If the value is too high, the printers will loose some of
the data, and the queue will be disabled.  If the value is too low,
the printers will print very slowly.

------------------------------

1.622: Netscape FastTrack server won't install on AIX 3.2.5 or 4.1.
From: Cameron Ferstat <cferstat@austin.ibm.com>

Before installing FastTrack on an AIX 3.2.5 or 4.1 system, you must 
first install the AIX Shared Library Hookable Symbols/6000 Version 
1.1.5.0, Reference RPQ No. P91153.  (Note:  This software should *not*
be installed on an AIX 4.2 system!)

If you try to install FastTrack on an AIX 3.2.5 or 4.1 system, without 
first installing the Hookable Symbols PRPQ, you will get the following 
error:

   > ./ns-setup
     0509-037 System error - error data is: ./ns-setup
     0509-022 Cannot load library libsvld.a[shr.o].
     0509-026 System error: A file or directory in the path name does not exist.

You can download the installp image by anonymous ftp from
<ftp://ftp.software.ibm.com/aix/products/netscape/tools/slhs.rte.inst_image>.

There is also an associated README.slhs file in that directory.

------------------------------

1.623: How can I share files/printers with Windows 95?

The freeware solution is Samba,  available from <http://www-frec.bull.com/>.

Commercial solutions include Fusion95 from Performance Technology
<http://www.perftech.com/> and Syntax <http://www.syntax.com/>.

------------------------------

1.624: Printing from AIX to WinNT/95/3.1
From: Charles J. Fisher <charles_fisher@bigfoot.com>

1. On your Windows system, share the printer. Assuming that you are
   running NT, make a user "root" with some password.

2. Get the Samba distribution from http://www.samba.org
   If you have a C compiler, get the source and compile it.
   If you don't have a C compiler, get a binary distribution for AIX.

3. Install Samba on AIX under /usr/local/samba. Specifically, make sure
   that /usr/local/samba/bin/smbclient is installed with execute rights
   for everyone.

4. You must also install a Samba configuration file under
   /usr/local/samba/lib/smb.conf

   If you intend to use your AIX as a file server for windows clients,
   you should modify smb.conf to accomplish this (see the Samba
   documentation).

   If you will be printing only, just use the sample smb.conf.

5. Make the directory /usr/local/samba/lib/printers

6. In that directory, install the following shell script as
   file "winprint":

#!/bin/sh

# This is a modification of the samba provided smbprint script
# changed to work under AIX as the backend for a queue. It does
# not read a config file.
#
# Variables below define the server and service. They are
# the content of the .config file when printing from
# /etc/printcap.
#
server="winserver"
service="winprinter"
user="root"
password="root"
#
# Debugging log file, change to /dev/null if you like.
#
#logfile=/tmp/${USER}-print.log
#
# Some debugging help, change the >> to > if you want to save space.
#
#echo "server $server, service $service" >> $logfile
#cat $1 | /usr/local/samba/bin/smbclient "\\\\$server\\$service" 
$password \
#       -N -P -c 'print -' >> $logfile

(
# NOTE You may wish to add the line `echo translate' if you want automatic
# CR/LF translation when printing.
        echo translate
        echo "print -"
        cat $*
) | /usr/local/samba/bin/smbclient "\\\\$server\\$service" $password \
	-U "$user" -N -P  > /dev/null

7. The above file assumes that you are using \\winserver\winprinter
   as the printer share, and that the user is "root" and the password
   is "root". If this is not the case, modify the shell variable
   declarations.

8. Mark the file with execute permissions with "chmod 755 winprint"

9. Test the script with the command: "./winprint /etc/passwd"
   If everything is ok, your password file should be spooled to your
   windows printer.

   If it doesn't work, remove the "> /dev/null" from the last line of
   the script and rerun it. Examine the output of smbclient for clues.

   Clue #1: The Windows printer server is on the other side of a router.
            AIX is sending broadcast packets to find the Windows machine,
            which the router will not forward. You must find the Windows
            server's IP address and specify it with the "-I" parameter
            to smbclient, i.e. "-I 1.2.3.4". DHCP makes this situation
            even more complex.

   Clue #2: You username or password is wrong. smbclient will tell you
            about this if you free its output from > /dev/null.

   Clue #3: You might be violating shell quoting rules if you use
            special characters in the server or share name, password,
            etc. Don't use $, ", ', etc., or escape them properly.
            A password of ";rm -rf /" could be catastrophic.

10. Once the script can print files, it must be defined as a printer in
    the /etc/qconfig file. Add the following lines to the end of your
    /etc/qconfig:

winprint:
        device = dwinprint
        up = TRUE
        discipline = sjn
dwinprint:
        backend = /usr/local/samba/lib/printers/winprint

11. Test the printer with the following command:
    "lp -d winprint /etc/passwd"
    (Your password file should be printed again.)

12. You might examine the queue with the command "lpq -P winprint"
    or "lpstat -t"

------------------------------

1.625: How do I get NFS mounting with Linux to work?

Linux by default requires any NFS mount to use a so called reserved port
below 1024 and AIX 4.3 does by default use ports above 1024. You can use
the nfso command to restrict AIX to the reserved port range as follows:

	nfso -o nfs_use_reserved_ports=1

------------------------------

1.626: Telnet takes a 45 seconds to produce a prompt.

This is in nearly all cases a DNS configuration problem, the AIX machine
can not resolve the IP address of the node initiating the telnet
connection. You can check the DNS reverse mapping by using the nslookup
command on the IP number in question, this will probably timeout as
well. Make sure that the nameserver lines in the /etc/resolv.conf file
point to valid name servers. Some folks have reported that putting the
following in /etc/netsvc.conf can help as well (see also Subject:
1.800):

	hosts=local,bind4

------------------------------

1.700: Free LVM lecture slides.
From: shieh@austin.ibm.com

If you want free LVM documentation (lecture notes) from the
SHARE conference in San Franciso where I presented last March
just:
 
 mail -s "S_basics.ps" shieh@austin.ibm.com < /dev/null
 mail -s "S_limits.ps" shieh@austin.ibm.com < /dev/null
 mail -s "S_lvm_extra.ps" shieh@austin.ibm.com < /dev/null

[Editor's note: Jens-Uwe Mager converted the slides to PDF format.  They
are available as <http://www.han.de/~jum/aix/lvm.pdf>.]

------------------------------

1.701: How do I shrink /usr?
From: mike@bria.UUCP (Michael Stefanik) and Richard Hasting

FOR AIX 3.1
-----------

 1) Make a backup of /usr

        find /usr -print | backup -ivf /dev/rmt0 (or appropriate device)

 2) shutdown to maintenance mode

        shutdown -Fm
 
 3) export LANG=C
 
 4) remove the filesystem and the logical volume
    ignore an error about the "dspmsg" command not found

        umount /usr
        rmfs /usr

 5) make a new logical volume hd2 and place it on rootvg with desired size

        mklv -yhd2 -a'e' rootvg NNN 

   where NNN is the number of 4 meg partitions

 6) create a filesystem on /dev/hd2

        crfs -vjfs -dhd2 -m'/usr' -Ayes -p'rw'

 7) mount the new /usr filesystem and check it

        /etc/mount /usr
        df -v

 8) restore from the tape; system won't reboot otherwise

        restore -xvf/dev/rmt0

 9) Sync and reboot the system; you now have a smaller /usr filesystem

FOR AIX 3.2
-----------

 0)  Experiences posted to comp.unix.aix lead me to suggest that
     many administrators find the following piece of information 
     useful after completing this procedure.  I thought some of you
     might like to read it BEFORE getting yourself into this
     predicament.  

     Call 1-800-IBM-4FAX and request document 2503 dated 1/26/94.  
     Title is "How to recover if all files are owned by root after
     restoration from a mksysb tape".

 1) Remove any unneeded files from /usr.

 2) Make sure all filesystems in the root volume group are mounted. If
    not, they will not be included in the re-installed system.

 3) Type mkszfile. This will create /.fs.size that contains a list of
    the active filesystems in the root volume group that will be
    included in the installation procedure.

 4) Edit .fs.size. Change the size of /usr to what you want.

    Example: This .fs.size file shows /usr to be 40MB.

	rootvg 4 hd2 /usr 10 40 jfs

    The 10 is the number of physical partitions for the filesystem and
    the 40 is 40 MB. Most systems have a physical partition size of 4 MB.
    Therefore, the second number (40) will always be 4 times the
    previous number (10). Note, however, that a model 320 with a 120 MB
    drive will have a physical partition size of only 2 MB, and the
    total MB is twice the number of physical partitions. The first
    number (4) in the .fs.size file represents the PP size.

    If you want to reduce the size of /usr from 40 MB to 32 MB, edit the
    /usr entry to:

        rootvg 4 hd2 /usr 8 32 jfs

    IMPORTANT: Make sure that you DO NOT enter a value which is less
    than the size of the filesystem required to contain the current
    data. Doing so will cause the re-installation procedure to fail.

 5) chdev -l rmt0 -a block=512 -T

 6) Unmount all filesystems that are NOT in the root volume group.
 
 7) Varyoff all user-defined volume groups, if any

        varyoffvg VGname

 8) Export the user-defined volume groups, if any

        exportvg VGname

 9) With a tape in the tape drive, type

        mksysb /dev/rmt0

     This will do a complete system backup, which will include
     information (in the .fs.size file) for the installation procedure
     on how large the filesystems are to be created.

 10) Follow the instructions in the Installation Kit under "How to
     Install and perform maintenance from Diskettes" (reportedly now 
     called "BOS Installation from a System Backup") using the
     diskettes and tape that you created in the previous steps.

     [ pre AIX 325: DO NOT select the option "Reinstall AIX with
     Current System Settings". Instead use "Install AIX with Current
     System Settings" for the logical volume size changes to take affect. ]

     [ w/ AIX 325: Select "Install from a mksysb image" ]

 11) When the installation is complete, you may then import any
     user-defined volume groups.

         importvg -y VGname PVname

     where "VGname" is the name of the volume group, and "PVname" is
     the name of any one of the physical volumes in the volume group.

 12) Varyon your user-defined volume groups

         varyonvg VGname

 The reduction of the filesystems is now complete.

COMMERCIAL OPTION
-----------------
There are also commercial tools availible to help you do this more
conviently.  I know of one vendor that can be reached at info@compunix.com

------------------------------

1.702: How do I make a filesystem larger than 2Gb?

AIX 3.2.5 and preceeding versions are limited to 2 Gigabytes per
filesystem.

With AIX 4.1 IBM allows filesystems up to 64Gb (reference:
Individual files are still limited to 2Gb.  AIX 4.2 allows 128Gb
filesystems and 64 Gb files.  (See also question 1.706.)

If you are having trouble creating a file greater than 1Mb it maybe
because that is the default limit for your account, see 'smit users'
or /etc/security/limit.

------------------------------

1.703: Chlv warning.  Is the first 4k of a LV safe?

The first 4k of a raw LV are used to store control block.
Applications that write to the raw disk can overwrite this section
(common applications that do this are Oracle and Sybase).  Commands
that call getlvcb will generate a warning but succeed (since the
control block exists in ODM.  Don't run synclvodm unless you really
want to erase the first 4k and replace it with the info from the ODM.

shieh@austin.ibm.com (Johnny Shieh) has kindly provided the following
explanation:

The logical volume control block (lvcb) is the first 512
bytes of a logical volume.  This area holds important
information such as the creation date of the logical volume,
information about mirrored copies, and possible mount points
in a journaled filesystem.  Certain LVM commands are required
to update the lvcb, as part of completeness algorithms in
LVM.  The old lvcb area is first read and analyzed to see if
it is a valid lvcb.  If the information is verified as valid
lvcb information, then the lvcb is updated.  If the
information is not valid, then the lvcb update is not
performed and the user is given the warning message:

	Warning, cannot write lv control block data

Most of the time, this is a result of database programs
accessing the raw logical volumes (and thus bypassing the
journaled filesystem) as storage media.  When this occurs, the
information for the database is literally written over the lvcb.
Although this may seem fatal, it is not the case.  Once the
lvcb has been overwritten, the user can still:

	1) Extend a logical volume
	2) Create mirrored copies of a logical volume
	3) Remove the logical volume
	4) Create a journaled filesystem with which to mount
		the logical volume (note that this will destroy any
		data sitting in the lvcb area)

However, there is a limitation caused by this deletion of the
lvcb.  The logical volumes with deleted lvcb's face possible,
incomplete importation into other AIX systems.  During an
"importvg", the LVM command will scan the lvcb's of all defined
logical volumes in a volume group for information concerning the
logical volumes.  Surprisingly, if the lvcb is deleted, the
imported volume group will still define the logical volume to
the new AIX system which is accessing this volume group, and
the user can still access the raw logical volume.  However, any
journaled filesystem information is lost and the logical volume
and its associated mount point won't be imported into the new AIX
system.  The user must create new mount points and the availability
of previous data stored in the filesystem is NOT assured.  Also, during
this import of a logical volume with an erased LVCB, some non-jfs
information concerning the logical volume, which is displayed with
the "lslv" command, cannot be found.  When this occurs, the system uses
default logical volume information to populate the logical volume's
ODM information.  Thus, some output from the "lslv" will be inconsistent
with the real logical volume.  If logical volume copies still exist on
the original disks, this information will not be correctly reflected in
the ODM database.  The user should use "rmlvcopy" and "mklvcopy" to
rebuild any logical volume copies and synchronize the ODM.  Finally,
with an erased lvcb, the output from the "lslv" command might be
misleading or unreliable.


------------------------------

1.704: What's the limit on Physical Partitions Per Volume Group?
From: shieh@austin.ibm.com (Johnny Shieh)

1016 Physical Partitions Per Disk in a Volume Group:

     In the design of LVM, each Logical Partition
maps to one Physical Partition.  And, each Physical
Partition maps to a number of disk sectors.  The design
of LVM limits the number of Physical Partitions that LVM
can track PER DISK in a volume group to 1016.  In most cases,
not all the possible 1016 tracking partitions are used by a disk.
The default size of each Physical Partition during a
"mkvg" command is 4 MB, which implies that individual
disks up to 4 GB can be included into a volume group.

     If a disk larger than 4 GB is added to a volume
group (based on usage of the default 4 MB size for
Physical Partition) the disk addition will fail with a
warning message that the Physical Partition size needs
to be increased.*  There are two instances where this
limitation will be enforced.  The first case is when the
user tries to use "mkvg" to create a volume group where
the number of physical partitions on one of the disks in
the volume group would exceed 1016.  In this case, the
user must pick from the available Physical Partition ranges of:

1, 2, (4), 8, 16, 32, 64, 128, 256

Megabytes and use the "-s" option to "mkvg".  The second
case is where the disk which violates the 1016 limitation
is attempting to join a pre-existing volume group with
the "extendvg" command.  The user can either recreate the
volume group with a larger Physical Partition size (which
will allow the new disk to work with the 1016 limitation)
or the user can create a standalone volume group (consisting
of a larger Physical Partition size) for the new disk.

     In AIX 4.1 and 3.2.5, if the install code detects
that the rootvg drive is larger than 4 GB, it will change
the "mkvg -s" value until the entire disk capacity can be
mapped to the available 1016 tracks.**  This install change
also implies that all other disks added to rootvg, regardless
of size, will also be defined at that new Physical Partitions size.

For RAID systems, the /dev/hdiskX name used by LVM in AIX may
really consist of many non-4GB disks.  In this case, the 1016
limitation still exists.  LVM is unaware of the size of the
individual disks that may really make up /dev/hdiskX.  LVM bases
the 1016 limitation on the AIX recognized size of /dev/hdiskX,
and not the real independent physical disks that make up /dev/hdiskX.

The questions asked of this issue are:
1) What are the symptoms of this problem?
2) How safe is my data?  What if I never use mirroring or migratepv?
3) Can I move this volume group between RS/6000 systems and versions
   of AIX?

Here are the answers:
A) What are the symptoms of this problem?
     The 1016 VGSA is used to track the "staleness of mirrors".
     If you are in violation of 1016, you may possibly get a false
     report of a non-mirrored logical volume being "stale" (which
     is an oxymoron) or you may get a false indication that one of
     the your mirror copies has gone stale.  Next, migratepv may
     fail because migratepv briefly uses mirroring to move a logical
     volume from one disk to another.  If the target logical
     partition is incorrectly considered "stale", then the migratepv
     cannot remove the source logical partition and the migratepv
     command will fail in the middle of migration.

B) How safe is my data?  What if I never use mirroring or migratepv?
     The data is as safe (in your mind) as the day before you found
     out about 1016 violations.  The only case where data may be
     lost is if one is mirroring a logical volume and ALL copies go
     bad at the same time and LVM isn't aware of it because the
     copies that go bad are beyond the 1016 tracking range.  However,
     in this case, you would lose data even if you were within the
     1016 range.  If you never mirror or use migratepv, then this
     issue shouldn't concern you.  But, it might be unwise to state
     you'll NEVER use either of those options.

C) Can I move this volume group between RS/6000 systems and versions
   of AIX?
     Yes you can.  The enforcement of this 1016 limit is only
     during mkvg and extendvg.  The "safeness" of the data on the
     volume group on AIX 3.2 is the same as it is on AIX 4.1.


* This bug was fixed in apar ix48926.  Current AIX 3.2.5 and
4.1.1, which do not have this fix on applied, will allow the
creation of volume groups with more than 1016 partitions.  The
implication of this bug allowing more than 1016 physical
partitions is that the user may access all portions of the logical
volume.  However during disk mirroring, the status of partitions
beyond the 1016 limit will not be tracked correctly.  If mirrors
beyond the 1016 range become "stale", LVM will not be aware of
their condition and data consistency may become an issue for
those partitions.  Additionally, the "migratepv" command creates
mirrors and deletes them as a method for moving logical volumes
around within/between disks.  If the 1016 limit is violated,
then the "migratepv" command may not behave correctly.
The user should pick up apar ix51754, which clarifies the error
message when this condition is detected.  Additionally, the user
can read the non-ptf documentation apar ix50874 which is a companion
to ix48926 and ix51754.

** This bug was fixed for AIX 3.2.5 rootvg install in apars
ix46862 and ix46863.  This bug does not exist in AIX 4.1.1.

------------------------------

1.705: Why am I having trouble adding another disk to my VG?
From: shieh@austin.ibm.com (Johnny Shieh)

In some instances, the user will experience a problem adding
a new disk to an existing volume group or in the creation of
a new volume group.  The warning message provided by LVM will
be:

	Not enough descriptor space left in this volume group.
	Either try adding a smaller PV or use another volume group.

On every disk in a volume group, there exists an area called the
Volume Group Descriptor Area (VGDA).  This space is what allows
the user to take a volume group to another AIX system and
"importvg" that volume group into that AIX system.  The VGDA
contains the names of disks that make up the volume group, their
physical sizes, partition mapping, logical volumes that exist in
the volume group, and other pertinent LVM management information.

When the user creates a volume group, the "mkvg" command
defaults to allowing the new volume group to have a maximum
of 32 disks in a volume group.  However, as bigger disks have
become more prevalent, this 32 disk limit is usually not
achieved because the space in the VGDA is used up faster, as
it accounts for the capacity on the bigger disks.  This
maximum VGDA space, for 32 disks, is a fixed size which is
part of the LVM design.  Large disks require more management
mapping space in the VGDA, which causes the number and size
of available disks to be added to the existing volume group
to shrink.  When a disk is added to a volume group, not only
does the new disk get a copy of the updated VGDA, but all
existing drives in the volume group must be able to accept
the new, updated VGDA.

The exception to this description of the maximum VGDA is
rootvg.  In order to provide AIX users more free space, when
rootvg is created, "mkvg" does not use the maximum limit of
32 disks that are allowed into a volume group.  Instead in
AIX 3.2, the number of disks picked in the install menu of
AIX is used as the reference number by "mkvg -d" during the
creation of rootvg.  For AIX 4.1, this "-d" number is 7 for
one disk and one more for each additional disk
picked. i.e. you pick two disks, the number is 8.  you pick
three disks, the number is 9, and so on.....  This limit does
not mean the user cannot add more disks to rootvg in the
post-install phase.  The amount of free space left in a VGDA,
and thus the number of size of the disks added to a volume
group, depends on the size and number of disks already
defined for a volume group.  However, this smaller size
during rootvg creation implies that the user will be able to
add fewer disks to rootvg than compared to a non-rootvg
volume group.

If the customer requires more VGDA space in the rootvg, then
they should use the "mksysb" and "migratepv" commands to
reconstruct and reorganize their rootvg (the only way to
change the "-d" limitation is recreation of the rootvg).

Note:  It is always strongly recommended that users do not place
user data onto rootvg disks.  This separation provides an extra
degree of system integrity.

------------------------------

1.706: What are the limits on a file, filesystem?

There are other limits but these come up most often.  Logical Volumes
do not _have_ to contain Journaled File Systems and therefore can be
larger than 2GB even in 3.2.5.

	File	jfs-Filesystem
3.2.5	2GB	2GB
4.1.x	2GB	64GB
4.2	64GB	128GB

While it *might* be possible to create larger file systems,  the limits
shown here represent values that IBM has supposedly tested.	

------------------------------

1.707:  Hints for Segate 9 GB and other disks larger than 4 GB? 

[read 1.704]


------------------------------

1.708: How do I fix Volume Group Locked?

>From /usr/lpp/bos/README (AIX 3.2.5) and 1.800.IBM.4FAX #2809

If you get '0516-266 publvodm: volume group rootvg is locked, try again'
or something similar, you can use (putlvodm -K `getlvodm -v <vgname>`)

------------------------------

1.709: How do I remove a volume group with no disks?
From: shieh@austin.ibm.com (Johnny Shieh)

This is a very common question about AIX LVM and I thought
I might take some time to explain what is going on.  Within
a volume group is the Volume Group Descriptor Area (VGDA) is
is kinda a "suitcase" of lvm information.  This is what allows
you to pick up your drives and take them to another machine,
importvg them, and get filesystems automatically defined.

What happens is that when you importvg the volume group,
the RS/6000 goes out and reads the VGDA and finds out about
all the logical volumes and filesystems that may exist on the
volume group.  It then checks for clashes (name conflicts, etc..)
on its own machine and then, here is the important part, populates
its own database with information about the new volume group and
its associated logical volumes.  In cases of filesystems, it will
go into the /etc/filesystems file and add the new filesystem entries
that came along with the imported volume group.

Okay, the key point is that you've got this independent volume group
that has "docked" at the new RS/6000.  What keeps the two tethered
to each other is the varyonvg command.  When this is started on the
volume group, a software link is created where you can't separate the
volume group from the AIX operating system unless the volume group
is no longer seen as active by the system.  In very rare cases, a
situation can occur where the VGDA thinks that someone has it (the
volume group) activated, but the operating system doesn't think it has the
volume group opened up.  This is pretty rare.

The main question I see is "I've taken away the disks, but how do
I get rid of the volume group".  The question should really say,
"How do I get rid of the volume group INFORMATION" since that's
all you have on the system.  You've got possible entries in
the /etc/filesystems and definitely entries in the ODM.  Just 
do:
	exportvg <vgname>

It does a reverse importvg, except it doesn't go off and read
the VGDA.  It nukes anything relating to the volume group in
the /etc/filesystems and ODM.  The only time this won't work is
if the system detects that the volume group is varied on.  Then,
it would be like trying to change tires on a moving car, we won't
let you do it!

Some people are concerned that doing an exportvg will somehow damage
the volume group and/or its VGDA. As I said, all it does is affect the
information about the volume group on the RS/6000 box, not on the actual
disk platter itself.  Thus, the volume group you exported is safe to
take to another system.  The only time the VGDA gets overwritten is when
you create a new volume on top of it.

The second most often asked question is "How do I get rid of a disk
that is no longer really in the volume group?"

In this case, you DON'T want to do an exportvg.  What you want to do
is tell the system you want to cut out the memory of the old, bad disk
from the RS/6000 AND from the VGDA of the volume group.  You simply
do:

		reducevg -d -f <vgname> <hdname>

or if the hdname can't be found:

		reducevg -d -f <vgname> <PVID>

Be careful with this command.  Unlike the exportvg command, actions done
with this command WILL affect the VGDA information on the platter.

Hope this clarifies some questions about volume groups.

------------------------------

1.710:  What are the theoritical limits within the LVM?
From: Gerry FitzGerald <G.FitzGerald@uk22p.bull.co.uk>

  -------------------------------------
  LVM Limits within AIX (my perception)
  -------------------------------------
  
  The system may have 1 to 255 Volumes Groups (VG's).
  Each VG may contain 1 to 32 Physical Volumes (PV's).
  Each PV may contain upto 1016 Physical Partitions (PP's).
  Each PP may have a size (square of 2) from 1 to 256MB (1024MB for AIX 4.3).
  
  Therefore, if you can get hold of a 260,096 MB disk (one PV with 1016 
  x 256MB PPs), you can install 32 of these in a single VG giving you 
  8,323,072MB per VG. You may have up to 255 VG's in one AIX system so 
  you could (in theory) create the maximum addressable AIX storage area 
  of 2,122,383,360 MB (2,072,640 GB or 2,024 TB or approx. 2 PB). This 
  is based on the current limitations of AIX V4.1.
  
  The limits for file and filesystem sizes are:

[Editor's note: the original values in this mail appeared to
 be slightly wrong, I have corrected that to the values as per
 my interpretation of the AIX manual.]
  
  AIX V3.2  Max filesystem size:  2,147,483,647 bytes (2 GB)
  Max single file size:  2,147,483,647 bytes (2 GB)
  
  AIX V4.1  Max filesystem size:  1,099,511,627,776 bytes (1 TB)
  Max single file size:  2,147,483,647 bytes (2 GB)
  
  AIX V4.2  Max filesystem size:  1,099,511,627,776 bytes (1 TB)
  Max single file size:  68,589,453,312 (~64 GB)

  AIX V4.3  Max filesystem size:  1,099,511,627,776 bytes (1 TB)
  Max single file size:  68,589,453,312 (~64 GB)

The 1TB maximum file system size is given by the rule that each
fragment must be addressable by an 28 bit number, with the largest
fragment size being 4096 bytes (4096*2^28).

------------------------------

1.800: How do I control how hostnames are resolved?
From: <kraem@ibm.de> Frank Kraemer

Information from AIX 4.1.2 Infoexplorer:

The default order can be overwritten by creating the configuration file,
/etc/netsvc.conf and specifying the desired order. Both the default and
/etc/netsvc.conf can be overwritten with the environment variable,
NSORDER. If either the /etc/netsvc.conf file or environment variable,
NSORDER are defined, then at least one value must be specified along with
the option.

examples: 
    echo hosts = local,nis,bind >/etc/netsvc.conf
    NSORDER=local,bind; export NSORDER

------------------------------

Subjet: 1.801: dtlogin ignores /etc/profile?
From: Trevor Bourget (trevor@thomsoft.com)

Read the /usr/dt/bin/Xsession script.  You can add a file to the
/etc/dt/config/Xsession.d and it will get sourced as part of the
startup.  The order is: $HOME/.dtprofile, /etc/dt/config/Xsession.d/*,
/usr/dt/config/Xsession.d/* (backwards, in my opinion, but CDE is a
committee result after all).

>From: Ed Ravin <eravin@panix.com>

If you want your terminal session to automatically read in
/etc/profile and your .profile when they start up, you need to either
invoke them with the "-ls" option (which I couldn't figure out how to
do, perhaps someone else can elaborate), or set up the default X
resources so that they set:

*Dtterm*loginShell:     true

You could always do this with the .Xresources file in your own account,
but that wouldn't fix any other users in the system.  To make this change
globally:

CDE configuration files are kept in /usr/dt/config
 
Those files warn you strenuously not to change them, since AIX upgrades
will overwrite them and lose your changes.  They recommend that you copy
the files to /etc/dt/config and change them there, so:

# cd /usr
# find dt/config -print | cpio -pdvum /etc
... (files get copied)
# cd /etc/dt/config/C
# echo "*Dtterm*loginShell:     true" >> sys.resources
# cd ../en_US
# echo "*Dtterm*loginShell:     true" >> sys.resources

From: Olaf Meeuwissen <olaf@IMSL.shinshu-u.ac.jp>

The problem is in /usr/dt/bin/Xsession.  This script only recognizes
the following login shells: sh, ksh and csh (as of $Revision: 1.6 $).
All other shells are considered non-standard.

The fix is to have your sys-admin add any other login shells in the
right places in the script (twice in the "Start the session" part).
Look for "case ${SHELL##*/} in" and add shells in the patterns.

Note that this script will be overwritten unconditionally by system
updates :-( and, unlike much other stuff in /usr/dt/, copying it to
/etc/dt/ does not work.

For which shells to add, you may want to:

   $ grep shells /etc/security/login.cfg

------------------------------

1.802:  Where's the C compiler?

As of AIX 4.1,  the C compiler has been "unbundled."  It's a separate product,
and you must purchase a separate license for it.  IBM does offer free
time limited trial licenses if you want to "try before you buy."

The GNU C compiler is available from various sources.  The most convenient
is probably <http://www-frec.bull.com/>.  <ftp://aixpdslib.seas.ucla.edu/>
is another source.

------------------------------

1.803:  Why doesn't Netscape work?

See question 1.515.

------------------------------

1.900: SCSI-1 and SCSI-2 "interoperability" got you confused?  

A.  SCSI-1 devices are supported on a SCSI-2 adapter.  This
    config will provide SCSI-1 performance.

B.  SCSI-2 devices are supported on a SCSI-1 adapter.  This
    config will provide SCSI-1 performance.

C.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-1
    adapter.  All devices will have SCSI-1 performance.

D.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-2
    adapter.  SCSI-2 devices will have SCSI-2 performance (10 MB/sec)
    and SCSI-1 devices will have SCSI-1 performance (4-5 MB/sec).

------------------------------

1.901: How to get your keyboard back after unplugging it from the 6000
From: Mickey Coggins and Anne Serre and L. Mark Larsen

When you unplug your keyboard from a running system, and plug it back
in, the key mapping is wrong.  For example, keys like Caps Lock and Ctrl
don't work as designed.

Solution: Type at the command line

        /usr/lpp/diagnostics/da/dkbd

Your screen goes black, you hear a few beeps, and your keyboard is reset.
It works with any environment, Xwindows, hft, NLS...

For Models 220, 230 and M20, use the following commands:

/usr/lpp/diagnostics/da/dkbd
/usr/lpp/diagnostics/da/dkbdsal   (for the 220)

After running the keyboard diagnostics to reset keyboard mappings, the
repeat rate is also reset to some slow value (11, according to the man
page).  If the user is in X, you need to open an hft window.  Do this
with "xopen /bin/csh".  Once you have an hft window, run "chhwkbd -r30".

------------------------------

1.902: How do I set up pcsim, the DOS emulator?

[Editor's Note: this product does not exist in AIX 4.x.]

You must have a bootable DOS diskette to install pcsim. Either DOS 3.3, 
4.x, or 5.0 will work. IBM do not officially support DOS 5.0 for pcsim
but I have no problems with it. Just don't try to be fancy with the UMB 
and memory manager stuff.

With a bootable DOS disk in the drive, do:
$touch /u/dosdrive (this is the AIX file for DOS emulation)
$pcsim -Adiskette 3 -Cdrive /u/dosdrive
You would now get an A prompt. Type:
A> fdisk
Create the virtual C drive of whatever size you choose. Make it large 
enough for your needs since you cannot enlarge it later.
A> format c: /s (to format the virtual C drive)
Now exit from pcsim with ESCpcsim (Esc key followed by pcsim).

Now create a simprof file. Following is a starter:

Adiskette   : 3
Cdrive      :/u/dosdrive
lpt1        : name of printer queue
refresh     : 50
dmode       : V
mouse       : com1

You can now start pcsim anytime by typing pcsim. Make sure no floppies
are in the drive. For further information, refer to publication
SC23-2452, Personal Computer Simulator/6000 Guide and Reference.
       
------------------------------

1.903: How do I transfer files between AIX and DOS disks?

In the AIX package bos.dosutils are commands for transferring files between
DOS diskettes and AIX. The commands are dosread, doswrite, dosdir, dosdel,
and dosformat. Many users have mentioned that the mtools package from
prep.ai.mit.edu is better than the native AIX programs.


------------------------------

1.904: Where is the crypt program?

The crypt *program* (as opposed to the crypt subroutine) has been
deleted, probably to conform to U.S. law regarding export of
cryptographic technology.

Other programs such as PGP are available,  but their use and/or
possesion may be subject to local laws and regulations.

If anyone has a better answer to this question,  feel free to
contribute it.

------------------------------

1.905: How do I play audio CDs?
From: woan@austin.ibm.com (Ronald S. Woan)

Get xmcd by anonymous FTP from ftp.x.org in /contrib/applications/xmcd/
<URL:ftp://ftp.x.org/contrib/applications/xmcd/>

------------------------------

1.906: How can I get the mouse back after unplugging it?

/usr/lpp/diagnostics/da/dmousea

------------------------------

1.907: Where can I get source code to the operating
                system binary xxxxx?

AIX source code is not generally available.  Two other UNIX OS' do
make their source available, Linux & freeBSD.  Check
<ftp://ftp.uu.net/systems/unix/bsd-sources/> and
<ftp://ftp.uu.net/systems/unix/linux/>

------------------------------

1.908: What's the difference between the POWER and
                POWERPC architectures?

Read the POWERPC FAQ at
<http://www.mot.com/SPS/PowerPC/library/ppc_faq/ppc_faq.html>

------------------------------

1.909: Will there be date rollover problems in the year 2000?
From: mbrown@austin.ibm.com (Mark Brown)

IBM has a major corporate-wide push for *all* of its software products
to be "safe" in this regard by the end of 1996.

<http://www.software.ibm.com/year2000/paper.html> is the general-purpose
[Year 2000] URL for IBM.

As far as AIX is concerned, we had to fix three things in AIXv4.1.4
(some logging commands handled date ranges wrong) as PTFs, but other
than that, we are there.

...and we handle the leap year issue correcly. also.

------------------------------

1.910: How can I build an "installp format" file?

Jim Abbey <jim@systelecom.com> has a tool called "lppbuild".
It is now available from "aixpdslib.seas.ucla.edu"
in either of

/pub/lppbuild/RISC/3.2/src/lppbuild.1.0.tar.Z
/pub/lppbuild/RISC/4.1/src/lppbuild.1.0.tar.Z

Both are identical and the procedures also work on 4.2.

Ciaran Diegnan <C.Diegnan@frec.bull.fr> has built a tool called
"mklpp".  You can retrieve a copy (along with many other
smit-installable freeware packages) from <http://www-frec.bull.com/>.

------------------------------

1.911: Is there a generic SCSI driver for AIX?
From: Rogan Dawes <rdawes@jhbelec.co.za>

Yes. Matthew Jacob (mjacob@feral.com) has written a generic SCSI driver
for AIX 4.1.  It can be found at <ftp://ftp.feral.com/pub/aix/gsc.tar.gz>.
------------------------------

1.912: Viruses or virus scanning on AIX?
From: mww@microfocus.com (Michael Wojcik)

FWIW, AIX comes with a virus-scanning utility (/usr/bin/virscan),
though IIRC the original version had an empty signature file (in
/usr/lib/security/scan/virsig.lst) and even the later populated
signature file only contains PC viruses.  Quoth the man page, "at
this time [virsig.lst] contains no known AIX virus signatures".
Apparently we are to infer that there *were* no known AIX virus
signatures.

I note that my 4.2.1 AIX system still has the 1991 signature file.

Even a DOS-only virus list could potentially be useful on a Unix
file server, though.  Provided, of course, that it had a recent
signature list (and preferably mutant-detection and similar
heuristics), which virscan probably does not.

And to be fair there are plenty of Unix vulnerabilities, and even
viruses potentially among them.  David Harley, keeper of the
alt.comp.virus FAQ, mentioned some "lab" Unix viruses when this
thread appeared in October '87, and I recall a discussion of using
crypto hashes to validate major system commands on some Unix group
not that long ago - which is essentially virus-scanning technology,
though not necessarily for the same purpose it generally serves
on PCs.

That said, viruses are not the problem for Unix systems that they
are for PCs.  Network security, guessable usernames and passwords,
and the like should generally be a higher priority.

------------------------------

2.00: C/C++

Contrary to many people's belief, the C environment on the RS/6000 is
not very special.  The C compiler has quite a number of options that can
be used to control how it works, which "dialect" of C it compiles, how
it interprets certain language constructs, etc.  InfoExplorer includes a
Users Guide and a Reference Manual.

The compiler can be invoked with either xlc for strict ANSI mode and cc
for RT compatible mode (i.e. IBM 6150 with AIX 2).  The default options
for each mode are set in the /etc/xlc.cfg file, and you can actually add
another stanza and create a link to the /bin/xlc executable.

The file /usr/lpp/xlc/bin/README.xlc has information about the C
compiler, and the file /usr/lpp/bos/bsdport (AIX 3 only) contains useful
information, in particular for users from a BSD background.

The file /etc/xlc.cfg also shows the symbol _IBMR2 that is predefined,
and therefore can be used for #ifdef'ing RS/6000 specific code.

------------------------------

2.01: I cannot make alloca work

A famous routine, in particular in GNU context, is the allocation
routine alloca().  Alloca allocates memory in such a way that it is
automatically free'd when the block is exited.  Most implementations
does this by adjusting the stack pointer.  Since not all C environments
can support it, its use is discouraged, but it is included in the xlc
compiler.  In order to make the compiler aware that you intend to use
alloca, you must put the line

#pragma alloca

before any other statements in the C source module(s) where alloca is
called.  If you don't do this, xlc will not recognize alloca as anything
special, and you will get errors during linking.

For AIX 3.2, it may be easier to use the -ma flag.

------------------------------

2.02: How do I compile my BSD programs?

The file /usr/lpp/bos/bsdport contains information on how to port
programs written for BSD to AIX 3.  This file may be very useful for
others as well.

A quick cc command for most "standard" BSD programs is:
  
  $ cc -D_BSD -D_BSD_INCLUDES  -o [loadfile] [sourcefile.c] -lbsd

If your software has system calls predefined with no prototype
parameters, also use the -D_NO_PROTO flag.

------------------------------

2.03: Isn't the linker different from what I am used to?

Yes.  It is not at all like what you are used to:

- The order of objects and libraries is normally _not_ important.  The
  linker reads _all_ objects including those from libraries into memory
  and does the actual linking in one go.  Even if you need to put a
  library of your own twice on the ld command line on other systems, it
  is not needed on the RS/6000 - doing so will even make your linking slower.

- One of the features of the linker is that it will replace an object in
  an executable with a new version of the same object:

  $ cc -o prog prog1.o prog2.o prog3.o		# make prog
  $ cc -c prog2.c				# recompile prog2.c
  $ cc -o prog.new prog2.o prog			# make prog.new from prog
						# by replacing prog2.o
  
- The standard C library /lib/libc.a is linked shared, which means that
  the actual code is not linked into your program, but is loaded only
  once and linked dynamically during loading of your program.

- The ld program actually calls the binder in /usr/lib/bind, and you can
  give ld special options to get details about the invocation of the
  binder.  These are found on the ld man page or in InfoExplorer.

- If your program normally links using a number of libraries (.a files),
  you can 'prelink' each of these into an object, which will make your
  final linking faster.  E.g. do:

  $ cc -c prog1.c prog2.c prog3.c
  $ ar cv libprog.a prog1.o prog2.o prog3.o
  $ ld -r -o libprog.o libprog.a
  $ cc -o someprog someprog.c libprog.o

This will solve all internal references between prog1.o, prog2.o and
prog3.o and save this in libprog.o Then using libprog.o to link your
program instead of libprog.a will increase linking speed, and even if
someprog.c only uses, say prog1.o and prog2.o, only those two modules
will be in your final program.  This is also due to the fact that the
binder can handle single objects inside one object module as noted above.

If you are using an -lprog option (for libprog.a) above, and still want
to be able to do so, you should name the prelinked object with a
standard library name, e.g. libprogP.a (P identifying a prelinked
object), that can be specified by -lprogP.  You cannot use the archiver
(ar) on such an object.

You should also have a look at section 3.01 of this article, in
particular if you have mixed Fortran/C programs.

Dave Dennerline (d.dennerline@bull.com) claims that his experiences
in prelinking on AIX does not save much time since most people have
separate libraries which do not have many dependencies between them,
thus not many symbols to resolve.

------------------------------

2.04: How do I statically link my program?

  cc -o prog -bnoso -bI:/lib/syscalls.exp obj1.o obj2.o obj3.o

will do that for a program consisting of the three objects obj1.o, etc.

[Editor's note: You should never link programs statically that are
supposed to leave your local environment, e.g. intended for
distribution. Statically linked programs may fail to work after
installing a new AIX version or even after installing a PTF.]

From: Marc Pawliger (marc@sti.com)

As of AIX 3.2.5, you can install a speedup for AIXwindows called
Shared Memory Transport.  To static link an X application after the
SMT PTF has been installed, you must link with
-bI:/usr/lpp/X11/bin/smt.exp and the executable will NOT run on a
machine where SMT is not installed.  See /usr/lpp/X11/README.SMT

2.05: How do I make my own shared library?

To make your own shared object or library of shared objects, you should
know that a shared object cannot have undefined symbols.  Thus, if your
code uses any externals from /lib/libc.a, the latter MUST be linked with
your code to make a shared object.  Mike Heath (mike@pencom.com) said it
is possible to split code into more than one shared object when externals
in one object refer to another one.  You must be very good at
import/export files.  Perhaps he or someone can provide an example. 

Assume you have one file, sub1.c, containing a routine with no external
references, and another one, sub2.c, calling stuff in /lib/libc.a.  You
will also need two export files, sub1.exp, sub2.exp.  Read the example
below together with the examples on the ld man page. 

---- sub1.c ----
    int addint(int a, int b)
    {
      return a + b;
    }
---- sub2.c ----
    #include <stdio.h>

    void printint(int a)
    {
      printf("The integer is: %d\n", a);
    }
---- sub1.exp ----
    #!
    addint
---- sub2.exp ----
    #!
    printint
---- usesub.c ----
    main()
    {
      printint( addint(5,8) );
    }

The following commands will build your libshr.a, and compile/link the
program usesub to use it.  Note that you need the ld option -lc for
sub2shr.o since it calls printf from /lib/libc.a.  [Note that you can leave
out the "-T512 -H512" on AIX 4. -- Ed.]

  $ cc  -c sub1.c
  $ ld -o sub1shr.o sub1.o -bE:sub1.exp -bM:SRE -T512 -H512 
  $ cc  -c sub2.c
  $ ld -o sub2shr.o sub2.o -bE:sub2.exp -bM:SRE -T512 -H512  -lc
  $ ar r libshr.a sub1shr.o sub2shr.o
  $ cc -o usesub usesub.c -L: libshr.a
  $ usesub
  The integer is: 13
  $

------------------------------

2.06: Linking my program fails with strange errors.  Why?

Very simple, the linker (actually called the binder), cannot get the
memory it needs, either because your ulimits are too low or because you
don't have sufficient paging space.  Since the linker is quite different
>from normal Unix linkers and actually does much more than these, it also
uses a lot of virtual memory.  It is not unusual to need 10000 pages (of
4k) or more to execute a fairly complex linking.

If you get 'BUMP error', either ulimits or paging is too low, if you get
'Binder killed by signal 9' your paging is too low.

First, check your memory and data ulimits; in korn shell 'ulimit -a' will
show all limits and 'ulimit -m 99999' and 'ulimit -d 99999' will
increase the maximum memory and data respectively to some high values. 
If this was not your problem, you don't have enough paging space.

If you will or can not increase your paging space, you could try this:

- Do you duplicate libraries on the ld command line? That is never
  necessary.

- Do more users link simultaneously? Try having only one linking going
  on at any time.

- Do a partwise linking, i.e. you link some objects/libraries with the
  -r option to allow the temporary output to have unresolved references,
  then link with the rest of your objects/libraries.  This can be split
  up as much as you want, and will make each step use less virtual memory.

  If you follow this scheme, only adding one object or archive at a
  time, you will actually emulate the behavior of other Unix linkers.

If you decide to add more paging space, you should consider adding a new
paging space on a second hard disk, as opposed to just increasing the
existing one.  Doing the latter could make you run out of free space on
your first harddisk. It is more involved to shrink a paging space
but easier to delete one.

------------------------------

2.07: Why does it take so long to compile "hello world" with xlc?

Some systems have experienced delays of more than 60 seconds in
compiling "#include <stdio.h> int main () {printf ("Hello world");}"
The problem is with the license manager contact IBM to make sure
you've got the latest PTF.

------------------------------

2.08: What's with malloc()?
 
malloc() uses a late allocation algorithm based on 4.3 BSD's malloc()
for speed.  This lets you allocate very large sparse memory spaces,
since the pages are not actually allocated until they are touched for
the first time.  Unfortunately, it doesn't die gracefully in the face of
loss of available memory.  See the "Paging Space Overview" under
InfoExplorer, and see the notes on the linker in this document for an
example of an ungraceful death.

If you want your program to get notified when running out of memory, you
should handle the SIGDANGER signal.  The default is to ignore it. 
SIGDANGER is sent to all processes when paging space gets low, and if
paging space gets even lower, processes with the highest paging space
usage are sent the SIGKILL signal.

malloc() is substantially different in 3.2, allocating memory more
tightly.  If you have problems running re-compiled programs on 3.2,
try running them with MALLOCTYPE=3.1.

Early Page Space Allocation (EPSA) added to AIX 3.2: see
/usr/lpp/bos/README.PSALLOC - IX38211 / U422496 Allows setting of
early allocation (vs. default late allocation) on a per-process basis.

------------------------------

2.09: Why does xlc complain about 'extern char *strcpy()'

The header <string.h> has a strcpy macro that expands strcpy(x,y) to
__strcpy(x,y), and the latter is then used by the compiler to generate
inline code for strcpy.  Because of the macro, your extern declaration
contains an invalid macro expansion.  The real cure is to remove your
extern declaration but adding -U__STR__ to your xlc will also do the
trick, although your program might run a bit more slowly as the compiler
cannot inline the string functions any more.

------------------------------

2.10: Why do I get 'Parameter list cannot contain fewer ....'

This is the same as above (2.9).

------------------------------

2.11: Why does xlc complain about
               '(sometype *)somepointer = something'

Software that is developed using gcc may have this construct. However,
standard C does not permit casts to be lvalues, so you will need to
change the cast and move it to the right side of the assignment. If you
compile with 'cc', removing the cast completely will give you a warning,
'xlc' will give you an error (provided somepointer and something are of
different types - but else, why would the cast be there in the first place?)

------------------------------

2.12: Some more common errors

Here are a few other common errors with xlc:

305 |     switch((((np)->navigation_type) ? (*((np)->navigation_type)) :
      ((void *)0)))
      .a...........  
a - 1506-226: (S) The second and third operands of the conditional
operator must be of the same type.

The reason for this is that xlc defines NULL as (void *)0, and it does
not allow two different types as the second and third operand of ?:. 
The second argument above is not a pointer and the code used NULL
incorrectly as a scalar. NULL is a nil pointer constant in ANSI C and
in some traditional compilers.

You should change NULL in the third argument above to an integer 0.


------------------------------

2.13: Can the compiler generate assembler code?

Starting with version 1.3 of xlc and xlf the -S option will generate a
.s assembly code file prior to optimization. The option -qlist will
generate a human readable one in a .lst file.

There is also a disassembler in /usr/lpp/xlc/bin/dis include with the
1.3 version of xlc (and in /usr/lpp/xlC/bin/dis with the 2.1 version
of xlC) that will disassemble existing object or executable files.

------------------------------

2.14: Curses

Curses based applications should be linked with -lcurses and _not_ with
-ltermlib. It has also been reported that some problems with curses are
avoided if your application is compiled with -DNLS.

Peter Jeffe <peter@ski.austin.ibm.com> also notes:

>the escape sequences for cursor and function keys are *sometimes*
>treated as several characters: eg. the getch() - call does not return
>KEY_UP but 'ESC [ C.'

You're correct in your analysis: this has to do with the timing of the
escape sequence as it arrives from the net. There is an environment
variable called ESCDELAY that can change the fudge factor used to decide
when an escape is just an escape. The default value is 500; boosting
this a bit should solve your problems.

Christopher Carlyle O'Callaghan <asdfjkl@wam.umd.edu> has more comments
concerning extended curses:

1) The sample program in User Interface Programming Concepts, page 7-13
   is WRONG. Here is the correct use of panes and panels.

#include <cur01.h>
#include <cur05.h>

main()
{
PANE *A, *B, *C, *D, *E, *F, *G, *H;
PANEL *P;

initscr();

A = ecbpns (24, 79, NULL, NULL, 0, 2500, Pdivszp, Pbordry, NULL, NULL);
D = ecbpns (24, 79, NULL, NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
E = ecbpns (24, 79, D,    NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
B = ecbpns (24, 79, A, D, Pdivtyh, 3000, Pdivszp, Pbordry, NULL, NULL);
F = ecbpns (24, 79, NULL, NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
G = ecbpns (24, 79, F,    NULL, 0, 5000, Pdivszp, Pbordry, NULL, NULL);
H = ecbpns (24, 79, G,    NULL, 0, 3000, Pdivszp, Pbordry, NULL, NULL);
C = ecbpns (24, 79, B, F, Pdivtyh, 0, Pdivszf, Pbordry, NULL, NULL);
P = ecbpls (24, 79, 0, 0, "MAIN PANEL", Pdivtyv, Pbordry, A);

ecdvpl (P);
ecdfpl (P, FALSE);
ecshpl (P); 
ecrfpl (P);
endwin();
}

2) DO NOT include <curses.h> and any other <cur0x.h> file together.
   You will get a bunch of redefined statements.

3) There is CURSES and EXTENDED CURSES. Use only one or the other. If the
   manual says that they're backwards compatible or some other indication 
   that you can use CURSES routines with EXTENDED, don't believe it. To 
   use CURSES you need to include <curses.h> and you can't (see above).

4) If you use -lcur and -lcurses in the same link command, you will get
   Memory fault (core dump) error. You CANNOT use both of them at the same
   time. -lcur is for extended curses, -lcurses is for regular curses.

5) When creating PANEs, when you supply a value (other than 0) for the
   'ds' parameter and use Pdivszf value for the 'du' parameter, the 'ds'
   will be ignored (the sample program on page 7-13 in User Interface
   Programming Concepts is wrong.) For reasons as yet undetermined,
   Pdivszc doesn't seem to work (or at least I can't figure out how to
   use it.)

6) If you're running into bugs and can't figure out what is happening,
   try the following:
   include -qextchk -g in your compile line
	-qextchk will check to make sure you're passing the right number of
  	 parameters to the functions
	-g enables debug

7) Do not use 80 as the number of columns if you want to use the whole
   screen. The lower right corner will get erased.  Use 79 instead.

8) If you create a panel, you must create at least 1 pane, otherwise you
   will get a Memory fault (core dump).

9) When creating a panel, if you don't have a border around it, any title
   you want will not show up.

10) to make the screen scroll down:
    wmove (win, 0, 0);
    winsertln (win)

11) delwin(win) doesn't work in EXTENDED WINDOWS

    To make it appear as if a window is deleted, you need to do the following:
    for every window that you want to appear on the screen
	touchwin(win)
	wrefresh(win)

    you must make sure that you do it in the exact same order as you put
    them on the screen (i.e., if you called newwin with A, then C, then B,
    then you must do the loop with A, then C, then B, otherwise you won't
    get the same screen back).  The best thing to do is to put them into
    an array and keep track of the last window index.

12) mvwin(win, line, col) implies that it is only used for viewports and
    subwindows. It can also be used for the actual windows themselves.

13) If you specify the attribute of a window using wcolorout(win), any
    subsequent calls to chgat(numchars, mode) or any of its relatives
    will not work. (or at least they get very picky.)

------------------------------

2.15: How do I speed up linking

Please refer to sections 2.03 and 2.06 above.

From: losecco@undpdk.hep.nd.edu (John LoSecco) and
      hook@chaco.aix.dfw.ibm.com (Gary R. Hook)

From oahu.cern.ch in /pub/aix3 you can get a wrapper for the existing
linker called tld which can reduce link times with large libraries by
factors of 3 to 4.

------------------------------

2.16: What is deadbeef?

When running the debugger (dbx), you may have wondered what the
'deadbeef' is you occasionally see in registers.  Do note, that
0xdeadbeef is a hexadecimal number that also happens to be some kind
of word (the RS/6000 was built in Texas!), and this hexadecimal number
is simply put into unused registers at some time, probably during
program startup.


------------------------------

2.17: How do I make an export list from a library archive?
From: d.dennerline@bull.com (Dave Dennerline)

[ This script has been moved to section 8.10 ]

------------------------------

2.19: Building imake, makedepend
From: crow@austin.ibm.com (David L. Crow)

[Editor's note: if you have AIX 4.x,  you need the X11.adt.imake LPP
and probably most if not all of the X11.adt.* LPPs.  Imake, xmkmf and
other utilities are delivered precompiled.]

    You need X11dev.src release 1.2.3.0 (ie the R5 release) [on AIX 3.2].


     Unless you have an R5 release of AIXwindows, there is no xmkmf.
  These are the steps that I use to make imake, makedepend and all
  of it's config files, and then install them in the working tree
  (ie not the Xamples) for daily use:
  
      cd /usr/lpp/X11/Xamples
      make Makefile
      make SUBDIRS="config util" Makefiles
      make SUBDIRS="config util" linklibs
      make SUBDIRS="config util" depend
      make SUBDIRS="config util" 
      make SUBDIRS="config util" install
      
  Then redo the steps everytime you apply an X11 update.

------------------------------

2.20: How can tell what shared libraries a binary is linked with?

Use "dump -H <execfilename>" and see if anything other than /unix is
listed in the loader section (at the bottom).  The first example is
/bin/sh (statically linked) and the second example is
/usr/local/bin/bash (shared).

INDEX  PATH                          BASE                MEMBER              
0      /usr/lib:/lib                                                         
1      /                             unix                                    

INDEX  PATH                          BASE                MEMBER              
0      ./lib/readline/:./lib/glob/:/usr/lib:/lib               
1                                    libc.a              shr.o               
2                                    libcurses.a         shr.o               

The freeware tool "ldd" lists all the shared libraries needed
by an executable, including those recursively included by other
shared libraries. See question 2.27 "Where can I find ldd for AIX?".

------------------------------

2.21: Can I get a PTF for my C/C++ compiler from the net?

<http://service.software.ibm.com/>  contains pointers to most PTFs, including
compilers.  You'll need the fixdist program (see 1.142) to retrieve them.

------------------------------

2.22: Why does "install"ing software I got from the net fail?

Note that the RS/6000 has two install programs, one with System V flavor
in the default PATH (/etc/install with links from /usr/bin and /usr/usg),
and one with BSD behavior in /usr/ucb/install.

------------------------------

2.23: What is Linker TOC overflow error 12?

There is a hard coded limit in the AIX 3.2.5 linker that is fixed in
AIX 4.1.  A kind soul donated the following information to help people
get the 3.2.5 fix

    The LPS (paperwork) 
      AIX TOC Data Binder/6000 #P91128
      Version 1.1
      Program Number 5799-QDY
      Reference No. GC23-2604-00, FC 5615
    Pre Reqs listed were AIX 3.2.5
      IBM C Set++ V2 (5765-186)

The above is not available any longer, see section 1.006.

You could also put some of the application code into shared libraries
or, in the case of gcc, use -mminimal-toc.

------------------------------

2.24: What is the limit on number of shared memory segments
               I can attach?

Each process has 16 segments.  One is used for private code, one for
stack, one for heap; those, if memory serves, are segments 0, 1, and
2.  (If you look in sys/shm.h, you'll see that SHMLOSEG is 3 -- the
lowest segment, in number and in the process' virtual address space,
available to shmat.)

SHMHISEG, the highest segment you can attach to (also defined in
sys/shm.h), is 12.  Segments 3 through 12 are available to shmat,
giving the 10 segments your program used successfully.  (NSHMSEGS in
sys/shm.h will give you this value, though it's of limited use, since
most platforms that I've seen don't define it.)

Segment 13 is used by shared code your program has attached to;
I think one of the others might be for kernel-mode data.

See also mmap.

------------------------------

2.25: I deleted libc.a by accident --- how do I recover?
From: Ed Ravin <eravin@panix.com>

You can recover from this without rebooting or reinstalling, if you
have another copy of libc.a available that is also named "libc.a".  If
you moved libc.a to a different directory, you're in luck -- do the
following:

export LIBPATH=/other/directory


And your future commands will work.  But if you renamed libc.a, this
won't do it.  If you have an NFS mounted directory somewhere, you can
put libc.a on the that host, and point LIBPATH to that directory as
shown above.

Failing that, turn off your machine, reboot off floppies or other
media, and get a root shell.  I don't think you should do "getrootfs"
as you usually do when accessing the root vg this way -- AIX may start
looking for libc.a on the disk, and you'll just run into the same
problem.  So do an importvg, varyonvg, and then mount /usr somewhere,
then manually move libc.a back or copy in a new one from floppy.

------------------------------

2.26: Where can I find dlopen, dlclose, and dlsym for AIX?

An implementation of these dynamic code loading functions was written by
Jens-Uwe Mager <jum@anubis.han.de> and can be found at
<http://www.han.de/~jum/aix/dlfcn.shar>

From: Gary R. Hook <hook@austin.ibm.com>

Starting with AIX 4.2 a dlopen et. al. are included in the base OS in
the libdl.a library. Under AIX 4.1 this is available as SLHS (Shared
Library Hookable Symbols) as APAR IX IX71849 for the runtime package and
APAR IX IX72973 for the development tools.

------------------------------

2.27: Where can I find ldd for AIX?
From: Jens-Uwe Mager <jum@anubis.han.de>

Try <http://www.han.de/~jum/aix/ldd.c>. Also the "aix.tools"
package from <http://www-frec.bull.com>

------------------------------

2.28:  How do I make my program binary executable on the
                POWER, POWER2, and POWERPC architecures?

AIX will emulate those instructions not available in POWERPC processors, but
you can avoid this emulation and consequent performance degradtation by
using only the common to all.

If you are using IBM's xlc (cc) compiler, the default is to use the common
instruction set.  If you want to be explicit, use the -qarch=com option.

The option -mcpu=common makes GCC use the common instruction set.  Please
note that (unlike xlc) this is *not* the default with GCC on AIX.

------------------------------

2.29: How do I access more than 256 Megabytes of memory?

By default each program gets one segment register (see 2.24) for its
data segment. As each segment register covers 256 MB, any calls to
malloc more will fail. Also programs that declare large global or static
arrays may fail to load. To allocate more segment registers to your
program, use the linker option -bmaxdata to specify the number of bytes
you need in the data segment as follows:

cc -o myprog -bmaxdata:0x20000000 myprog.c

The example above would allocate an additional segment register to allow
for 512MB of data.

------------------------------

2.30: How do I use POSIX threads with gcc 2.7.x?
From: David Edelsohn <dje@watson.ibm.com>

The code generated by GCC is compatible with threads, but gcc-2.7 
was released so long ago that it did not provide an option to perform
the extra link steps necessary to support threads:

1) Compile all source files with "-D_THREAD_SAFE" macro defined.
2) Link with "-L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a"
   to obtain the pthreads support 
   and add "-nostartfiles /usr/lib/crt0_r.o" to the beginning of the
   link command line (using gcc to link!) to initialize threads.

------------------------------

2.31: Why does pthread_create return the error code 22?

Using Posix threads under AIX requires a special C runtime startup
initialization as well as special versions of some libraries. The IBM C
compiler includes these special libraries if called by the name xlc_r
(or xlC_r for C++). There also other maing variations to support various
defaults, consult the file /etc/xlC.cf for details.

------------------------------

2.32: How do I build programs under a later AIX release that run
	under earlier releases as well?

IBM develops AIX only for binary compatibility with older AIX releases,
not the other way around. You will thus need to build programs on the
oldest AIX release the program is supposed to run on. You will also need
to link programs dynamically, if you link in the system libraries
statically the program will probably only run on the machine you
performed the link on.

With some preparation it is appearently possible to get around that
limitation. Bob Halblutzel has put together a web page describing the
detailed steps how to set up such a build environment at the following
web page:

<http://www.hablutzel.com/aix_compatibility_build.html>

Please not that this is not a supported way to build your programs, you
will probably receive not any support by IBM if you have problems with
that environment.

------------------------------

3.00: Fortran and other compilers

This section covers all compilers other than C/C++.  On Fortran, there
seem to have been some problems with floating point handling, in
particular floating exceptions.

------------------------------

3.01: I have problems mixing Fortran and C code, why?

A few routines (such as getenv, signal, and system) exist in both the
Fortran and C libraries but with different parameters. In the recent
past, if you have a mixed program that calls getenv from both C and
Fortran code, you have to link them carefully by specifying the correct
library first on your command line. This is no longer needed starting
with version 1.5 of the compilers.


------------------------------

3.02: How do I statically bind Fortran libraries and dynamically
               bind C libraries?
From: amaranth@vela.acs.oakland.edu (Paul Amaranth)

[ Editor's note: Part of this is also discussed above under the C compiler
  section, but I felt it was so valuable that I have left it all in. 
  I've done some minor editing, mostly typographical. ]

The linker and binder are rather versatile programs, but it is not
always clear how to make them do what you want them to.  In particular,
there are times when you do not want to use shared libraries, but
rather, staticly bind the required routines into your object.  Or, you
may need to use two versions of the same routine (eg, Fortran & C).  Here
are the results of my recent experiments.  I would like to thank Daniel
Premer and Brad Hollowbush, my SE, for hints.  Any mistakes or omissions
are my own and I have tended to interchange the terms "linker" and
"binder".  These experiments were performed on AIX 3.1.2.  Most of this
should be applicable to later upgrades of 3.1.

1)  I have some C programs, I want to bind in the runtime routines.  How
    do I do this? [Mentioned in section 2.04 of this article as well, ed.]

    You can put the -bnso binder command on the link line.  You should
    also include the -bI:/lib/syscalls.exp control argument:
      
      $ cc *.o -bnso -bI:/lib/syscalls.exp -o foo

    This will magically do everything you need.  Note that this will bind
    _all_ required routines in.  The -bI argument tells the linker that
    these entry points will be resolved dynamically at runtime (these are
    system calls).  If you omit this you will get lots of unresolved 
    reference messages.

2)  I want to statically bind in the Fortran runtime so a) my customers 
    do not need to buy it and b) I don't have to worry about the runtime
    changing on a new release.  Can I use the two binder arguments in
    1) to do this?

    You should be able to do so, but, at least under 3002, if you do
    you will get a linker error referencing getenv.  In addition, there
    are a number of potential conflicts between Fortran and C routines.
    The easy way just does not work.  See the section on
    2 stage linking for C and Fortran on how to do this.  The getenv
    problem is a mess, see the section on Comments & Caveats for more.

    From: Gary R. Hook <hook@austin.ibm.com>

    The xlf runtime is a no-charge feature, you can download and install
    it without having to buy it. This change was made >2 years ago.

3)  I have a mixture of C and Fortran routines, how can I make sure
    that the C routines reference the C getenv, while the Fortran routines
    reference the Fortran getenv (which has different parameters and, if
    called mistakenly by a C routine results in a segmentation fault)?

    From Mike Heath (mike@pencom.com):

    Use -brename:symbol1,symbol2 when pre-linking the modules from one
    of the languages. It does not matter which one you choose.

4)  I have C and Fortran routines.  I want to bind in the xlf library, while
    letting the rest of the libraries be shared.  How do I do this?

    You need to do a 2 stage link.  In the first stage, you bind in the
    xlf library routines, creating an intermediate object file.  The
    second stage resolves the remaining references to the shared libraries.

    This is a general technique that allows you to bind in specific system
    routines, while still referencing the standard shared libraries.

    Specifically, use this command to bind the xlf libraries to the Fortran
    objects:

       $ ld -bh:4 -T512 -H512 <your objects> -o intermediat.o \
         -bnso -bI:/lib/syscalls.exp -berok -lxlf -bexport:/usr/lib/libg.exp \
         -lg -bexport:<your export file>

    The argument -bexport:<your export file> specifies a file with the
    name of all entry points that are to be visible outside the intermediate 
    module.  Put one entrypoint name on a line.  The -bI:/lib/libg.exp line 
    is required for proper functioning of the program.  The -berok argument 
    tells the binder that it is ok to have unresolved references, at least 
    at this time (you would think -r would work here, but it doesn't seem to).  
    The -bnso argument causes the required modules to be imported
    into the object.  The -lxlf, of course, is the xlf library.

    Then, bind the intermediate object with the other shared libraries in
    the normal fashion:

       $ ld -bh:4 -T512 -H512 <C or other modules> intermediate.o \
         /lib/crt0.o -lm -lc

    Note the absence of -berok.  After this link, all references should
    be resolved (unless you're doing a multistage link and making another
    intermediate).

    NOTE THE ORDER OF MODULES.  This is extremely important if, for example,
    you had a subroutine named "load" in your Fortran stuff.  Putting the
    C libraries before the intermediate module would make the C "load"
    the operable definition, rather than the Fortran version EVEN THOUGH 
    THE FORTRAN MODULE HAS ALREADY BEEN THROUGH A LINK AND ALL REFERENCES 
    TO THE SYMBOL ARE CONTAINED IN THE FORTRAN MODULE.  This can
    be extremely difficult to find (trust me on this one :-)  Is this
    a bug, a feature, or what?
    
    [As mentioned in section 2.03 of this article, it is a feature that you
    can replace individual objects in linked files, ed.]

    The result will be a slightly larger object than normal.  (I say slightly
    because mine went up 5%, but then it's a 2 MB object :-)


Comments & Caveats:

   From the documentation the -r argument to the linker should do what
   -berok does.  It does not.  Very strange results come from using the
   -r argument.  I have not been able to make -r work in a sensible manner
   (even for intermediate links which is what it is supposed to be for).

       Note from Mike Heath (mike@pencom.com):

       'ld -r' is essentially shorthand for 'ld -berok -bnogc -bnoglink'.
       Certainly, using -berok with an export file (so garbage collection
       can be done) is preferable to ld -r, but the latter is easier.

   When binding an intermediate module, use an export file to define the
   entry points you want visible in the later link.  If you don't do this,
   you'll get the dreaded "unresolved reference" error.  Import files name
   entry points that will be dynamically resolved (and possibly where).

   If you are in doubt about what parameters or libraries to link, use the
   -v arg when linking and modify the exec call that shows up into 
   an ld command.  Some thought about the libraries will usually yield an
   idea of when to use what.  If you don't know what an argument is for,
   leave it in.  It's there for a purpose (even if you don't understand it).

   Watch the order of external definitions (ie, libraries) when more than
   one version of a routine may show up, eg "load".  The first one defined
   on the ld command line is the winner.  

   The getenv (and system and signal) problem is a problem that started out
   minor, got somewhat worse in 3003 and, eventually will be correctly fixed.
   Basically, you should extract the 3002 version of these three routines
   from xlf.a before doing the update and save them away, then link these
   routines in if you use these Fortran system services.  


------------------------------

3.03: How do I check if a number is NaN?
From: sdl@glasnost.austin.ibm.com (Stephen Linam)

NaN is "Not a Number".  It arises because the RISC System/6000 uses
IEEE floating point arithmetic.

To determine if a variable is a NaN you can make use of the property
that a NaN does not compare equal to anything, including itself.
Thus, for real variable X, use

	IF (X .NE. X) THEN	! this will be true if X is NaN

Floating point operations which cause exceptions (such as an overflow)
cause status bits to be set in the Floating Point Status and Control
Register (FPSCR).  There is a Fortran interface to query the FPSCR, and
it is described in the XLF Fortran manuals -- I don't have the manuals
right here, but look for FPGETS and FPSETS.

The IBM manual "Risc System/6000 Hardware Technical Reference - General
Information" (SA23-2643) describes what floating point exceptions can
occur and which bits are set in the FPSCR as a result of those exceptions.


------------------------------

3.04: Some info sources on IEEE floating point.

1. ANSI/IEEE STD 754-1985 (IEEE Standard for Binary Floating-Point
   Arithmetic) and ANSI/IEEE STD 854-1987 (IEEE Standard for
   Radix-Independent Floating-Point Arithmetic), both available from IEEE. 

2. David Goldberg, "What Every Computer Scientist Should Know About
   Floating-Point Arithmetic", ACM Computing Surveys, Vol. 23, No. 1,
   March 1991, pp. 5-48.

------------------------------

3.05: Why does it take so long to compile "hello world" with xlf? 

[read 2.07]

------------------------------

4.00: GNU and Public Domain software

GNU software comes from the Free Software Foundation and various other
sources. A number of ftp sites archive them. Read the GNU license for 
rules on distributing their software.

Lots of useful public domain software have been and continue to be ported
to the RS/6000. See below for ftp or download information.

------------------------------

4.01: How do I find sources?
From: jik@GZA.COM (Jonathan Kamens)

There is a newsgroup devoted to posting about how to get a certain
source, comp.sources.wanted.  An archive of information about sources,
including FTP sites is available from

------------------------------

4.02: Are there any ftp or WWW sites?

SMIT-installable precompiled packages of popular freeware for AIX 4.x at
<http://www-frec.bull.com/>.  Download the ".exe" files with your WWW
browser. These are auto-uncompressing files, just like on PCs (it uses
similar technology to PKZIP). Mark the file as executable (chmod +x),
then execute it to generate a .bff file. The .bff file can then be
installed using "smit install_latest". For more information
read the INSTALL.txt file on the server.

There are mirrors of this site at http://www.bull.de/ and
http://ftp.univie.ac.at/aix/.

The package explicitly referenced below are ones Ciaran consideres
"solid."  That is, the binary has been "tested by lots of people."

Bull provides many other freeware packages as well.  If you use the
service,  be sure and thank Ciaran and Bull.

Below are some ftp sites that are supposed to have RS/6000 specific
software.  I haven't verified all the entries.

US sites:
<ftp://aixpdslib.seas.ucla.edu/pub/>		128.97.2.211
<ftp://aix.boulder.ibm.com/>
<ftp://software.watson.ibm.com/>

European sites:
<ftp://nic.funet.fi/pub/unix/AIX/RS6000/>		128.214.6.100
<ftp://iacrs1.unibe.ch/pub/>			130.92.11.3
<ftp://ftp.zrz.TU-Berlin.DE/pub/aix/>		130.149.4.50
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>	129.104.3.60
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>		129.69.8.13

The first one is dedicated to software running on AIX.  It might not
always be the latest versions of the software, but it has been ported
to AIX (normally AIX version 3 only).  Please use the European sites
very sparingly.  They are primarily to serve people in Europe and most
of the software can be found in the US sites originally.

The remaining sites are simply ones that archie indicated contained
AIX related materials.

<ftp://ibminet.awdpa.ibm.com/>	#IBM announcements, oem hardware
<ftp://cac.toronto.ibm.com/>	#marketing-info
<ftp://ftp.egr.duke.edu/>
<ftp://straylight.acs.ncsu.edu/>
<ftp://alpha.gnu.ai.mit.edu/rs6000>
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>
<ftp://iacrs2.unibe.ch/pub/aix/>
<ftp://ftp.u.washington.edu/pub/RS6000/>
<ftp://aixive.unb.ca/>
<ftp://ftp.ans.net/pub/misc/>
<ftp://uvaarpa.virginia.edu/pub/misc/>
<ftp://ux1.cts.eiu.edu/pub/rs6000/>
<ftp://ftp.bsc.nopub/Src/>
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>
<ftp://aix1.segi.ulg.ac.be/pub/aix/>
<ftp://byron.u.washington.edu/pub/aix/>
<ftp://cunixf.cc.columbia.edu/aix/>
<ftp://files1zrz.zrz.tu-berlin.de/pub/aix/>
<ftp://ftp.rz.uni-augsburg.de/pub/aix/>
<ftp://fyvie.cs.wisc.edu/pub/aix/>
<ftp://solaria.cc.gatech.edu/pub/aix/>
<ftp://spot.colorado.edu/aix/>
<ftp://swdsrv.edvz.univie.ac.at/unix/systems/aix/>
<ftp://switek.uni-muenster.de/pub/aix/>
<ftp://wuarchive.wustl.edu/systems/aix/>
<ftp://cs.nyu.edu/pub/AIX/>
<ftp://karazm.math.uh.edu/pub/AIX/>
<ftp://minnie.zdv.uni-mainz.de/pub0/pub/AIX/>
<ftp://oersted.ltf.dth.dk/pub/AIX/>
<ftp://rs3.hrz.th-darmstadt.de/pub/incoming/AIX/>
<ftp://aeneas.mit.edu/pub/rs6000/>
<ftp://cameron.egr.duke.edu/rs6000/>
<ftp://ifi.informatik.uni-stuttgart.de/pub/rs6000/>
<ftp://metropolis.super.org/pub/rs6000/>
<ftp://ramses.cs.cornell.edu/pub/rs6000/>
<ftp://server.uga.edu/pub/rs6000/>
<ftp://uvaarpa.virginia.edu/pub/rs6000/>
<ftp://wayback.cs.cornell.edu/pub/rs6000/>
<ftp://alice.fmi.uni-passau.de/pub/RS6000/>
<ftp://byron.u.washington.edu/pub/aix/RS6000/>
<ftp://milton.u.washington.edu/pub/RS6000/>
<ftp://pascal.math.yale.edu/pub/RS6000/>
<ftp://uxc.cso.uiuc.edu/pub/RS6000/>

------------------------------
4.03: Why does "install"ing software I got from the net fail?

This answer was moved to section 2.22

------------------------------

4.04: GNU Emacs

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

If you get a segmentation fault in GNU EMACS 19.* during hilit19 use,
you can set locale to C (export LC_ALL=C) to get around the AIX bug.

Version 18.57 of GNU Emacs started to have RS/6000 support.  Use
s-aix3-2.h for AIX 3.2. Emacs is going through rapid changes recently.
Current release is 19.x.

Emacs will core-dump if it is stripped, so don't strip when you install
it.  You can edit a copy of the Makefile in src replacing all 'install -s' 
with /usr/ucb/install.

------------------------------

4.05: gcc/gdb

GNU C version 2.0 and later supports the RS/6000, and compiles straight
out of the box on AIX 3 and AIX 4.1 and 4.2.  You may, however,
experience that compiling it requires large amounts of paging space.

On AIX 4.3, compiling gcc appears to be much more difficult due to
changes for the 64 bit environment. A precompiled gcc is available in
the form of egcs in the Bull archive at <http://www-frec.bull.com/>.

From: Ciaran Deignan <Ciaran.Deignan@bull.net>

Note:
  - there is a link problem on AIX 4.3. Until I find a way of building
    a distribution on AIX 4.3, you'll have to use 'ld'.
  - The package gnu.egcs-1.1.0.0.exe does not contain the C++ compiler
    (G++). However since you can't link a G++ object file with 'ld',
    this is just part of the same problem.

[Editor's note: from the latest postings it appears that the latest
(post 1.1b) egcs snapshots fixes the problem with collect2. The problem
here is that there are no binary distributions yet, one has to bootstrap
this version using IBM's C compiler.]

From: Brent Burkholder <bburk@bicnet.net>

In order to compile and link using egcs on AIX you first
need to download and apply fix APAR IX87327
from
<http://service.boulder.ibm.com/cgi-bin/support/rs6000.support/downloads>
Looking up the APAR # should allow you to download
bos.rte.bind_cmds.4.3.2.2 which fixes all problems.

------------------------------

4.06: GNU Ghostscript 

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

The PostScript interpreter GNU Ghostscript Version 2.3 and later supports
the RS/6000 and can be found on various ftp sites. Current version is 2.6.1.

Compile time problems:
  Compile idict.c and zstack.c _without_ optimization, add the following
  to the Makefile:

  idict.o: idict.c
        $(CC) -c idict.c

  zstack.o: zstack.c
        $(CC) -c zstack.c

Run time problems:
  Running ghostview-1.5 with ghostscript-2.6.1, I get 
   gs: Malformed ghostview color property.
  Solution: replace buggy version of ghostscript-2.6.1 X11 driver
  with at least 2.6.1pl4 

------------------------------

4.07  TeX - Document processing
From: "Patrick TJ McPhee" <ptjm@ican.net>

TeX can be retrieved via ftp from the comprehensive TeX archive
network (CTAN). The principle sites are
ftp.tex.ac.uk (UK)
ftp.dante.de  (Deutschland)
ftp.tug.org  (USA)
but there are many mirrors. finger ctan@ftp.tex.ac.uk for a list.

------------------------------

4.08  Perl - Scripting language

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

If you want the source code, <http://www.perl.com/perl/> is good place
to start.

------------------------------

4.09: X-Windows

AIX 4.x ships with X11R5 and Motif 1.2.

On AIX 3.2 the base version has X11R4 and Motif 1.1 and the extended
version has X11R5 as AIXwindows 1.2.3.  See question 1.500 for more
information about determining your revision.

AIXwindows version 1.2.0 (X11rte 1.2.0) is X11R4 with Motif 1.1
AIXwindows version 1.2.3 (X11rte 1.2.3) is X11R5 with Motif 1.1
'lslpp -h X11rte.motif1.2.obj' should tell you if you are
running Motif 1.2.

------------------------------

4.10  Bash - /bin/ksh alternative from FSF

Bash is an alternative to ksh and is availible from prep.ai.mit.edu
and places that mirror the GNU software.  /etc/security/login.cfg
needs to be modified if this will be used as a default shell.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

------------------------------

4.11: Elm

A very nice replacement for mail. Elm should be pretty straightforward,
the only thing to remember is to link with -lcurses as the only
curses/termlib library. You may also run into the problem listed under
point 2.13 above.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>.

------------------------------

4.12: Oberon 2.2
From: afx@muc.ibm.de (Andreas Siegert)

Oberon is Wirth's follow on to Modula-2, but is not compatible. A free
version of Modula-3 is available from DEC/Olivetti at
gatekeeper.dec.com. This is not a Modula-2 replacement but a new
language. There are currently two M2 compilers for the 6000 that I
know of. One from Edinburgh Portable Compilers, +44 31 225 6262 (UK)
and the other from Gardens Point is availible through A+L in
Switzerland (+41 65 520311) or Real Time Associates in the UK
(info@rtal.demon.co.uk).

Oberon can be obtained via anonymous ftp from neptune.inf.ethz.ch
(129.132.101.33) under the directory Oberon/RS6000 or gatekeeper.dec.com
(16.1.0.2).

------------------------------

4.13: Kermit - Communications
From: Frank da Cruz <fdc@watsun.cc.columbia.edu>

Available for all versions of AIX on RS/6000, PowerPC, PS/2, RT PC,
and 370-Series mainframes.  For complete information on Kermit software
for AIX and hundreds of other platforms, visit the Kermit Web site:

  <http://www.columbia.edu/kermit/>

C-Kermit 6.0 was announced November 30, 1996:

  <http://www.columbia.edu/kermit/ck60.html>

The nonprofit Kermit Project is funded primarily by manual sales.
For C-Kermit 6.0 the manual is the new second edition of "Using C-Kermit":

  <http://www.columbia.edu/kermit/ck60manual.html>

For RS/6000 and PowerPC with AIX 3.x or 4.x:

  <ftp://kermit.columbia.edu/kermit/archives/cku192.tar.Z> (or .gz)

Uncompress, untar (tar xvf cku192.tar) then:

  make rs6aix32c  <--  For AIX 3.x
  make rs6aix41c  <--  For AIX 4.x

This produces an exutable called "wermit".  Before installing, read the
instructions in ckuins.doc from the tar file.

If you don't have a C compiler, you can get binaries at:

  <http://www.columbia.edu/kermit/ck60ubin.html>

Send questions to kermit-support@columbia.edu.

------------------------------

4.14: Gnu dbm
From: doug@cc.ysu.edu (Doug Sewell)

Here's the fixes for RS/6000's:

apply this to testgdbm.c:
158c158
<   char opt;
---
>   int opt;
166c166
<   while ((opt = getopt (argc, argv, "rn")) != -1)
---
>   while ((opt = getopt (argc, argv, "rn")) != EOF)

Apply this to systems.h:
111a112,114
> #ifdef RS6000
> #pragma alloca
> #else
112a116
> #endif

To compile, edit the Makefile.  Set CC to bsdcc (see /usr/lpp/bos/bsdport
if you don't have 'bsdcc' on your system) and set CFLAGS to -DRS6000 and
whatever options (-g, -O) you prefer.  Don't define SYSV.

------------------------------

4.15  tcsh - an alternative shell
From: cordes@athos.cs.ua.edu (David Cordes)

tcsh is available from <ftp://ftp.deshaw.com/pub/tcsh>
Compiles with no problems. You must edit /etc/security/login.cfg to
permit users to change to this shell (chsh), adding the path where the
shell is installed (in my case, /usr/local/bin/tcsh).

>From: "A. Bryan Curnutt" <bryan@Stoner.COM>

Under AIX 3.2.5, you need to modify the "config.h" file, changing
    #define BSDSIGS
to
    #undef BSDSIGS

------------------------------

4.16: Kyoto Common Lisp

The sources are available from cli.com. The kcl package is the needed
base; also retrieve the latest akcl distribution. akcl provides a
front-end that "ports" the original kcl to a number of different
platforms. The port to the 6000 worked with no problems. However, you
must be root for make to work properly with some memory protection
routines.

------------------------------

4.17  Tcl/Tk - X-Windows scripting

Current versions: Tcl 8.0b2 and Tk 8.0b2.  They are available from
<ftp://ftp.sunlabs.com/pub/tcl/>. The Tcl/Tk web page is at
<http://sunscript.sun.com/>.

Prebuilt installp (smit) installable packages for several versions of Tcl and
Tk are available from <http://www-frec.bull.com/>.

------------------------------

4.18: Expect
From: Doug Sewell <DOUG@YSUB.YSU.EDU>
   
To build the command-interpreter version, you must have the tcl library
built successfully. The expect library doesn't require tcl.  Note:
Expect and its library are built with bsdcc, so applications using
the library probably also need to be developed with bsdcc.

I ftp'd expect from ftp.cme.nist.gov.

You need to change several lines in the makefile.  First you need
to customize source and target directories and files:
#
TCLHDIR = /usr/include
TCLLIB = -ltcl
MANDIR = /usr/man/manl               (local man-pages)
MANEXT = l
BINDIR = /u/local/bin
LIBDIR = /usr/lib
HDIR = /usr/include
...
Next set the compiler, switches, and configuration options:
#
CC = bsdcc
CFLAGS = -O
...
PTY_TYPE = bsd
...
INTERACT_TYPE = select
...
Then you need to make these changes about line 90 or so:
comment out CFLAGS = $(CLFLAGS)
un-comment these lines:
CFLAGS = $(CLFLAGS) $(CPPFLAGS)
LFLAGS = ($CLFLAGS)

Then run 'make'.

You can't run some of the examples without modification (host name,
etc).  I don't remember if I ran all of them or not, but I ran enough
that I was satisfied it worked.

------------------------------

4.19: Public domain software on CD
From: mbeckman@mbeckman.mbeckman.com (Mel Beckman)

The Prime Time Freeware CD collection is a package of two CD's and docs
containing over THREE GIGABYTES of compressed Unix software. It costs $69
>from Prime Time Freeware, 415-112 N. Mary Ave., Suite 50, Sunnyvale, CA
94086. Phone 408-738-4832 voice, 408-738-2050 fax. No internet orders as
far as I can tell.

I've extracted and compiled a number of the packages, and all have worked
flawlessly so far on my 220. Everything from programming languages to 3D
solid modeling is in this bonanza!

[Ed: The O'Reilly book, Unix Power Tools, also contains a CD-ROM with lots
of useful programs compiled for the RS/6000, among other platforms.]

------------------------------

4.20: Andrew Toolkit

From: Gary Keim <gk5g+@andrew.cmu.edu>

The Andrew Toolkit Consortium of Carnegie Mellon University's School of
Computer Science has released new versions of the Andrew User
Environment, Andrew Toolkit, and Andrew Message System.

The Andrew User Environment (AUE) is an integrated set of applications
beginning with a 'generic object' editor, ez, a help system, a system
monitoring tool (console), an editor-based shell interface (typescript),
and support for printing multi-media documents. 

The Andrew Toolkit (ATK) is a portable user-interface toolkit that runs
under X11. It provides a dynamically-loadable object-oriented
environment wherein objects can be embedded in one another. Thus, one
could edit text that, in addition to containing multiple fonts, contains
embedded raster images, spreadsheets, drawing editors, equations, simple
animations, etc. These embedded objects can also be nested.

The Andrew Message System (AMS) provides a multi-media interface to mail
and bulletin-boards. AMS supports several mail management strategies
and implements many advanced features including authentication, return
receipts, automatic sorting of mail, vote collection and tabulation,
enclosures, audit trails of related messages, and subscription
management. It has interfaces that support ttys, personal computers, 
and workstations.

Release 5.1 of Andrew contains many bug fixes and updates. There is now
support for the new Internet MIME (Multipurpose Internet Mail Extensions)
standards for multipart, and multimedia mail. For more information on
MIME, please see the CHANGES files in the ftp directory on
emsworth.andrew.cmu.edu.

This release can be obtained as follows. The sources are available via
anonymous ftp from export.lcs.mit.edu (18.30.0.238) in the
./contrib/andrew tree. For details, see ./contrib/andrew/README.

PATCH for AIX3.2: A patch to the AUIS 5.1 sources can be ftp'ed from
emsworth.andrew.cmu.edu (128.2.45.40) in ./aixpatch. For those without
internet access, a 3.5" diskette can be ordered for a nominal fee of $10
by sending, or faxing, a purchase order to the Consortium address below.

Andrew, as well as a variety of other CMU software, can also be ftp'ed
>from emsworth.andrew.cmu.edu (128.2.30.62). Those with AFS access look
at /afs/andrew.cmu.edu/itc/sm/releases/X.V11R5/ftp.

Remote Andrew Demo Service 

This network service allows you to run Andrew Toolkit applications
without obtaining or compiling the Andrew software. You need a host
machine running X11 on the Internet. A simple "finger" command will let
you experience ATK applications firsthand. You'll be able to compose
multimedia documents, navigate through the interactive Andrew Tour, and
use the Andrew Message System to browse through CMU's three thousand
bulletin boards and newsgroups.

To use the Remote Andrew Demo service, run the following command:

    finger help@atk.itc.cmu.edu 

The service will give you further instructions.

Information Sources

Your bug reports are welcome; kindly send them to
info-andrew-bugs@andrew.cmu.edu and we will periodically post a status
report to the mailing list info-andrew@andrew.cmu.edu. To be added to
the mailing list or make other requests, send mail to
info-andrew-request@andrew.cmu.edu.

We also distribute the following related materials:

ATK and AMS sources and binaries on CDROM. Binaries are available
for the following system types: 

        	IBM RiscSystem/6000 
		Sun SparcStation 
		HP 700 Series 
		DECstation 

ATK and AMS sources on QIC and Iotamat tapes Hardcopies of the
documentation for ATK and AMS. Introductory video tape: Welcome to
Andrew: An Overview of the Andrew System. Technical video tape: The
Andrew Project: A Session at the Winter 1988 Usenix Conference.

More information about these materials is available from:

    Information Requests
    Andrew Toolkit Consortium
    Carnegie Mellon University
    4910 Forbes Avenue, UCC 214
    Pittsburgh, PA 15213-3890
    USA
    phone: +1-412-268-6710
    fax: +1-412-621-8081
    info-andrew-request@andrew.cmu.edu

There is also a netnews distribution list, comp.soft-sys.andrew, which
is identical to the info-andrew list except that it does not support the
multi-media capabilities of info-andrew.

------------------------------

4.21: sudo


Sudo (superuser do) allows a system administrator to give certain users (or
groups of users) the ability to run some (or all) commands as root while
logging all commands and arguments. Sudo operates on a per-command basis, it
is not a replacement for the shell. 

The latest version of sudo is cu-sudo v1.5.  There is a web page for sudo at
<http://www.courtesan.com/courtesan/products/sudo/sudo.html>.  The program
itself can be obtained from <ftp://ftp.courtesan.com/pub/sudo/>.  Sudo's
author, Todd Miller < Todd.Miller@courtesan.com> reports that sudo works on
both AIX 3.2.X and 4.1.X. 


------------------------------

4.22: Flexfax/HylaFax and other fax software

From: Christian Zahl <czahl@cs.tu-berlin.de>

Sam Leffler has released a new version of FlexFax called HylaFax.  It
is availible from <ftp://sgi.com/sgi/fax/>.  There is a HlyaFax web
page at <http://www.vix.com/hylafax/>.  Version V3.0pl1
supported many types of Class 1/2 fax modems and several UNIX systems
including AIX 3.2.3 or greater.  There is also a fax modem review
document at the same site as <ftp://sgi.com/pub/fax/bakeoff>. The FlexFax
related files on sgi.com are replicated on ftp.bsc.no as well.

>From: michael@hal6000.thp.Uni-Duisburg.DE (Michael Staats)

We're using mgetty+sendfax for the basic modem I/O, I wrote a printer
backend for the modem so that users can send faxes as easy as they print
postscript. I also wrote a little X interface composer to generate a
fax form that makes sending faxes very easy. You can find these
programs at hal6000.thp.Uni-Duisburg.DE under /pub/source.

program				comment

mgetty+sendfax-0.14.tar.gz	basic modem I/O, needs hacking for AIX
X11/xform-1.1.tar.gz	     	small and simple X interface composer
				with an example fax form. Needs
				libxview.a incl. headers.
faxiobe.tar.gz			fax backend, needs configuring for
				your local site

If you need a binary version of libxview.a and the headers you'll find
them under /pub/binaries/AIX-3-2/lxview.tar.gz.

------------------------------

4.23: lsof - LiSt Open Files

From: abe@purdue.edu (Vic Abell)

Q. How can I determine the files that a process has opened?
Q. How can I locate the process that is using a specific network address?
Q. How can I locate the processes that have files open on a file system?

A. Use lsof (LiSt Open Files).

From: "Juan G. Ruiz Pinto" <jgruiz@cyber1.servtech.com>

Lsof is available via anonymous ftp from
<ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/lsof.tar.Z>
(for the most current version). There are binary distributions in the
"binary" directory.

A prebuilt installp (smit) installable package is available from
<http://www-frec.bull.com/>. The installation scripts in this package
automatically creates a group "kmem" during the install
and uses "acledit" to allow the kmem group to read /dev/mem and /dev/kmem.
This configuration is recommended by Vic Abell <abe@purdue.edu>, the
author of lsof.

------------------------------

4.24: popper - POP3 mail daemon


The POP server is available via anonymous ftp from 
ftp.qualcomm.com:/quest/unix/servers/popper
  The makefile supports AIX
ftp.CC.Berkeley.EDU (128.32.136.9, 128.32.206.12).
  There are two versions in the pub directory: a compressed tar file
  popper-version.tar.Z and a Macintosh StuffIt archive in BinHex format
  called MacPOP.sit.hqx.

Problems building some versions of popper can sometimes be resolved by
compiling with bsdcc or -D_BSD.

The pine 3.95 package on <http://www-frec.bull.com/> contains "plug
and play" support for both POP3 and IMAP mail reading protocols.  You
can also get a compiled version of qpopper 2.2 there also.

------------------------------

4.26: mpeg link errors version 2.0

From: Nathan Lane <nathan@seldon.foundation.tricon.com>

.XShmCreateImage
.XShmDetach
.XShmAttach
.XShmGetEventBase
.XShmPutImage
.XShmQueryExtension

... are for the Shared Memory extension of the X server.
You can either choose to build it with shared memory or without.  I
always do it without the performance increase is not really
incredible, except on something like a 2x0 machine with the local bus
graphics adapter.  Just take out "DSH_MEM" in the CFLAGS in the
makefile for mpeg_play.  There is more information about shared memory
link errors in section 1.513.

Also, in the module "video.c" for mpeg_play it will complain about not
having enough memory to fully optimize one of the loops.  You can get
around that by specificying "qmaxmem=8000" in your cflags line, BUT,
the extra optimization does little good in my tests.

------------------------------

4.27: NNTP, INN


Link errors compiling nntp may occur because your machine lacks the
"patch" command.  Patch can be obtained from GNU repositories.  See question

4.29 for more information on patch.


------------------------------

4.28: Zmodem - File transfer

RZSZ is Chuck Forsberg's script for Z-modem. It is available by ftp at
<ftp://oak.oakland.edu/pub/unix-c/xyzmodem/rzsz9305.tar.Z> or
directly from Forsberg at Omen Technology BBS at 503-621-3746.

Hints:
0. Build with "make posix"
1. Use an 8-bit clean version of rlogin or telnet (Note: below)
2. Set the system to be transparent, I use "terminal download" 
3. Ensure hardware flow-control

Note, carlson@xylogics.com (James Carlson) suggests: Rlogin is
"slightly" unclean -- if an FF FF 73 73 appears in the datastream, it
can be ripped out by rlogind as a 'window size change' request.

[Ed note: The important part is using an 8-bit clean application,
since there are several implemenations of rlogin and telnet availible
you may need to try both and hunt down manuals to find the right flags
for your system]

------------------------------

4.29: Patch - automated file updates


AIX 3.2.5 does not ship with patch, a utility to apply the differences
between two files to make them identical.  This tool is often used to
update source code.

<ftp://ftp.x.org/pub/R6untarred/xc/util/patch/>
<ftp://prep.ai.mit.edu/pub/gnu/patch-2.1.tar.gz>

------------------------------

4.30: XNTP - network time protocol, synchronizes clocks

From: Joerg Schumacher <schuma@ips.cs.tu-bs.de>

   AIX 4:   xntpd in bos.net.tcp.client
   source:  ftp://ftp.udel.edu/pub/ntp/
   WWW:     http://www.eecis.udel.edu/~ntp/


------------------------------

4.31: GNU Screen and AIX 4.1.x


Once again,  binaries can be had from <http://www-frec.bull.com/>.

------------------------------

4.32: SCSI scanner software


There is the SANE project that strives to deliver an open source scanner
solution for Unix:

<http://www.mostang.com/sane/>

------------------------------

4.33: Pager/Paging software


There is information on Paging, Paging programs and  listing of the
Archive sites to download at the web site:
<ftp://ftp.airnote.net:/pub/paging-info/ixo.faq>.

HylaFAX (see 4.22) supports sending messages to alphanumeric pagers.

Commercially there is: AlphaPage(r) MD2001 from Information Radio
Technology, Inc. in Cleveland, OH. 

------------------------------

4.34: JAVA Development Kit

From: Curt Finch <curt@tkg.com>

<http://ncc.hursley.ibm.com/javainfo/>

------------------------------

4.35: Sendmail


<ftp://ftp.sendmail.org/sendmail/>

If you want to use SRC to start and stop BSD sendmail,  do the following 
after installing it:

chssys -s sendmail -S -n 15 -f 9 -a -d99.100

This tells SRC that sendmail may be stopped with signals 15 and 9.  It also
arranges for sendmail not to daemonize itself,  since it will run under SRC.

------------------------------

4.2 already has a similar feature.


------------------------------

1.149 How to install LPPs on a shared disk?
From: Ciaran Deignan <C.Deignan@frec.bull.fr>

I have an LPP that I want to install on all my AIX machines (for
example the "perl" freeware), but I want to minimize the disk-space
used on the network of machines. Can I selectively mount part of /usr
on another machine?

In general it is not possible to share an LPP with several machines.
Sometimes it is possible to use a dedicated filesystem to install
freeware which can then be shared.

However for anything packaged as an LPP it is possible to use
a script that replaces /usr/sbin/inurest, and that redirects files
delivered by the LPP to the shared disk.

One script that does this is called Ninstallp, and it is available
(with instructions) from
http://www.geocities.com/ResearchTriangle/5428/ninstallp.html

------------------------------

1.150 How can I reduce the size of /var/adm/wtmp ?

The file /var/adm/wtmp grows with each login, but is never reduced.
The contents of wtmp is used (only?) by the command "last",
which shows, in reverse order, all the logins and reboots that
happened since the start of the wtmp file.

The file should not be deleted, but the contents can be discarded using
the following command:
# > /var/adm/wtmp

Alternatively the freeware utility "tidysys" can remove all the entries
from wtmp that are older than (say) 15 days. Tidysys was written by
Terry Murray <terry@weavel.demon.co.uk> for AIX 3.2 and is available
from ftp://ftp.frontiernet.net/pub/aix/tsys220.tar.

Tidysys was ported to AIX 4.1 by C. Deignan and is available from
<http://www-frec.bull.com/>.

------------------------------

1.151: How do I start local daemons at system startup?

AIX does neither use the BSD style rc.local file nor the System V style
/etc/rc*.d startup files directories. To add local daemons to the system
startup sequence in a BSD rc.local style use the following command to
create an /etc/inittab entry:

# mkitab -i rcnfs "rclocal:2:wait:/etc/rc.local >/dev/console 2>&1"
# touch /etc/rc.local
# chmod 700 /etc/rc.local

Then put the command lines to start the daemons in /etc/rc.local.

------------------------------

1.152  How do I set the TZ variable to automatically change to
		daylight savings time?

The TZ variable can be set in /etc/environment file so the time
automatically switches to daylight savings time in spring and back to
normal in autumn. The actual rules when to switch vary by country, the
following should work in middle europe:

TZ=MET-1MET DST,M3.5.0/02:00:00,M10.5.0/03:00:00

The exact definition for the rules can be found with infoexplorer under
the environment page.

------------------------------

1.153  Why does init not reap its zombie child processes?

If you have lots of zombie (defunct) processes with parent process id 1,
the init process is probably waiting for some bad /etc/inittab
configuration line to finish. Check the inittab file for entries that
specify the wait keyword for processes that do not terminate. These
lines should probably specify "once" or "respawn" instead.

1.200: Some info about tape backups
From: Craig Anderson

The following supplements the information on rmt devices in
InfoExplorer. It is based on my own personal experience with IBM tape
drives running on AIX 3.1. No warranty is expressed or implied.

CONFIGURING THROUGH SMIT:
    BLOCK size (0=variable length)		(ALL)
	Sets the tape block size.  When reading, the block size must be
	set to the block size set when the tape was written.  When
	using some commands, tapes written with ANY block size can be
	read if the block size is set to 0 (variable length) (see
	"BLOCK SIZES" below).

    Use DEVICE BUFFERS during writes		(ALL)
	Set to yes, the device will buffer data internally on writes.
	This greatly improves performance, but under certain cases may
	be undesirable since the data is not written to tape before
	returning a good indication.

    Use EXTENDED file marks			(8mm only)
	Extended file marks take up much more space than short (or
	non-extended) file marks.  But extended file marks can be
	overwritten, allowing data not at the beginning of tape to be
	overwritten (see "FILE MARKS" below).

    RETENSION on tape change or reset		(1/4" only)
	If set to "no" then the tape will not be retentioned
	automatically when the tape is inserted.  Note that this will
	take effect only after the device is used.


FILE MARKS:
     Tape devices support multiple tape files.  Tape files are the
     result of a backup/cpio/tar/dd type command, where the device is
     opened, written to, and closed.  Because tapes allow large
     quantities of data to be written on a single tape, several backups
     (that is, tape files), may be combined on one physical tape.
     Between each tape file is a "tape file mark" or simply "file
     mark".  These file marks are used by the device driver to indicate
     where one tape file ends and another begins.

                              B       E
                   <-------   O       O   ------->
                              T       T
     physical | \            |       |      \             |physical
     beginning|  \           | tape  |       \            | end
       of     |   \          | file  |        \           |  of
      tape    |    \         | mark  |         \          | tape
              |_____\________|_______|__________\_________|
 
     Note that there is a distinction between the beginning of tape
     (BOT) side of a file mark and the end of tape (EOT) side of a file
     mark.  If the head is on the BOT side of a file- mark, "tctl fsf
     1" command will move only to the EOT side of the same file mark.

     With the 1/4" tape drive, writing can only take place
     sequentially, or after blank tape has been detected.  You cannot
     write over data on the tape (except at BOT).  If you wish to add
     data to a tape which has been written and then rewound you should
     space forward file mark until an error occurs.  Only then can
     you start writing again.

     With an 8mm tape drive, writing can only take place before blank
     tape, an EXTENDED file mark, or at BOT.  Thus if several backups
     have been made on one tape and you wish to overwrite one of the
     backups, position the tape to the place you wish to start writing
     and issue the following commands:
	tctl bsf 1
	tctl eof 1
     The first command skips back to the BOT side of the same file
     mark.  The second command rewrites the file mark (writing is
     allowed before extended file marks).  The erase head will erase
     data ahead of the write head, so that after writing the file mark
     the head will be positioned before blank tape.  Only after this
     may you start writing over data in the middle of the tape.  (All
     data beyond where you are currently writing will be lost).  Note
     that you cannot write over short file marks.  In order for this to
     work, the tape must have been written with extended file marks
     (use smit to change this).

     With the 9-track drive writing can take place anywhere on the
     tape although overwriting single blocks of data is not supported.

     On the 8mm drive extended filemarks use 2.2 megabytes of tape and
     can take up to 8.5 seconds to write.  Short filemarks use 184K
     and take up to 1.5 seconds to write.

BLOCK SIZES:
     When data is written to tape it is written in blocks.  The blocks
     on a tape are separated by inter-record gaps.  It is important to
     understand the structure of the written tape in order to
     understand the problems which can occur with changing block
     sizes.

     In fixed block size mode all blocks on the tape are the same
     size.  They are the size of the block size set in the device
     configuration.  All read()s and write()s to the tape drive must be
     a multiple of the fixed block size.

     In fixed block mode a read() will return as many blocks as needed
     to satisfy the read() request.  If a file mark is encountered
     while reading the tape only the data up until the file mark will
     be returned.

     It is not possible for the tape drive to read a tape whose block
     size is not the same as the block size in the device
     configuration.  (Unless the device configuration is in variable
     size blocks.)

     In variable block size (0) mode, the blocks written on the tape
     are the size of the read() and write() requests to the device
     driver.  In this case, the actual block sizes on the tape can be
     changed using the options to the backup commands (tar -C, cpio -C,
     backup -C).

     In variable mode, read() requests greater than size of the block
     on the tape will return only the data from the next block on the
     tape.  It is this feature that allows tapes written in any block
     size (fixed or variable) to read with the dd command (the output
     from the dd command may be piped to restore, tar, or cpio for
     example.)  Note that backup, tar, and cpio cannot read all tapes
     by using a large block size because they assume there is an error
     if they get a short read().
		dd ibs=128k obs=16k if=/dev/rmt0 | ...

     The tape head is always positioned at an inter-record gap, file
     mark, or blank tape after reading or writing.

     With the 8mm tape drive, using a fixed block size which is not a
     multiple of 1K is inefficient.  The 8mm tape drive always writes
     internally in 1K blocks.  It simulates the effect of variable
     block sizes, but, for example, using a fixed block size of 512
     bytes (or using variable block size and write()ing 512 bytes at a
     time) wastes one half of the tape capacity and gives only one half
     the maximum transfer rate.

     To figure out a tape's actual block size try:

     1). Set the tape to variable block size.
     2). "dd if=<tape> of=/tmp/dummy bs=128k count=1"
     3). "ls -l /tmp/dummy"
     4). The number of bytes in "/tmp/dummy" is the physical block size.

EXCHANGING DATA WITH NON-UNIX AND OTHER VENDORS MACHINES:
     Many tape drives support both variable and fixed block sizes.

     Variable block mode writes block sizes the size of the write
     command issued (tar and backup specify this with the -b option). 
     In fixed mode, block sizes are fixed and all writes must be a
     multiple of the fixed block size.

     Unix often internally chops larger reads and writes up into
     manageable pieces (often 65535, 65534, or 65532 bytes) before
     doing the actual reads and writes.  This means reads and writes of
     64K bytes are often broken up into a 65535 byte record and a 1
     byte record (In fixed mode the write will fail).  Block sizes >=
     64K (-C128 and greater) should be avoided for this reason.  AIX
     does not break up read and write requests, but be aware of the
     situation on other machines.

     If the tape is written in an unknown block size then set the
     device configuration in smit to use variable size blocks, use the
     "dd" command with a large input block size, and pipe it to the
     restore command.  For example:
	  chdev -l rmt0 -a block_size=0
	  dd if=/dev/rmt0 ibs=128k obs=16k | tar -tvf-

------------------------------

1.201: How do I do remote backup?

There seems to be several ways of doing this.  The first approach is a
one-liner to allow tar to reference another machine's device.  The
second is more complete but uses a similar approach.  The latest
addition to this section claims to be able to support mksysb on a
remote machine.  Thanks to all the contibutors.

  tar -b1 -cf - . | rsh REMOTEHOST "dd ibs=512 obs=1024 of=/dev/TAPEDEVICE"

[Ed.: The usave.sh script has been moved to section 8.06.  I've verified
this script works fine. However, it may be slow for large filesystems
since it creates a temp file of filenames in /tmp.]

There are also several commercial solutions.  One is IBM's SYSBACK/6000
product.  See Question 1.209 for more information.

Open Microsystems sells a product called DistribuTAPE which supports
mksysb to a remote tape drive under AIX 3.2, 4.1 and 4.2.  DistribuTAPE
supports remote tape drives by placing a pseudo tape driver on the
client system, and a server daemon on the server.  More information at
http://www.openmic.com/

------------------------------

1.202: How do I backup a multi-disk volume group?
From: pack@acd.ucar.edu (Daniel Packman)

[ Ed.: I have not verified this procedure. I would actually recommend
  NOT to have one volume group span multiple disks unless you really
  need such big logical volumes. ]

  1. If you have a set of three or more disks in a volume group
     (typically 3 for 5xx machines with three internal drives;
     with only two, the procedures outlined here have to be modified
     to ignore the fact that you don't have a quorum in the volume group)

  2. If one drive has failed (usually only one fails at a time :-) )

It is possible to go through a service boot (the volume group is called
rootvg and one of the 2 good disks on it is called hdisk0):

  importvg -y rootvg hdisk0
  varyonvg -f -n -m1 rootvg

These commands will work, but give error messages. If you wish to mount
a user filesystem, say /u on logical volume /dev/lv00, then

  mount -f /dev/lv00 /v

will work only if jfslog, the journaled file system log device, is not
on the damaged disk. If it is, you must (and can in any case) mount the
filesystem read-only:

  mount -f -r /dev/lv00 /v

This crucial and rather obvious point baffled several level 3 support
personnel at Austin as well as myself for almost a week. Once the file
system(s) of interest are available, they can be saved to tape for
restoration later. Of course, one can expect only about two thirds of a
filesystem to be recoverable if it spans all 3 physical disks. One
other point to remember is that the standard boot procedure from floppy
includes the restore command but does not include the backup command.

*****************************************************************************
* If you do not have other RS6000 machines at your site it is imperative    * 
* that you either build a bootable tape which includes either restore or    * 
* tar or cpio (a bootable floppy set will not have enough space) or at the  *
* very least copy onto a spare floppy backup, cpio, or tar.  The floppy     *
* should be created with backup -ivq so that its contents can be read into  *
* the memory resident system after booting.                                 *
*****************************************************************************

All is not lost if tar, cpio or backup are available on an undamaged
disk that can be mounted. Since tar and cpio are in /bin, they may both
very well be unavailable.

It is a very good idea for those who have tape devices to build a
bootable tape with their desired extra commands in it. Follow the
instructions from IBM but add your desired commands to the following
three files:

    /usr/lpp/bosinst/tape2
    /usr/lpp/bosinst/diskette/boot2
    /usr/lpp/bosinst/diskette/inslist

If you have anything other than a minimum memory configuration, you
should be able to add many commands.

------------------------------

1.203: How do I put multiple backups on a single 8mm tape?
From: kerm@mcnc.org (Cary E. Burnette)

There are two possible solutions to this, both of which use /dev/rmt0.1
which is non-rewinding.

SOLUTION #1
-----------

To put multiple backups on a single tape, use /dev/rmt0.1, which is a
no-rewind device, using either rdump or backup (both by name & inode
work). Using rdump or backup "byinode" both generate the message that
the tape is rewinding but actually do not. This is an example that
works on my system:

# rsh remote1 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
# rsh remote2 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
# tctl -f /dev/rmt0.1 rewind       # rewinds the tape

where I am implementing the command from host.

# restore -f /dev/rmt0.1 -s1 -tv

where the -s1 flag tells restore to go to the first record on the tape. 
Type the exact command again to get the second record. The -s(Number)
means go to Number record from this spot. It works pretty well.


SOLUTION #2
-----------
Steve Knodle, Educational Resources Center, Clarkson University

I use:
------------------- Dump.sh --------------------
CONTENTSFILE=`date |dd conv=lcase |sed -e 's/19//' |awk '{print $6 $2 $3}'`
set -x
LEVEL=$1
shift

backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /
backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /usr
backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /u
tctl -f /dev/rmt0 rewind

touch /usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /usr" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /u" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
tctl -f /dev/rmt0 rewind

I process the table-of-contents first by a little program that does
common prefix encoding, and then compress.

is reused.


Solution #3
-----------
   mount | grep jfs | cut -c27- | cut -d" " -f1 | \
     xargs -i backup -${LEVEL} -u -f /dev/rmt1.1 {} > ${DATE}.backup 2>&1

------------------------------

1.204: How can I make an exact duplicate of a tape over the network?

The challenge here is not to have to create a temporary file (disk space
limitation) and work across heterogeneous networks.

This script might work:

LOCAL=/dev/tape_dev
REMOTE=/dev/tape_dev
dd if=$LOCAL ibs=64k obs=512 | rsh remote_host dd ibs=512 obs=64k of=$REMOTE


From: pack@acd.ucar.edu (Daniel Packman)

Daniel provides the following perl script to convert from the known
world's function codes to AIX for compatibility.

#!/bin/perl
# Wrapper to convert input rmt requests to
# AIX 3.2 ioctl numbers.  We pass on all commands we don't understand
# I0 MTWEOF -> I10  STWEOF write and end-of-file record
# I1 MTFSF  -> I11  STFSF  forward space file
# I2 MTBSF  -> I12  STRSF  reverse space file
# I3 MTFSR  -> I13  STFSR  forward space record
# I4 MTBSR  -> I14  STRSR  reverse space record
# I5 MTREW  -> I6   STREW  rewind
# I6 MTOFFL -> I5   STOFFL rewind and unload tape
# I7 MTNOP  -> I0   (no-op? should ignore following count)
# I8 MTRETEN-> I8   STRETEN retension tape, leave at load point
# I9 MTERASE-> I7   STERASE erase tape, leave at load point
#I10 MTEOM (position to end of media ... no ibm equivalent?)
#I11 MTNBSF  (backward space file to BOF ... no ibm equivalent?)
@iocs = (10,11,12,13,14,6,5,0,8,7);
open(RMT,"|/usr/sbin/rmt") || die "Can't open pipe to rmt\n";
select(RMT);
$| = 1;
while (<STDIN>) {
  s/(^I)(\d$)/I$iocs[$2]/;
  exit 0 if $_ =~ /^[Qq]/;
  print RMT $_ ; }
exit 0;

------------------------------

1.205: What is tape block size of 0?
From: benson@odi.com (Benson I. Margulies)

Tape devices are generally split into two categories: fixed block and
variable block.  1/4" tape is the fixed block, and 8mm is variable.

On a fixed block size device, the kernel always sends data to the device
in suitable block size lumps, and varying the size passed to write(2)
(e.g., via the bs option to dd) gives the kernel more data to stream. 
On a variable block size device, the kernel writes to the device
whatever passed to it. On an 8mm, it had better be a multiple of 1024
to get efficient tape usage.

AIX has the World's Only Variable Block Size 1/4" tape drive. If you
use SMIT to set the block size to a nonzero value, AIX treats the device
as fixed block size, whether it is or not. By default, 8mm drives are
set to the same size as 1/4", 512 bytes. This is wasteful, but
otherwise mksysb and installp would fail.

If you set the block size to 0, the device is treated as variable block
size, and the size passed to write becomes the physical block size. 
Then if you use a sensible block size to dd, all should be wonderful.

------------------------------

1.206: Resetting a hung tape drive
From: Craig_Anderson@kcbbs.gen.nz (Craig Anderson)

A process accesses the tape drive. The process stops, exits, or whatever,
but still hold on to the drive. When this happens, the process cannot be
killed by any signal and the tape drive cannot be used by any other
process until the machine is rebooted.

The following should help:

RESET:

AIX, like most UNIX systems has no reset function for tape drives. You
can however send a Bus Device Reset (a standard SCSI message) to the
tape drive using the following piece of code. If the tape drive does
not respond to the BDR, then a SCSI Bus Reset will be sent (and this
will reset every device on the SCSI Bus). SCSI Bus resets are rather
extreme so you should refrain from using this program unnecessarily. 
But there are times (like after you've inserted a jammed/old/bad tape in
an 8mm drive), when there's no other way to reset the device other than
to shutdown and reboot (obviously you can power down and up an external
drive to reset it - and this would be the better choice).

This is actually documented in info, but can be hard to find and
there's no complete program.

/* taperst: resets the tape drive by sending a BDR to the drive. */
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/scsi.h>

int main(int argc, char **argv)
{
         /* This can be run only by root */

         if (argc != 2) {
             fprintf(stderr, "Usage: %s /dev/rmt#\n", argv[0]);
             return 1;
         }

         if (openx(argv[1], O_RDONLY, 0, SC_FORCED_OPEN) < 0) {
             perror(argv[0]);
             return 2;
         }
         return 0;
}

------------------------------

1.207: How do I restore specific files from a mksysb tape?
From: Marc Pawliger (marc@sti.com)

To recover specific files from a backup made with mksysb, try
$ tctl fsf 3
$ tar xvf /dev/rmt0.1 ./your/file/name

From: Matt Willman (Willman.matt@cnf.com)

The procedure changed with AIX 4, which uses backup instead of tar to
write the tape. For AIX 4 the procedure is as follows:

$ tctl fsf 3
$ restore -xvf /dev/rmt0.1 ./your/file/name

------------------------------

1.208: How do I read a 5Gbyte tape on a 2Gbyte drive?
Posted by: bobmet@clam.com (Robert Metcalf)

To read a 5Gbyte tape on a 2Gbyte drive, the
tape needs to have been created with a density setting of 20.

The following is from IBM's electronic ASKSUPPORT repository:
  
   R: The 7208 011 5 GB tape drive has various density settings which are
      as follows:
  
     +-------+--------------------------+
     | DENSIT| DESCRIPTION              |
     | SETTIN|                          |
     +-------+--------------------------+
     | 140   | Writes in 5.0GB mode and |
     |       | will enable data com-    |
     |       | pression; also, to do    |
     |       | compression you must use |
     |       | "DATA COMPRESSION = yes" |
     +-------+--------------------------+
     | 21    | Writes in 5.0GB mode and |
     |       | will NOT do data com-    |
     |       | pression                 |
     +-------+--------------------------+
     | 20    | Writes in 2.3GB mode and |
     |       | will NOT do data com-    |
     |       | pression                 |
     +-------+--------------------------+
     | 00    | Factory power-on default |
     |       | for 5.0GB data com-      |
     |       | pression mode            |
     +-------+--------------------------+
  
     The density setting of the 7208 011 must be 20 for it to make a tape
     that is readable by the 7208 001.


------------------------------

1.209: What can Sysback do for me?
From: johnsont@austin.ibm.com (Tony Johnson)

Sysback provides the flexibility of restoring onto the same system in
the exact same manner, or onto a completely different system with
differnet disk configuration, platform type, kernel, etc, while
reporting any inconsistencies and allowing you to adjust to fit. For
instance, you will get warnings if a particular volume group cannot be
created because the original disks to not exist, or that mirroring
cannot be accomplished because there is no longer enough disk space
because the disks are smaller. You can then select the disks for each
volume group, reduce or add space to filesystems and LVs, exclude
entire VGs or filesystems, etc.  You can even add and delete mirrors,
stripe or un-stripe logical volumes, etc.

In addition, all of the Sysback functions can be performed across the
network, including network boot and network install, and you can
perform striped backups across multipel tape drives, use sequential
tape autoloaders, and perform unattended multi-volume backups with
cron.

ON AIX 3.2, mksysb does not retain paging space config, disk LV
placement, mirroring, etc.

On AIX 4.1, it does these on an EXACT same configuration, but does not
allow any flexibility, and still does not retain non-rootvg volume
groups (although you can now use additional commands to backupa nd
restore these).  mksysb also does not allow you to clone onto
different platforms (i.e.  rspc -> rs6k -> rs6ksmp).


------------------------------

1.210: How can I get my HP 4mm DAT to work?

For HP25470/80A DDS:
   MRS disabled: Set switches 3,6,7,8=0 and 1,2,4,5=1
   MRS enabled:  Set switches 3,6,7=0 and 1,2,4,5,8=1

------------------------------

1.211: How do I copy DAT tapes?

If you have two drives try tcopy(1).  Otherwise the traditional UNIX
approach is ( dd if=/dev/rmt0 bs=1024b | dd of=/dev/rmt1 bs=1024b )
Put that in a while loop using a non-rewinding device to do multiple
files.  To use drives from two different machines either get the GNU
dd (bundled with GNU tar) or use something like.

  $ dd if=/dev/rmt0 bs=1024b | rsh hostname dd of=/dev/rmt0 bs=1024b


------------------------------

1.212: How do I speed up backups to DLT tapes?

DLT tapes need high data rates to stay in streaming mode. To achieve
higher data rates, use a variable length block size by setting the fixed
length block size to zero. Also use a buffer size of about 64KB for
backup (128 blocks for tar).

------------------------------

1.300: Some info about the memory management system
From: Michael Coggins (MCOG@CHVM1.VNET.IBM.COM).

1. Does AIX use more paging space than other unix systems?

Under many scenarios, AIX requires more paging space than other unix
systems. The AIX VMM implements a technique called "early allocation of
paging space". When a page is allocated in RAM, and it is not a
"client" (NFS) or a "persistent" (disk file) storage page, then it is
considered a "working" storage page. Working storage pages are commonly
an application's stack, data, and any shared memory segments. So, when
a program's stack or data area is increased, and RAM is accessed, the
VMM will allocate space in RAM and space on the paging device. This
means that even before RAM is exhausted, paging space is used. This
does not happen on many other unix systems, although they do keep track
of total VM used.

Example 1: 
Workstation with 64mb RAM is running only one small application that
accesses a few small files. Everything fits into RAM, including all
accessed data. On AIX, some paging space will already be used. On
other unix systems, paging space will be 100% free. Clearly, this is an
example that shows where we use more paging space than the other machines.

Example 2:

Same machine as above, except we are in an environment where many
applications are running with inadequate RAM. Also, the system is
running applications that are started, run, left idle, and not in
constant use. A session of FRAME running in a window, for example. 
What happens is that eventually (theoretically) all applications will be
paged out at least once. On the AIX system and the other systems the
total paging requirements will be the same (assuming similar malloc
algorithm). The major difference is that the AIX system allocated the
paging space pages before they were actually needed, and the other
systems did not allocate them until they were needed. However, most
other systems have an internal variable that gets incremented as virtual
memory pages are used. AIX does not do this. This can cause the AIX
system to run out of paging space (virtual memory), even though malloc()
continues to return memory. This "feature" allows sparse memory
segments to work, but requires that all normal users of malloc()
(sbrk()) know how much virtual memory will be available (actually
impossible), and to handle a paging space low condition. A big problem. 
There are some pretty obvious pros and cons to both methods of doing
Virtual Memory.

2. How much paging space do I need?

Concerning the rule of thumb of having 2 times RAM for paging space:
this is rather simplistic, as are most rules of thumb.  If the machine
is in a "persistent storage environment", meaning that they have a few
small programs, and lots of data, they may not need even as much as 1
times RAM for paging space.  For example, a 1GB database server running
on a 6000 with 256MB of RAM, and only running about 50MB of "working"
storage does not need 512MB of paging space, or even 256MB.  They only
need the amount of paging space that will allow all their working
storage to be paged out to disk.  This is because the 1GB database is
mostly "persistent storage", and will require little or no paging space. 
Excessive paging space may simply mean wasted disk space.  However,
avoid insufficient paging space.  Tip: Don't have more than one paging
space per disk.  Tip: Put lots of RAM in your system - it will use it.

3. Why does vmstat show no free RAM pages?

AIX uses RAM as a possibly huge disk buffer.  If you read a file in the
morning, that file is read into RAM, and left there.  If no other
programs need that RAM, that file will be left in RAM until the machine
is halted.  This means that if you need the file again, access will be
quick.  If you need that RAM, the system will simply use the pages the
file were using. The pages were flushed back to disk earlier.  This
means that you can get a huge speedup in disk access if you have enough
RAM.  For example, a 200MB database will just ease into RAM if you have
a 256MB system.

4. Since vmstat shows no free RAM pages, am I out of RAM?

Probably not. Since disk files will be "mapped" into RAM, if vmstat
shows lots of RAM pages FREE, then you probably have too much RAM (not
usual on a RISC System/6000)!

5. Shouldn't the "avm" and the "fre" fields from vmstat add up to something?

No. The "avm" field tells you how much "Active Virtual Memory" AIX
thinks you are using. This will closely match the amount of paging
space you are using. This number has *ABSOLUTELY* nothing to do with
the amount of RAM you are using, and does *NOT* include your mapped
files (disk files).  The amount of RAM can be determined with
/usr/sbin/bootinfo -r

6. Why does the "fre" field from vmstat sometimes show lots of free
   RAM pages?

This will happen after an application that used a lot of RAM via
"working" storage (not NFS storage, and not disk file or "persistent"
storage) exits. When RAM pages that were used by working storage (a
program's stack and data area) are no longer needed, there is no need to
leave them around. AIX completely frees these RAM pages. The time to
access these pages versus a RAM page holding a "sync'd" mapped file is
almost identical. Therefore, there is no need to periodically "flush" RAM.

7. Is the vmstat "fre" field useful?

The vmstat "fre" field represents the number of free page frames.  If
the number is consistently small (less than 500 pages), this is normal. 
If the number is consistently large (greater than 4000 pages), then you
have more memory than you need in this machine.

------------------------------

1.301: How much should I trust the ps memory reports?
From: chukran@austin.VNET.IBM.COM

Using "ps vg" gives a per process tally of memory usage for each running
process.  Several fields give memory usage in different units, but these
numbers do not tell the whole story on where all the memory goes.

First of all, the man page for ps does not give an accurate description
of the memory related fields.  Here is a better description:

RSS - This tells how much RAM resident memory is currently being used
for the text and data segments for a particular process in units of
kilobytes.  (this value will always be a multiple of 4 since memory is
allocated in 4 KB pages).

%MEM - This is the fraction of RSS divided by the total size of RAM for
a particular process.  Since RSS is some subset of the total resident
memory usage for a process, the %MEM value will also be lower than actual.

TRS - This tells how much RAM resident memory is currently being used
for the text segment for a particular process in units of kilobytes. 
This will always be less than or equal to RSS.

SIZE - This tells how much paging space is allocated for this process
for the text and data segments in units of kilobytes.  If the executable
file is on a local filesystem, the page space usage for text is zero. 
If the executable is on an NFS filesystem, the page space usage will be
nonzero.  This number may be greater than RSS, or it may not, depending
on how much of the process is paged in.  The reason RSS can be larger is
that RSS counts text whereas SIZE does not.

TSIZ - This field is absolutely bogus because it is not a multiple of 4
and does not correlate to any of the other fields.

These fields only report on a process text and data segments.  Segment
size which cannot be interrogated at this time are:

       Text portion of shared libraries (segment 13)

       Files that are in use. Open files are cached in memory as
       individual segments.  The traditional kernel cache buffer
       scheme is not used in AIX 3.

       Shared data segments created with shmat.

       Kernel segments such as kernel segment 0, kernel extension
       segments, and virtual memory management segments.

Speaking of kernel segments, the %MEM and RSS report for process zero
are totally bogus for AIX 3.1.  The reason why RSS is so big is that the
kernel segment zero is counted twice.  For AIX 3.2, this has been
changed, but the whole story is still not known.  The RSS value for
process 0 will report a very small number of the swapper private data
segment.  It does not report the size of the kernel segment 0, where the
swapper code lives.

In summary, ps is not a very good tool to measure system memory usage. 
It can give you some idea where some of the memory goes, but it leaves
too many questions unanswered about the total usage.

------------------------------

1.302: Which simms do RS6000's use?

This answer is under construction... I'm trying to collect details
about compatable simms.

RS/6000 220,230 USE 2 pair 70ns PS/2 style simms
RS/6000 250,C10 USE 4 pair 70ns PS/2 style simms

------------------------------

1.303: What is kproc?

kproc (always PID 514 on AIX 3 and PID 516 on AIX 4) is the kernel's
idle process.

------------------------------

1.304: How do I create a RAM disk in AIX?
From: Jeff Wang <hjiwa@nor.chevron.com>

You can't create a RAM disk in AIX.  The closest related functionality
the operating system gives you is the RAM disk buffer. Read 1.300
sub-section 3.

------------------------------

1.305: How much RAM (real memory) does my machine have?
From: Michael Abel/resnova
	<Michael_Abel/resnova%RESNOVAD@notesgw.compuserve.com>

As     root:  bootinfo -r
As any user:  lsattr -E -l sys0 -a realmem

lsdev -C -c memory

shows all memory adapters.  On MCA systems one may add up the values
displayed for each memory card in order to sum up to the amount of
total memory.  On PCI systems only one item (mem0) is
displayed. Additional information may be displayed with

lsattr -E -lmem0

These commands were tested on various IBM systems running AIX relases
3.2.5 and 4.1.4

------------------------------

1.306: Why do PIDs run non-sequentially?
From: Julianne F. Haugh <jfh@austin.ibm.com>

The answer (I was there, consider me an authority ...) is that the
PIDs needed to be somewhat unpredictable.  This is because AIX was
originally designed with a number of C2 and B1 features, and one of those
is the notion of covert channel analysis.  Sequential PIDs are a covert
channel (assuming the system has one PID namespace ...) since the value
of the "next" PID is shared by all currently running processes.  So if I
want to sneak some of my classified data out to your co-operating
non-classified program, I can do it by carefully controlling the value
of the "next" PID.

------------------------------

1.400: How do I make an informative prompt in the shell?

In the Korn Shell (ksh), the PS1 variable is expanded each time it is
printed, so you can use:

$ export myhost=`hostname`
$ PS1='$LOGNAME@$myhost $PWD \$ '

to get, e.g. 

bengsig@ieibm1 /u/bengsig $

In the C-shell, use:

% set myhost=`hostname`
% alias cd 'chdir \!* > /dev/null; set prompt="$LOGNAME@$myhost $cwd % "'
% cd

to get, e.g.

bengsig@dkunix9 /u/bengsig/aixfaq %

There is no easy solution in the Bourne Shell.  Use the Korn Shell instead.

------------------------------

1.401: How do I set up ksh for emacs mode command line editing?

The ksh has an undocumented way of binding the arrowkeys to the emacs
line editing commands. In your .kshrc, add:

alias __A=`echo "\020"`   # up arrow = ^p = back a command
alias __B=`echo "\016"`   # down arrow = ^n = down a command
alias __C=`echo "\006"`   # right arrow = ^f = forward a character
alias __D=`echo "\002"`   # left arrow = ^b = back a character
alias __H=`echo "\001"`   # home = ^a = start of line

Type "set -o emacs" or put this line in your .profile.

Also, you MUST have PTF U406855 for this to work in AIX 3.2.  The APAR #
for the problem is IX25982, which may have been superseded.

------------------------------

1.402: Listing files with ls causes a core dump
From: Julianne F. Haugh <jfh@austin.ibm.com>

Scenario: a directory that is shared by N users (N >= 200).
Run 'ls -l' in that directory.  It goes for a while, then
Seg fault(coredump)!

It only occurs when the usernames are displayed (almost every file is
owned by a different person).  The -g and -n options work fine; only -l
and -o (which shows owner and not group) cause it. 

I believe that this problem was corrected by U407548.  If you have that
many users that you are having core dump problems (it took over 200),
you might also want to look into getting the PTF that fixes IX31403. 
That APAR deals with large numbers of accounts and performance problems
associated with looking them up.

------------------------------

1.403: How do I put my own text into InfoExplorer?

With AIX 3.1, you cannot do it.  AIX 3.2 has a product called
InfoCrafter that allows you to do that.

------------------------------

1.404: InfoExplorer ASCII key bindings 
From: mycroft@hal.gnu.ai.mit.edu (Charles Hannum)

If you just press 'Return' when it starts up, with 'Basic Screen
Operations' highlighted, you'll get some help.

If you look long enough, you'll find a page named 'Using Keys and Key
Sequences in the InfoExplorer ASCII Interface'.  It describes the key
sequences and actions.  Here are a few to get you started.

Keys       Action

Ctrl-W     Moves between the Navigation screen and the Reading screen.
If the Navigation screen is displayed, you can press Ctrl-W to display
the Reading screen.  If the Reading screen is displayed, you can press
Ctrl-W to display the Navigation screen.

Ctrl-O     Makes the menu bar active or inactive.  If your text cursor is
located in the text area of the screen, you can press Ctrl-O to make the
menu bar active.  If the menu bar is already active, you can press
Ctrl-O to make it inactive, which moves the text cursor to the text area.

Tab     Moves to the next menu bar option in the menu bar.  If a pull-down
menu is not displayed and you press the Right Arrow key, the next menu
bar option is displayed in reverse video.
 
------------------------------

1.405: How can I add new man pages to the system?
From: horst@faui63.informatik.uni-erlangen.de (Horst Luehrsen)

Put the man pages in /usr/man, e.g. /usr/man/man1/tcsh.1 for the tcsh
man page.  Under AIX 3.1.10, /usr/lib/makewhatis can be used to update
the makewhatis-database /usr/man/whatis so apropos and whatis know about
the added manpages.  /usr/lib/makewhatis should be available on all 3.2
versions.

For AIX 4.x, you can store the man pages in the /usr/share/man hierarchy.
/usr/lib/makewhatis is still there.

------------------------------

1.406: Why can't I read man pages?  Where is nroff?

Nroff and troff aren't in the base installation.  It is shipped as
part of AIX 3.2.5 but may not be installed.  Use smit to install a
software package called txtfmt.tfs.obj from your 3.2.5 distribution
media.

In AIX 4.x, you need bos.txt.tfs.

------------------------------

1.407: Why is my environment only loaded once?

The .profile file is only loaded once (for your login shell) subsequent
shells should be initialized by setting ENV=$HOME/.kshrc (for ksh).

Bash users can use $HOME/.bash_profile for the login shell environment
and $HOME/.bashrc.

------------------------------

1.408: Where is the 'nawk' command on my AIX system?
From: Jeff Wang <hjiwa@nor.chevron.com>

The /bin/nawk that exists on many UNIX flavors is a superset of the
'awk' command, revised by the same original authors to include added
functionality.  All the extra options normally associated with 'nawk'
on other UNIXes have been incorporated into the AIX version of 'awk';
the AIX 'awk' InfoExplorer or man pages include nawk-specific features
such as the "-v" command line option and atan2(), rand(), srand(),
match(), sub(), gsub(), system(), close(), getline functions.

If your AIX version is missing /bin/nawk (as are most AIX 3.x
versions), the simplest way to get around this and maintain script
portability between UNIX platforms is to make a /bin/nawk link to
/bin/awk (as root, of course).  If you do not have root privilege or
do not want to create a /bin/nawk link, to make the script work on
different UNIXes, you may have to test `uname` first and set all
'nawk' references on AIX runs to /bin/awk.  If your script is to only
run on AIX systems, you can just change all references of 'nawk' to
'awk' and everything should still work okay...but check the AIX awk
script on test data prior to making actual runs.

[Editor's note: AIX 4.x already contains a link from /usr/bin/nawk
to /usr/bin/awk.]

------------------------------

1.409: How do I copy InfoExplorer (manpages and more) to my hard drive?
From: David Alexander <unilink@online.rednet.co.uk>

[Editor's note: While this is documented in one of the AIX manuals
and covered in /usr/lpp/bos/bsdadm (AIX 3 only), it comes up often
enough I thought I would include it here.]

Not all the Info databases are required, so do not copy them all unless the 
customer specifically requests them, or has asked for the software they 
refer to.  These instructions assume you have enough space on /usr.

	Install and mount the InfoExplorer CD-ROM as for use of Info 
	from CD-ROM.

	Log in as Root
	umount /usr/lpp/info/lib/$LANG
	mkdir /mnt/$LANG
	mount -v cdrfs -r /dev/cd0 /mnt/$LANG

	cd /
	cd /mnt/$LANG
	cp -r aix /usr/lpp/info/lib/$LANG
	cp -r aix2 /usr/lpp/info/lib/$LANG
	cp -r compnav /usr/lpp/info/lib/$LANG
	cp -r hardware /usr/lpp/info/lib/$LANG
	cp -r nav /usr/lpp/info/lib/$LANG
	cp -r prog /usr/lpp/info/lib/$LANG
	cp -r uiprog /usr/lpp/info/lib/$LANG

	Other sections can be copied if required:
	Section						Size
	cp -r ada /usr/lpp/info/lib/$LANG		7.2  Mb
	cp -r assemb /usr/lpp/info/lib/$LANG		5.23 Mb
	cp -r cxx /usr/lpp/info/lib/$LANG		6.52 Mb
	cp -r dce /usr/lpp/info/lib/$LANG		3.8  Mb
	cp -r encina /usr/lpp/info/lib/$LANG		2.67 Mb
	cp -r fortran /usr/lpp/info/lib/$LANG		6.85 Mb
	cp -r graph /usr/lpp/info/lib/$LANG		9.75 Mb
	cp -r graph2 /usr/lpp/info/lib/$LANG		4.1  Mb
	cp -r pascal /usr/lpp/info/lib/$LANG		3.23 Mb

	umount /mnt/$LANG
	eject the CD-ROM

------------------------------

1.410: Why can't I set my default shell to one we've just installed?

When adding new shells to the system, add them to the "shells=" line
in /etc/security/login.cfg so they can be used during ftp and rlogin
by users who use them as their default shell.

------------------------------
 
1.411: Why do I get the "Unable to connect socket: 3"
                starting Info-Explorer?

It's a bug in the way infod sets the initial permission on the            
/tmp/.info-help socket. Do a chmod 777 on /tmp/.info-help and the
message will go away. (Charlie McGuire, mcguire@cs.umt.edu)

This problem was fixed by APAR IX43230, PTF U432315
(Paul Sitz, psitz@empros.com)

------------------------------

1.412: Why can't I write a setuid shell script?
From: mww@microfocus.com (Michael Wojcik)

AIX, as of about the first release of 3.2.5* does not allow SUID scripts.
(It ignores the SUID and SGID bits on scripts.)  They're a huge security
hole.

If you really want to run a script SUID, you can create a small C program
that does a setuid(0) and then system()'s your script.  (Actually, the
setuid() call isn't necessary on all Unixes; IIRC, it's not on AIX 3.2.5,
but YYMV.)  Make the program SUID.  Be very careful.

There are other similar solutions.  You might also want to look into
sudo, which handles this sort of thing in a somewhat more controlled
manner

* Julianne Frances Haugh (jfh@tab.com) writes:

I raised an objection to set-ID shell scripts before AIX 3.1 was
golden.  ... it was finally done in the 3009 PTF for AIX 3.1.

------------------------------

1.500  Which release of X11 do I have?

AIX 4.x includes X11 R5 and Motif 1.2.

On AIX 3, Run 'lslpp -h X11rte.obj'.
If your output has a line similar to:

            01.02.0000.0000 COMPLETE   COMMIT     03/04/93   02:05:11 root

you have X11 R4. If your output has a line similar to:

    U491068 01.02.0003.0000 COMPLETE   COMMIT     07/28/93   12:50:42 root

you have X11 R5. Some people also call these AIXwindows 1.2.0 and
1.2.3.  'lslpp -h X11rte.motif1.2.obj' should tell you if you are
running Motif 1.2.

From: Jan Just Keijser <KeijserJJ@logica.com> 

AIX 4.1 and AIX 4.2 come with X11R5 and Motif 1.2.4

AIX 4.3.1 (and perhaps 4.3.0) comes with X11R6.1 and Motif 2.1

Some executables which run fine using the X11R5 libraries may not run
when using the X11R6.1 libraries; you can specify which X11 libraries to
use by setting
  LIBPATH=/usr/lpp/X11/lib/R5:/usr/lib:...
for X11R5 and
  LIBPATH=/usr/lpp/X11/lib/R6:/usr/lib:...
for X11R6.1; by default,
    /usr/lib/libX11.a -> /usr/lpp/X11/lib/R6/libX11.a
and also for the other libraries on AIX 4.3.1.

On most of the AIX 4.1.x and 4.2.1 boxes I have seen the default is
  /usr/lib/libX11.a -> /usr/lpp/X11/lib/R4/libX11.a
ie the default libraries are the X11R4 libraries and _NOT_ the R5
libraries; this may also be due to the setup at my site.

------------------------------

1.501: How to prevent ctrl-alt-backspace from killing the X session

Start X with 'xinit -T' to disable ctrl-alt-backspace from stopping X.

------------------------------

1.502: Who has a termcap/terminfo source for the HFT console?

The console used on the RISC System/6000, PS/2 and RT can be used as a
terminal on another system with the termcap below.  You can find this
and other termcaps in /lib/libtermcap/termcap.src, including IBM
specific ones.  The terminfo sources are stored in /usr/lib/terminfo/*.ti.
This termcap can also be used from an aixterm window.

hf|hft|hft-c|ibm8512|ibm8513|IBM_High_Function_Terminal:\
	:co#80:li#25:am:ht:\
	:cm=\E[%i%d;%dH:ti=\E[25;1H:te=\E[20h:\
	:nd=\E[C:up=\E[A:do=^J:ho=\E[H:\
	:bs:sf=\E[S:ec=\E[%dX:\
	:cl=\E[H\E[J:cd=\E[J:ce=\E[K:\
	:AL=\E[%dL:DL=\E[%dM:al=\E[L:dl=\E[M:\
	:im=\E[4h:ei=\E[4l:mi:\
	:dm=\E[4h:ed=\E[4l:\
	:so=\E[7m:se=\E[m:ul=\E[4m:ue=\E[m:\
	:md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:\
	:as=^N:ae=^O:sc=\E[s:rc=\E[u:\
	:kl=\E[D:kb=^H:kr=\E[C:ku=\E[A:kd=\E[B:kh=\E[H:\
	:kn#10:k1=\E[001q:k2=\E[002q:k3=\E[003q:k4=\E[004q:k5=\E[005q:\
	:k6=\E[006q:k7=\E[007q:k8=\E[008q:k9=\E[009q:k0=\E[010q:\
	:is=\Eb\E[m^O\E[?7h:rs=\Eb\E[m^O\E[?7h\E[H\E[J:

------------------------------

1.503: How can I look at PostScript files?  Why is "dpsexec" so lousy?
From: Marc Pawliger <marc@sti.com>

showps comes with the 1.2.3 (X11R5) version of the X11rte.ext.obj LPP.
Very nice PS file previewer from Adobe.  Replaces xpsview which came
with pre-1.2.3 Installed as /usr/lpp/DPS/showps/showps

From: VRBASS@ATLVMIC1 (Vance R. Bass)

You can look at PostScript files using either "xpreview" (in the
optionally installable text formatting services) or you can get
Ghostscript and Ghostview from a comp.sources.x server and build it
yourself.

>From the "xpreview" man page:
The xpreview command is an AIXwindows 1.2- and Motif 1.1-based
application that displays output from the troff command on an AIXwindows
display.  The troff command output file must be prepared for any one of
the devX100, devX100K or devpsc devices.  The xpreview command also
displays PostScript language files that begin with %!.

"dpsexec" is NOT intended to be a full-service document browser, but
rather a simple DPS code debugger.  If you insist on using it, you can
edit your PS code to remove the "showpage" (which will reset dpsexec
and clear the window) to view single-page files.  It does not handle
multi-page files gracefully.

------------------------------

1.504: unix:0 vs `hostname`:0

1.) Is there any way to get the machine to check its local host table
    first without renaming resolv.conf?

[AIX 3.2 only]
PTF U412845 implements an environment variable to set the resolver
time out in AIX 3.2.  This allows you to set RES_TIMEOUT to the number
of seconds before it times out, a failing a DNS query the machine will
consult /etc/hosts.  

2.) How do you tell X applications where you are if the console display 
    is unix:0?

From: David L. Crow <crow@waterloo.austin.ibm.com>

  I would suggest that if you have R5, use ":<display>.<screen>".  I do
  not believe that R4 clients will understand :0, so I would suggest
  unix:0 for them.

  Without specifying unix or the hostname, you will get the fastest
  transport mechanism.  While currently there are only two transport
  methods in the AIXwindows X server (Unix sockets and TCP sockets),
  many vendors are looking at using shared memory as a transport method. 
  If you use :0 (or :0.0 or :1, etc.), then you should get the best
  performance regardless of the available transport methods.

From: Marc Pawliger <marc@sti.com>

  Using "unix:0" or "hostname:0" when the X11 Shared Memory Transport
(SMT) is installed as part of the 1.2.3 X11rte.obj (X11R5) will incur
a penalty vs. using ":0" See /usr/lpp/X11/README.SMT

3.) Is there a significant performance penalty incurred by using
    `hostname`:0 as DISPLAY?

  Yes! Using unix:0, you are using Unix sockets.  These are much faster
  than their TCP socket counterparts.

------------------------------

1.505: VT100 key bindings for aixterm
From: haedener@iac.unibe.ch <Konrad Haedener>

Add this to your .Xdefaults file and start your VAX session with
'aixterm -v -name vt100 -e telnet MYVAXHOST'

-----
vt100.vt102: true
vt100.fullcursor: false
vt100.translations:    <Key>F1: string(0x1b) string("OP") \n\
                       <Key>F2: string(0x1b) string("OQ") \n\
                       <Key>F3: string(0x1b) string("OR") \n\
                       <Key>F4: string(0x1b) string("OS") \n\
                       <Key>KP_0: string(0x1b) string("Op") \n\
                       <Key>KP_1: string(0x1b) string("Oq") \n\
                       <Key>KP_2: string(0x1b) string("Or") \n\
                       <Key>KP_3: string(0x1b) string("Os") \n\
                       <Key>KP_4: string(0x1b) string("Ot") \n\
                       <Key>KP_5: string(0x1b) string("Ou") \n\
                       <Key>KP_6: string(0x1b) string("Ov") \n\
                       <Key>KP_7: string(0x1b) string("Ow") \n\
                       <Key>KP_8: string(0x1b) string("Ox") \n\
                       <Key>KP_9: string(0x1b) string("Oy") \n\
                       <Key>KP_Divide: string(0x1b) string("OQ") \n\
                       <Key>KP_Multiply: string(0x1b) string("OR") \n\
                       <Key>KP_Subtract: string(0x1b) string("OS") \n\
                       <Key>KP_Add: string(0x1b) string("Om") \n\
                       <Key>KP_Enter: string(0x1b) string("OM") \n\
                       <Key>KP_Decimal: string(0x1b) string("On") \n\
                       <Key>Next: string(0x1b) string("Ol") \n\
                       <Key>Left: string(0x1b) string("OD") \n\
                       <Key>Up: string(0x1b) string("OA") \n\
                       <Key>Right: string(0x1b) string("OC") \n\
                       <Key>BackSpace : string(0x7f) \n\
                       <Key>Down: string(0x1b) string("OB")

You should also add

XENVIRONMENT=$HOME/.Xdefaults
export XENVIRONMENT

to your .profile.

------------------------------

1.506: Is there a screen saver that does not use excessive CPU?
From: Don Buchholz <buchholz@ese.ogi.edu>

Try using xlock with these options:

	xlock -mode life -count 1500 -nice 20 -root


From: pranav@evolving.com (Pranav Vakil)

Use mlock -hide to hide the background. You can also modify the mlock
(/usr/local/tools/mlock) code to allow the standard X screen saver to
take effect. The timeout value is originally set to 0 which means the
screen saver is off. Modify this to be 120 (2 minutes) and set the
interval time to be 60 (1 minute). Using these intervals, I have found
that over a 24 hour period, it uses only .3 cpu minutes.

------------------------------

1.507: Where are the colors, available for an X session, listed.

/usr/lpp/x_st_mgr/bin/rgb.txt and on AIX 4.2, the file is
/usr/lpp/X11/lib/X11/rgb.txt

------------------------------

1.508: Why does my app hang the X server but not an X station?
From: Bjorn P. Brox <brox@corena.no>

/usr/lpp/X11/README.SMT X client/server communication uses a 64k
buffer by default.  The size of this buffer is controled by the
X_SHM_SIZE environment variable increasing the size of the buffer has
been used to prevent some applications from hanging the X server :)

------------------------------

1.509: How do I switch the control and caps lock key bindings?

If you are running the X window system, you can put the following into
.xmodmaprc

  remove Lock = Caps_Lock
  remove Control = Control_L
  keysym Control_L = Caps_Lock
  keysym Caps_Lock = Control_L
  add Lock = Caps_Lock
  add Control = Control_L

Hidden Hint: Use (xmodmap -e "pointer = 3 2 1") to make the mouse
lefty friendly.

------------------------------

1.510: Missing fonts?

If your Xserver supports X11R5 try running a font server (edit
/usr/lib/X11/fs/config and run fsconf && startsrc -s fs) Consult your
Xserver instructions on how to include a font server in your font
path.

------------------------------

1.511: What's the termcap entry for an IBM 3151 look like?

#
# Written by Aleksandar Milivojevic, alex@srce.hr
# 24.09.1994
#
I2|ibm3151|3151|IBM 3151 terminal:\
	:am:mi:cr=^M:sf=^J:co#80:li#24:cd=\EJ:ce=\EI:cm=\EY%+\040%+\040:\
	:cl=\EH\EJ:dc=\EQ:dl=\EO:do=\EB:le=\ED:mb=\E4$a:md=\E4(a:\
	:me=\E4@\E>B:mr=\E4!a:nd=\EC:se=\E4>b:so=\E4!a:ue=\E4=b:up=\EA:\
	:us=\E4"a:kb=^H:kd=\EB:kh=\EH:kl=\ED:kr=\EC:ku=\EA:\
	:k1=\Ea\r:k2=\Eb\r:k3=\Ec\r:k4=\Ed\r:k5=\Ee\r:\
	:k6=\Ef\r:k7=\Eg\r:k8=\Eh\r:k9=\Ei\r:k0=\Ej\r:\
	:ti=\E>B:te=\E>B:ms:ho=\EH:bl=^G:al=\EN:ta=^I:

------------------------------

1.512: Errors starting X11 application binaries from aixpdslib.
From: <URL:ftp://aixpdslib.seas.ucla.edu/pub/README_X11R5_Stuff>

We have been aware of the problem people have with dynamic links
when running the prebuilt of X-stuffs from this library.

The typical error messages will be:

    Could not load program [program_name]
    Member shr4.o not found or file not an archive
    Member shr4.o not found or file not an archive
    Could not load library libXt.a[shr4.o]
    Error was: No such file or directory

It's because that we built the programs using X11 libraries of MIT
which are not compatible with those of IBM.  If this is the case,
then please get the compressed tarred file of the source code instead,
and recompile them on your system using your libraries.

------------------------------
1.513: .XShm*, .sm* (Shared memory) Link errors building 
                 Xwindows applications.

Link errors that refer to .XShm* often times are a result of compiling
applications to take advantage of the Shared Memory extension of the X
server.  You may either compile without shared memory or load the
shared memory extensions. (see /usr/lpp/X11/README and README.SMT) A
script for rebuilding your X server with the shared memory can be found
in /usr/lpp/X11/Xamples/server.

------------------------------

1.514: How do I set my DISPLAY when I login to another machine?

Though this is not a question specific to AIX, it appears often enough
to warrant an answer here.  There are lots of approaches, some of which
are described in the X Windows FAQ.  Most involve a little login shell
programing to parse the output of `who` or `who am i`.
<URL:ftp://boogle.uchicago.edu/pub/aix/src/hostwhence.tar.Z> by
e-siebert@uchicago.edu will help if you are willing/able to install it
suid.  See the X Windows FAQ and newsgroup for more information.

Hostwhence is also availabile in the "lsof" smit-installable package on
www-frec.bull.com. The installation scripts use ACLs to allow hostwhence to
read /dev/kmem without being set-uid-root.

------------------------------

1.515:  Why doesn't Netscape work?
From: "Gary R. Hook" <hook@austin.ibm.com>

The problem is that Netscape has statically linked libc into 
Mozilla.  When the AIX 3 libc code (setlocale()) tries to
load an AIX 4 locale, the two are incompatible and a core
dump ensues.  AIX 4 locales have to be loaded by AIX 4 libc.
Using LANG=C causes a lot of locale code to be bypassed, allowing
the application to avoid loading a non-C locale, and to continue
execution.

>From: Colin <apollo@randomc.com>
Here is a shell script that works around Netscape's problems by
setting the LANG and CLASSPATH environment variables.

#!/bin/sh
LANG=C
CLASSPATH=/path/to/java_30
export LANG CLASSPATH
if [ $# -eq 0 ]; then
   /path/to/netscape http://your.home.page &
else
   /path/to/netscape $* &
fi

------------------------------

1.600: My named dies frequently, why?
From: jpe@ee.egr.duke.edu (John P. Eisenmenger)

Running on 3.2, named dies frequently on network's primary name server.


Try the following:

     stopsrc -s named		# stop running named
     setenv MALLOCTYPE 3.1	# use 3.1 memory allocation algorithm
     /etc/named ...		# don't use smit to start named

You might be able to use startsrc/smit after setting MALLOCTYPE and get
the same effect, but I'm not sure.

[According to John, the problem is malloc() in the named code. He
 also suggests using Berkeley's bind, which he has ported and can be
 ftp'ed from ftp://ftp.egr.duke.edu/archives/bind-4.8.3.tar.gz. -ed]

Two ptfs should fix this problem. Get U412332 and U414752.

Christophe Wolfhugel <Christophe.Wolfhugel@grasp.insa-lyon.fr> reports
that bind 4.9 works fine on AIX 3.2 and without MALLOCTYPE=3.1.

------------------------------

1.601: How do I trace ethernet packets on an AIX system?
From: afx@muc.ibm.de (Andreas Siegert)

Do the following:

     iptrace -i en0 /tmp/ipt

The iptrace backgrounds.  Find its process id and kill it when you are
ready.  Then run

     ipreport -rns /tmp/ipt >/tmp/ipr

and look at the output.  The current version of Info does not document
the r, n and s options but they are quite useful for layering the output.

------------------------------

1.602 What is the authorized way of starting automount at boot time?
From: curt@ekhadafi.austin.ibm.com (Curt Finch)

I put this in my /etc/inittab:

automount:2:once:/usr/etc/automount -T -T -T -v >/tmp/au.se 2>&1

I hereby dub it authorized.

Jim Salter <jsalter@netscape.com> writes: You can also use the command:
'mkitab "automount:2:once:/usr/etc/..."' to avoid editing the file by hand.

------------------------------

1.603: How do I set a tty port for both dial-in and dial-out?

Set the mode of the tty to be either 'shared' or 'delayed'. 

------------------------------

1.604: How to move or copy whole directory trees across a network

The following command will move an entire directory tree across a network 
while preserving permissions, uids and gids.

      $rsh RemoteHost "cd TargetDir; tar -cBf - ." | tar -xvBf -

Explanation:

The tar-create is rsh'd to the remote system and is written to
stdout (the pipe).

The local system is extracting the tar that is being read from
stdin (the pipe).

From: abeloni <abeloni@hstern.com.br>

Another method is:

	rcp -rp host1:/dir host2:/dir

------------------------------

1.605: How can I send mail to hosts that cannot be pinged?
From: jupiter.sun.csd.unb.ca!dedourek (John DeDourek)

AIX 3.2 as shipped is configured to only send mail to mail addresses
which include a host name.  Many organizations use a mail address whose
"host name" part is not a host name (technically an MX name).  To change
the configuration of the AIX mailer, login as root.  Then edit the file
/etc/sendmail.cf to remove the comment marker ("# ") at the beginning of
the line which reads:
    # OK MX

Now rebuild the machine readable form of the configuration with
    sendmail -bz

and finally restart signal sendmail to load the new configuration by one
of the following:
     reboot
or
     stopsrc -s sendmail
     startsrc -s sendmail
or 
     kill -1 `cat /etc/sendmail.pid`


1.606: How to configure dialup SLIP

IBM's WWW page <http://www.ibm.com/> can lead you to a helpful document
<http://www.austin.ibm.com/pub/www/services/aix_service/faxes/SLIP.DOC.zap>

From: marvin@tornado.oche.de (Christian Bode)

If you don't have problems with slattach you should have PTF 
bos.obj 3.2.0.0.U411505 installed.  I assume that you did the right
ifconfig commands to setup your slip-device (for example sl0).

1. Create a group called slip.

2. Create a user slip with smit like this:
                                                     [Entry Fields]
* User NAME                                          [slip]
  ADMINISTRATIVE User?                                true
  User ID                                            []
  LOGIN user?                                         true
  PRIMARY group                                      [slip]
  Group SET                                          [slip]
  ADMINISTRATIVE groups                              [system]
  SU groups                                          [slip]
  HOME directory                                     [/home/slip]
  Initial PROGRAM                                    [/bin/sh]
  User INFORMATION                                   [SLIP-Dialup]
  Another user can SU to user?                        false
  User can RLOGIN?                                    true
  TRUSTED PATH?                                       nosak
  Valid TTYs                                         [/dev/tty1]
  AUDIT classes                                      []
  PRIMARY authentication method                      [SYSTEM]
  SECONDARY authentication method                    [NONE]
  Max FILE size                                      [2097151]
  Max CPU time                                       [-1]
  Max DATA segment                                   [262144]
  Max STACK size                                     [65536]
  Max CORE file size                                 [2048]
  Max physical MEMORY                                [65536]
  File creation UMASK                                [022]
  EXPIRATION date (MMDDhhmmyy)                       [0]

3. Create a tty with getty on it:
                                   Add a TTY
                                               [Entry Fields]
  TTY type                                     tty
  TTY interface                                rs232
  Description                                  Asynchronous Terminal
  Parent adapter                               sa0
* PORT number                                  [s1]
  BAUD rate                                    [38400]
  PARITY                                       [none]
  BITS per character                           [8]
  Number of STOP BITS                          [1]
  TERMINAL type                                [dumb]
  STATE to be configured at boot time          [available]
  DMA                                          on
  Read Trigger                                 0,1,2,3
  Transmit buffer count                        [16]
  Name of initial program to run               [/etc/getty]

  Note: The following attributes are only applicable if /etc/getty is
        specified as the initial program to run.

  Enable program?                              respawn
  Run level                                    2
  Enable LOGIN                                 share
  TIME before advancing to next port setting   [0]
  STTY attributes for RUN TIME                 [hupcl,cread,brkint>
  STTY attributes for LOGIN                    [hupcl,cread,echoe,>
  RUN shell activity manager                   no
  Optional LOGGER name                         []

4. Change the hardware characteristics so that it uses NO XON/XOFF handshake
   section 1.613 also talks about tty flow control.

5. A (new) .profile template for slip accounts is provided in section
   8.07.  The author, David Migliavacca, writes, "I would also like to
   assert that, to my experience, it is NOT required that the SLIP user
   be made "administrative" or member of "system" as other parts of the
   FAQ (and the original script) say.  At least on my machine 8-).  I now
   create SLIP users as members of group slip, it being the ONLY group;
   allowed ttys are set to the available modem lines only; their home
   directory is owned by root and the .profile is only readable by group
   slip.

Here's another scenario:
From: oosten@angelo.ee.ualberta.ca (Brian Oostenbrink)

Operating System: IBM AIX 3.2.1 and 3.2.3

Configuring two RS6000s via a Serial Line Interface Protocol (SLIP) 
connection over two US Robotics Sportster 14,400 modems.

The AIX implementation of SLIP is slightly different from most others. 
The ifconfig command is used to bring up a serial interface, and the
slattach command is used to connect the interface to the serial port
used for the connection.  Dialer device commands can also be issued when
invoking the slattach command, using UUCP chat syntax.

The following describes a connection between two machines:

     local.j.k.l
         ethernet IP address 129.128.127.21
         slip interface IP address 129.1.2.1

     remote.a.b.c
         ethernet IP address 129.11.22.44
         slip interface address 129.11.22.1

1. Interface configuration

Each machine must have a separate IP address dedicated to the SLIP
interface. On remote.j.k.l, start the SLIP interface with:

         ifconfig sl0 129.11.22.1 129.128.127.1  up

and on local.a.b.c:

         ifconfig sl0 129.128.127.1 129.11.22.1  up

It is important in later versions of AIX 3.2.3+ to use the same SLIP
interface # as the ptty port #, ie. if you use tty12, use ifconfig sl12
instead of sl0.

At this point the interfaces are ready to be connected.

2. tty configuration
   The tty ports on both machines were configured in an identical manner
   using smit.
                                                 [Entry Fields]
 TTY type                                           tty
 TTY interface                                      rs232
 Description                                        Asynchronous Terminal
 Parent adapter                                     sa0
 PORT number                                        []                       +
 BAUD rate                                          [38400]                  +
 PARITY                                             [none]                   +
 BITS per character                                 [8]                      +
 Number of STOP BITS                                [1]                      +
 TERMINAL type                                      [dumb]
 STATE to be configured at boot time                [available]              +
 DMA                                                on                       +
 Read Trigger                                       0,1,2,3
 Transmit buffer count                              [16]                      #
 Name of initial program to run                     [etc/getty]

 Note: The following attributes are only applicable if /etc/getty is specified
 as the initial program to run.

 Enable program?                                    respawn
 Run level                                          2
 Enable LOGIN                                       disable                  +
 TIME before advancing to next port setting         [0]                      +#
 STTY attributes for RUN TIME                       [hupcl,cread,brkint,icr>
 STTY attributes for LOGIN                          [hupcl,cread,echoe,cs8,>
 RUN shell activity manager                         no                       +
 Optional LOGGER name                               []

On older versions of AIX, we encountered some problems disabling getty, and
resorted to changing the /etc/inittab file directly. For example, change

   tty0:2:respawn:/etc/getty /dev/tty0
to
   tty0:2:off:/etc/getty /dev/tty0

This will disable getty from running. After creating the SLIP tty device,
you will need to change its hardware configuration to disable Xon/Xoff
flow control. Software flow control should not be used for SLIP. Type
'smit chtty', and then select sub item 2: Hardware settings.

Most of the parameters in the tty configuration are the defaults.

3. Modem Configuration

   The modems were configured as follows:

   RTS/CTS flow control enabled.
   Xon/Xoff software flow control disabled. Usually this is automatic if
      RTS/CTS is enabled.
   Data rate, terminal to modem = fixed.
      This is the baud rate from the tty port to the modem. We used a
      fixed modem-port transfer rate, set to the fastest speed supported
      by both the tty port and the modem. Newer modems can use a higher
      transfer rate between the modem and serial port than the modem to
      modem rate, which is necessary to use data compression effectively.  
      In our setup, we used 14.4 kBaud modems with a port speed of 38.4
      kBaud. If your modem supports this feature, use it, otherwise set
      the port speed equal to the modem connection rate. On the USR
      Sportster at&b1 fixes the serial port rate to that of the last
      AT command. The speed parameter of the slattach command can be
      used to ensure that this rate is that set in the tty configuration.
   Error Correction enabled - not mandatory, but a good idea
   Data Compression - not required, but it helps, especially for text
      transfers.
   Auto Answer - If the SLIP connection is to be initiated from either
      machine, both modems should be set to auto answer, otherwise, just
      the answering modem.

   It is a good idea to configure the modem and then save the settings
   to NVRAM, so that the correct settings can always be restored by the
   slattach command.

4. UUCP configuration files

   /usr/lib/uucp/Devices
   /usr/lib/uucp/Dialers

   The Devices file must contain an entry with the tty and serial port
   speed used for the interface. In our example,
      Direct tty0 38400 slipdialer

   The keyword 'slipdialer' is merely an index into the Dialers file.
   For our purposes, the slipdialer entry in the Dialers file is simply:

      slipdialer

   This entry can also contain UUCP chat commands, or the chat commands
   can be included in the slattach command.

5. slattach invocation

   slattach connects the device on the tty port to the SLIP interface
   created by ifconfig, and sends any commands to the tty device if
   needed. For our example, remote.j.k.l would never initiate a call,
   only answer incoming calls. Therefore we execute:

         slattach tty0 38400 '"" ATZ OK ""'

   which connects the tty at 38400 baud. We could also simply run

         slattach tty0

   ie. without any modem commands, but the modem to port speed may not
   be correctly set this way. In addition, the ATZ command ensures the
   modem is set to the NVRAM settings.

   On local.a.b.c type:

         slattach tty0 38400 '"" ATZ OK \pATDT4925871 BIS ""' 4

   This establishes the link at 38400 baud, and executes the dial string
   as shown. The dial string is a UUCP chat string and are configured
   in an expect send expect send ... format. The string:

         '"" ATZ OK \pATDT4925871 BIS ""'

   is interpreted as:
   expect "" (null string) from modem
   send   ATZ              to modem
   expect OK               from modem
   send   \pATDT4925871    to modem
   expect BIS              from modem

   BIS is the end of the CONNECT STRING. You could use any portion of
   the string returned by the modem upon a connection as the expect
   string. It may be wiser to simply expect CONNECT since all
   connections should return this string.
   The null strings are necessary because the first parameter of the
   UUCP is an expected string from the modem, which can only be a null
   string until the modem has been given a command.

   The last parameter (4) of the slattach command is the debug level. 
   A debug level of 4 displays the UUCP chat strings, which is useful
   for checking the modem status.

6. Routing
   ifconfig is sufficient if all you want to do is talk between the
   two hosts.  If you are running SLIP so that you can talk to more
   than just that one other host you have to advertise your address.
   
   1) arp -s 802.5 iago 10:00:5a:b1:49:d8 pub
        where 802.5 is a token-ring network the hardware address can
        be obtained with `netstat -v` and iago was the SLIP client (My
        PC at home :)  pub is the important part it means "published"
        You may want to run this at boot time. 

   Routing through the SLIP link is similiar to routing of any gateway. 
   Invoking the ifconfig command automatically sets up a route between
   the two SLIP machines. An entry in /etc/hosts or the named database
   should be made, with the same machine name used for the SLIP address
   as the ethernet address on each machine. For example, in /etc/hosts
   on remote.a.b.c (and any other machine on remote.a.b.c ethernet):

     129.11.22.44 remote.a.b.c # ethernet address
     129.11.22.1  remote.a.b.c # slip address

   It is preferable to place the ethernet address in the hosts file
   before the SLIP address so remote.a.b.c will resolve to the
   ethernet address. When using named, it is important to have both
   addresses in the reverse file with the same name. We experienced
   difficulties with NFS mounting over the slip link, owing to some
   machine interpreting NFS requests from one of the two SLIP machines
   as coming from the SLIP address, while the SLIP machine believed it
   was sending the request from the ethernet address. This problem was
   eliminated by having both addresses reverse resolve to the same name.

7. Performance
   At a modem speed of 14.4 kBaud and a port speed of 38.4 kBaud, we
   realized a transfer rate through ftp of about 3.5 kB/s for text
   files, and 1.3 kB/s for compressed files.

------------------------------

1.607: Where is DCE discussed?

DCE is the Distributed Computing Environment, which is roughly a
flexible client-server architecture for heterogenous platforms.
For more information, take a look in comp.soft-sys.dce.


------------------------------

1.608: How do I make /var/spool/mail mountable?
From: petersen@pi1.physik.uni-stuttgart.de (Joerg Petersen)

In our cluster we share a /usr/local disk. We have a directory
/usr/local/spool/mail and /var/spool/mail is soft-linked to it.

From: fred@hal6000.thp.Uni-Duisburg.DE (Fred Hucht)

Several problems has been reported on sharing the mail directory via
NFS. The problems may occur when two or more sendmail daemons and/or
mail readers access a user's mail file simultanously, because of NFS'
file locking mechanism.

We use another method here: Every user has one line in his/her
$HOME/.forward file that reads

xxx@mainserver.domain.name

where xxx is the user node and mainserver.domain.name is the full
hostname of one of the machines. Then all incoming mail to all machines
is forwarded to mainserver, while mainserver ignores this line.


1.609: getty spawning too rapidly 
From: aslam@abaseen.lums.edu.pk (Sohail Aslam)

The problem can occur due a number of modem settings. The most
frequent is that the echo is not disabled on modems that are to
accept incoming calls. In hayes language, ATE0 disables echo.
If echo is enabled, the login prompt sent by the DTE (computer)
is echoed back to it. It then issues "password:" prompt which
the modem conveniently echoes back again. And the cycle goes on.

Another setting to check is the Q registers which controls the
modem's response to the DTE. The hayes command ATQ0 enables
results codes. The Q register in conjunction with the X and
the V registers, reports back to the DTE the status of the incoming
or outgoing call, and the type of connection established. For
outgoing calls, one would want to enable result codes but not
for incoming calls. If codes are enabled (via ATQ0), when a
call comes in, the modem will send strings (if ATV1 and ATX4 set)
"RINGING", "CONNECTED" etc. to the local DTE. The getty will think
some one is trying to login. It will send password prompt. Trouble
again. Telebit and other intelligent modems has ATQ2 setting
which says "reports codes only when calling out." For others,
you will need to disable it (ATQ1) and enable when calling out.

The DSR setting can be a source of problem. Ideally, modem should
raise DSR only when CD is detected and modem raises CTS. Computer,
such as the VAX, wait 30 seconds after the modem raises DSR. If
CD is not on by that time, the computer will drop DTR causing the
modem to reset. The DSR should be set to be raised only when
carrier has been detected. The hayes setting is AT&S1.

The DCD setting should be such that it reflects the true nature of
the carrier. The CD can be forced on at all times (AT&C0). This
is not good. Set it to AT&C1.

Most modems can reload saved settings from non-volatile memory
on a DTR transition. This is useful for resetting the modem
when a call drops. Use AT&D3 to get this effect. 

For dial in, thus, set AT E0 Q1 &C1 &D3 &S1 &W. The &W stores the
settings in memory. They will be reloaded due to &D3.


------------------------------

1.610: Does AIX support Compressed SLIP (CSLIP)?

No.  That means no VJ compression either :)  See PPP in section 5.07 
if you want more than standard SLIP.


------------------------------
1.611: How do I setup anonymous ftp on my AIX system?

(stolen from Peter Klee <klee@dhdibm1.bitnet> posting)

Have a look at '/usr/lpp/tcpip/samples/anon.ftp'. It is a shell script
and will set up a anonymous ftp site on your local RS/6000.  Note: the
ftpd that comes with AIX does not support the display messages every
time a user changes a directory or even when they login.

------------------------------

1.612: Talk, getting notification.

If you are not getting notification (that someone wants to talk to
you), use (swcons `tty` && mesg y) in one window.

There are many variations of 'talk' and finding compatible versions
for multiple operating systems can be tricky.


------------------------------

1.613: Disabling software flow control; using RTS/CTS.

Different versions of AIX 3.2.5 respond differently to attempts to
enable flow control (RTS/CTS signals).  This section is an attempt to
compile a list of different approaches.

The most straight forward is:
   chdev -l ttyxx -a rts=yes
   [ Note: ix40410 for AIX 3.2.5 should give you this functionality.  
   PTF U426113 and numerous other superceding ptfs should provide this.]

If carrier signal is high (its connected) you can try
   stty add rts </dev/ttyxx 

There is also a program that I first saw on the 800-IBM-4FAX number,
also found in INFO that will remedy the situation in some cases.  Note
that this code ignores the return code from ioctl (which on my machine
is <0 :)

------------------------------

1.614: NIS security
Ole.H.Nielsen@fysik.dtu.dk (Ole Holm Nielsen)

SUMMARY: AIX 3.2.4 and above includes support for a more secure setup
of the ypserv NIS daemon.  You can prevent any random host on the
entire Internet from reading your NIS maps, as is possible with the
default AIX setup.
 
The details:
------------
After starting the ypserv daemon, I noticed in the syslog the following line:
Jan 17 12:01:18 zeise syslog: /usr/etc/ypserv: no /var/yp/securenets file 
This indicates that ypserv is looking for the mentioned configuration
file, but did not find it, and hence will deliver the NIS maps to
anyone on the net who can guess the NIS domainname.  I installed the
/var/yp/securenets file and restarted ypserv, and it works !  Any
illegal attempt to read NIS maps will result in the following getting
logged to syslog (example):
Jan 18 13:37:27 zeise syslog: ypserv: access denied for 129.142.6.79 

How to enable this NIS security option:  
Install the /var/yp/securenets file, for example:

# /var/yp/securenets file
#
# The format of this file is one of more lines of
# netmask netaddr
# Both netmask and netaddr must be dotted quads.
#
# Note that for a machine with two Ethernet interfaces (i.e. a gateway
# machine), the IP addresses of both have to be in /var/yp/securenets.
#
# for example:
#255.255.255.0 128.185.124.00
# Loopback interface
255.255.255.255 127.0.0.1

Uncommenting the last line would limit access to hosts on the
128.185.124.*  net, only.  The loopback interface must be included, as
shown above.

To log violations, have a /etc/syslog.conf file containing the proper
events.  We use this line:

*.err;kern.debug;auth.notice;user.none          /var/adm/messages

Caveat emptor:  This works for us, and you will have to verify it at
your own installation.  Don't complain to us if you have troubles.  
I do not know what PTF level our AIX 3.2.4 is at.  Our ypserv daemon 
looks like this:

zeise> strings /usr/lib/netsvc/yp/ypserv | head -2
@(#)16
1.12  com/cmd/usr.etc/yp/ypserv.c, cmdnfs, nfs325, 9334325a 5/4/93 19:44:41

If your AIX doesn't have securenets support, ask your support centre
for the PTF which includes APAR IX32328.  That seems to have included
the securenets support.


------------------------------

1.615: Why can't non-anonymous users login using WU-FTP?
From: swcxt@boco.co.gov (Shane Castle)

You must create a file named /etc/shells (this is the real /etc not a
subdirectory of your false root), that contains all the shells that
are defined on your system.  Get the list from
/etc/security/login.cfg.  Also, if having proper group authentication
is important to you, apply the following patch:

--- ftpd.c.dist	Wed Apr 13 15:17:18 1994
+++ ftpd.c	Tue Jan 17 13:29:58 1995
@@ -1153,7 +1153,13 @@
        setgroups(NULL, NULL);
        if (setpriv(PRIV_SET|PRIV_INHERITED|PRIV_EFFECTIVE|PRIV_BEQUEATH,
                    &priv, sizeof(priv_t)) < 0 ||
-           setuidx(ID_REAL|ID_EFFECTIVE, (uid_t)pw->pw_uid) < 0 ||
+           initgroups(pw->pw_name, (gid_t)pw->pw_gid) < 0 ||
+           setgidx(ID_REAL|ID_EFFECTIVE, (gid_t)pw->pw_gid) < 0 ||
+           setegid((gid_t)pw->pw_gid) < 0) {
+               reply(550, "Can't set gid (AIX3).");
+               goto bad;
+       }
+       if (setuidx(ID_REAL|ID_EFFECTIVE, (uid_t)pw->pw_uid) < 0 ||
            seteuid((uid_t)pw->pw_uid) < 0) {
                reply(550, "Can't set uid (AIX3).");
                goto bad;

------------------------------

1.616: NIS users can't login, do I need '*' in /etc/passwd?
From: ohnielse@fysik.dtu.dk (Ole Holm Nielsen)

Aparently at least one version of AIX InfoExplorer suggests
administrators use "+:*:0:0:::" as the last entry in the /etc/passwd
file of NIS clients for security reasons.  If the configuration SMIT
is done using SMIT it will actually append "+::0:0:::" which works and
does not compromise security.  Using the '*' in the passwd field
actaully prevents NIS users from logging in.

"+::0:0:::" should not allow you to login as user "+" and without a
password even when NIS is disabled, but it never hurts to double
check.

------------------------------
1.617: HP JetDirect cards and virtual printers?  mkvirprt problems?

(stolen from many)

Since the release of AIX 3.2.5 adding a queue for JetDirect cards is as
easy as creating a virtual printer using "smit mkvirprt" or mkvirprt.
If the command hangs make sure you are using an HFT, aixterm or vt100
terminal.  The entire procedure is available from the IBM FAX
"Information Line" (800 IBM-4-FAX).

From: Mark Bergman <mark.bergman@syseca.co.uk>

SMIT complains that some required software is not present on the system.
It turns out that this software, "printers.hpJetDirect.attach (4.1.3.0)"
is on the installation CD.

HOWEVER, there is some bug somewhere, whereby the software may actually
be already installed, but the system cannot see it.  (Or maybe the bug
is that the software is actually NOT installed, but the system in one
place thinks it is! - I'm not sure).  Therefore, use smit to look at
Installed Software ("Software Installation and Maintenance", "Maintain
Installed Software", "List Installed Software" and look at all software,
then search through for "jet".  If it finds it (i.e. it thinks that it
is installed) - you must remove it (under smit's "Maintain Installed
Software" level), and then reinstall from the CD!

------------------------------

1.618: How can I hack libc.a to alter how hostnames are resolved?
From: <mlarsen@ptdcs2.intel.com> "L. Mark Larsen"

[ 
  Editors note:  The implications of corrupting libc.a should not be
  understated.  While recovering from a corrupt libc.a should be a
  matter of booting from floppy I wouldn't wish that on anyone with a 
  supervisor or users to support :)

  Before you attempt this,  you might want to read 2.07 first for
  advice on recovering from a destroyed or corrupted libc.a.
  Remember:  backups are a VERY GOOD IDEA.

  enough of the weak kneed quivering...
]

Nate Itkin (a colleague) is the individual who did the initial work.
I suspect he would rather not be troubled with any questions you may
have in this area and I can probably answer them just as easily.  The
motivation for this was to use DNS for MX records (we are using IDA
sendmail) but NIS for most hostname lookups.

Secondly, warnings:  IBM has not given any sort of stamp of approval on what
we have done (though they appear to have integrated resolv+ into AIX 4 based
on some release notes I saw).  While we have been using it successfully for
about one year and have seen no problems, we can't and won't promise the same
for you.  This procedure plays around with libc.a which, as you probably know,
is an XCOFF shared library under AIX and hence a critical part of the running
system.  You assume all the risk if you try to install this.  All the usual
disclaimers about liability, etc. apply - there is no warranty associated with
any of this.

Furthermore, know that any PTF you subsequently install that updates/replaces
libc.a implies that you have to execute most of these procedures again.

The details on how to use resolv+ under AIX 3 (it's only tested under
3.2.5 but should work for all point releases), have been moved to
section 8.09.

------------------------------

1.619: What modem settings do I need?

ATQ2  - result codes in originate only
AT&C1 - CD follows state of carrier 
AT&D2 - hangup on DTR drop


------------------------------
1.620: NIS slave server config with master on different subnet?
From: msidler@metronet.com (Mike Sidler)

Assuming AIX 3.2.5,the master server up and running and the hosts file
has the master name defined. On slave do:

    1) domainname <domain_name that matches master>
    2) startsrv -s ypserv
    3) startsrv -s ypbind (ypwhich should return "loopback")
    4) (/usr/sbin/)ypset -d <domainname> <master_server_name>
       (ypwhich should return "<master_server_name>"
    5) (/usr/sbin/)ypinit -s <master_server_name>
    6) Put "+::0:0:::" in /etc/passwd after last local login. 
       Note: InfoExplorer has this entry INCORRECT in some versions.
    7) Other cfg files (group, etc) may need configuring but this will
       get ypserv and ypbind running on the slave looking at the right stuff.


------------------------------

1.621: Why does my 64 port concentrator loose data and drop the queue?
[From: as@mynet.no (Arild Sletvold)]

This problem has been associated with upgrading machines to 3.2.5.
Try changing the values for the "Transmit buffer count" parameter in
the printer/plotter setup in smit. You need to experiment with this
parameter, to see which value that makes the printer print as fast as
possible.  If the value is too high, the printers will loose some of
the data, and the queue will be disabled.  If the value is too low,
the printers will print very slowly.

------------------------------

1.622: Netscape FastTrack server won't install on AIX 3.2.5 or 4.1.
From: Cameron Ferstat <cferstat@austin.ibm.com>

Before installing FastTrack on an AIX 3.2.5 or 4.1 system, you must 
first install the AIX Shared Library Hookable Symbols/6000 Version 
1.1.5.0, Reference RPQ No. P91153.  (Note:  This software should *not*
be installed on an AIX 4.2 system!)

If you try to install FastTrack on an AIX 3.2.5 or 4.1 system, without 
first installing the Hookable Symbols PRPQ, you will get the following 
error:

   > ./ns-setup
     0509-037 System error - error data is: ./ns-setup
     0509-022 Cannot load library libsvld.a[shr.o].
     0509-026 System error: A file or directory in the path name does not exist.

You can download the installp image by anonymous ftp from
<ftp://ftp.software.ibm.com/aix/products/netscape/tools/slhs.rte.inst_image>.

There is also an associated README.slhs file in that directory.

------------------------------

1.623: How can I share files/printers with Windows 95?

The freeware solution is Samba,  available from <http://www-frec.bull.com/>.

Commercial solutions include Fusion95 from Performance Technology
<http://www.perftech.com/> and Syntax <http://www.syntax.com/>.

------------------------------

1.624: Printing from AIX to WinNT/95/3.1
From: Charles J. Fisher <charles_fisher@bigfoot.com>

1. On your Windows system, share the printer. Assuming that you are
   running NT, make a user "root" with some password.

2. Get the Samba distribution from http://www.samba.org
   If you have a C compiler, get the source and compile it.
   If you don't have a C compiler, get a binary distribution for AIX.

3. Install Samba on AIX under /usr/local/samba. Specifically, make sure
   that /usr/local/samba/bin/smbclient is installed with execute rights
   for everyone.

4. You must also install a Samba configuration file under
   /usr/local/samba/lib/smb.conf

   If you intend to use your AIX as a file server for windows clients,
   you should modify smb.conf to accomplish this (see the Samba
   documentation).

   If you will be printing only, just use the sample smb.conf.

5. Make the directory /usr/local/samba/lib/printers

6. In that directory, install the following shell script as
   file "winprint":

#!/bin/sh

# This is a modification of the samba provided smbprint script
# changed to work under AIX as the backend for a queue. It does
# not read a config file.
#
# Variables below define the server and service. They are
# the content of the .config file when printing from
# /etc/printcap.
#
server="winserver"
service="winprinter"
user="root"
password="root"
#
# Debugging log file, change to /dev/null if you like.
#
#logfile=/tmp/${USER}-print.log
#
# Some debugging help, change the >> to > if you want to save space.
#
#echo "server $server, service $service" >> $logfile
#cat $1 | /usr/local/samba/bin/smbclient "\\\\$server\\$service" 
$password \
#       -N -P -c 'print -' >> $logfile

(
# NOTE You may wish to add the line `echo translate' if you want automatic
# CR/LF translation when printing.
        echo translate
        echo "print -"
        cat $*
) | /usr/local/samba/bin/smbclient "\\\\$server\\$service" $password \
	-U "$user" -N -P  > /dev/null

7. The above file assumes that you are using \\winserver\winprinter
   as the printer share, and that the user is "root" and the password
   is "root". If this is not the case, modify the shell variable
   declarations.

8. Mark the file with execute permissions with "chmod 755 winprint"

9. Test the script with the command: "./winprint /etc/passwd"
   If everything is ok, your password file should be spooled to your
   windows printer.

   If it doesn't work, remove the "> /dev/null" from the last line of
   the script and rerun it. Examine the output of smbclient for clues.

   Clue #1: The Windows printer server is on the other side of a router.
            AIX is sending broadcast packets to find the Windows machine,
            which the router will not forward. You must find the Windows
            server's IP address and specify it with the "-I" parameter
            to smbclient, i.e. "-I 1.2.3.4". DHCP makes this situation
            even more complex.

   Clue #2: You username or password is wrong. smbclient will tell you
            about this if you free its output from > /dev/null.

   Clue #3: You might be violating shell quoting rules if you use
            special characters in the server or share name, password,
            etc. Don't use $, ", ', etc., or escape them properly.
            A password of ";rm -rf /" could be catastrophic.

10. Once the script can print files, it must be defined as a printer in
    the /etc/qconfig file. Add the following lines to the end of your
    /etc/qconfig:

winprint:
        device = dwinprint
        up = TRUE
        discipline = sjn
dwinprint:
        backend = /usr/local/samba/lib/printers/winprint

11. Test the printer with the following command:
    "lp -d winprint /etc/passwd"
    (Your password file should be printed again.)

12. You might examine the queue with the command "lpq -P winprint"
    or "lpstat -t"

------------------------------

1.625: How do I get NFS mounting with Linux to work?

Linux by default requires any NFS mount to use a so called reserved port
below 1024 and AIX 4.3 does by default use ports above 1024. You can use
the nfso command to restrict AIX to the reserved port range as follows:

	nfso -o nfs_use_reserved_ports=1

------------------------------

1.626: Telnet takes a 45 seconds to produce a prompt.

This is in nearly all cases a DNS configuration problem, the AIX machine
can not resolve the IP address of the node initiating the telnet
connection. You can check the DNS reverse mapping by using the nslookup
command on the IP number in question, this will probably timeout as
well. Make sure that the nameserver lines in the /etc/resolv.conf file
point to valid name servers. Some folks have reported that putting the
following in /etc/netsvc.conf can help as well (see also Subject:
1.800):

	hosts=local,bind4

------------------------------

1.700: Free LVM lecture slides.
From: shieh@austin.ibm.com

If you want free LVM documentation (lecture notes) from the
SHARE conference in San Franciso where I presented last March
just:
 
 mail -s "S_basics.ps" shieh@austin.ibm.com < /dev/null
 mail -s "S_limits.ps" shieh@austin.ibm.com < /dev/null
 mail -s "S_lvm_extra.ps" shieh@austin.ibm.com < /dev/null

[Editor's note: Jens-Uwe Mager converted the slides to PDF format.  They
are available as <http://www.han.de/~jum/aix/lvm.pdf>.]

------------------------------

1.701: How do I shrink /usr?
From: mike@bria.UUCP (Michael Stefanik) and Richard Hasting

FOR AIX 3.1
-----------

 1) Make a backup of /usr

        find /usr -print | backup -ivf /dev/rmt0 (or appropriate device)

 2) shutdown to maintenance mode

        shutdown -Fm
 
 3) export LANG=C
 
 4) remove the filesystem and the logical volume
    ignore an error about the "dspmsg" command not found

        umount /usr
        rmfs /usr

 5) make a new logical volume hd2 and place it on rootvg with desired size

        mklv -yhd2 -a'e' rootvg NNN 

   where NNN is the number of 4 meg partitions

 6) create a filesystem on /dev/hd2

        crfs -vjfs -dhd2 -m'/usr' -Ayes -p'rw'

 7) mount the new /usr filesystem and check it

        /etc/mount /usr
        df -v

 8) restore from the tape; system won't reboot otherwise

        restore -xvf/dev/rmt0

 9) Sync and reboot the system; you now have a smaller /usr filesystem

FOR AIX 3.2
-----------

 0)  Experiences posted to comp.unix.aix lead me to suggest that
     many administrators find the following piece of information 
     useful after completing this procedure.  I thought some of you
     might like to read it BEFORE getting yourself into this
     predicament.  

     Call 1-800-IBM-4FAX and request document 2503 dated 1/26/94.  
     Title is "How to recover if all files are owned by root after
     restoration from a mksysb tape".

 1) Remove any unneeded files from /usr.

 2) Make sure all filesystems in the root volume group are mounted. If
    not, they will not be included in the re-installed system.

 3) Type mkszfile. This will create /.fs.size that contains a list of
    the active filesystems in the root volume group that will be
    included in the installation procedure.

 4) Edit .fs.size. Change the size of /usr to what you want.

    Example: This .fs.size file shows /usr to be 40MB.

	rootvg 4 hd2 /usr 10 40 jfs

    The 10 is the number of physical partitions for the filesystem and
    the 40 is 40 MB. Most systems have a physical partition size of 4 MB.
    Therefore, the second number (40) will always be 4 times the
    previous number (10). Note, however, that a model 320 with a 120 MB
    drive will have a physical partition size of only 2 MB, and the
    total MB is twice the number of physical partitions. The first
    number (4) in the .fs.size file represents the PP size.

    If you want to reduce the size of /usr from 40 MB to 32 MB, edit the
    /usr entry to:

        rootvg 4 hd2 /usr 8 32 jfs

    IMPORTANT: Make sure that you DO NOT enter a value which is less
    than the size of the filesystem required to contain the current
    data. Doing so will cause the re-installation procedure to fail.

 5) chdev -l rmt0 -a block=512 -T

 6) Unmount all filesystems that are NOT in the root volume group.
 
 7) Varyoff all user-defined volume groups, if any

        varyoffvg VGname

 8) Export the user-defined volume groups, if any

        exportvg VGname

 9) With a tape in the tape drive, type

        mksysb /dev/rmt0

     This will do a complete system backup, which will include
     information (in the .fs.size file) for the installation procedure
     on how large the filesystems are to be created.

 10) Follow the instructions in the Installation Kit under "How to
     Install and perform maintenance from Diskettes" (reportedly now 
     called "BOS Installation from a System Backup") using the
     diskettes and tape that you created in the previous steps.

     [ pre AIX 325: DO NOT select the option "Reinstall AIX with
     Current System Settings". Instead use "Install AIX with Current
     System Settings" for the logical volume size changes to take affect. ]

     [ w/ AIX 325: Select "Install from a mksysb image" ]

 11) When the installation is complete, you may then import any
     user-defined volume groups.

         importvg -y VGname PVname

     where "VGname" is the name of the volume group, and "PVname" is
     the name of any one of the physical volumes in the volume group.

 12) Varyon your user-defined volume groups

         varyonvg VGname

 The reduction of the filesystems is now complete.

COMMERCIAL OPTION
-----------------
There are also commercial tools availible to help you do this more
conviently.  I know of one vendor that can be reached at info@compunix.com

------------------------------

1.702: How do I make a filesystem larger than 2Gb?

AIX 3.2.5 and preceeding versions are limited to 2 Gigabytes per
filesystem.

With AIX 4.1 IBM allows filesystems up to 64Gb (reference:
Individual files are still limited to 2Gb.  AIX 4.2 allows 128Gb
filesystems and 64 Gb files.  (See also question 1.706.)

If you are having trouble creating a file greater than 1Mb it maybe
because that is the default limit for your account, see 'smit users'
or /etc/security/limit.

------------------------------

1.703: Chlv warning.  Is the first 4k of a LV safe?

The first 4k of a raw LV are used to store control block.
Applications that write to the raw disk can overwrite this section
(common applications that do this are Oracle and Sybase).  Commands
that call getlvcb will generate a warning but succeed (since the
control block exists in ODM.  Don't run synclvodm unless you really
want to erase the first 4k and replace it with the info from the ODM.

shieh@austin.ibm.com (Johnny Shieh) has kindly provided the following
explanation:

The logical volume control block (lvcb) is the first 512
bytes of a logical volume.  This area holds important
information such as the creation date of the logical volume,
information about mirrored copies, and possible mount points
in a journaled filesystem.  Certain LVM commands are required
to update the lvcb, as part of completeness algorithms in
LVM.  The old lvcb area is first read and analyzed to see if
it is a valid lvcb.  If the information is verified as valid
lvcb information, then the lvcb is updated.  If the
information is not valid, then the lvcb update is not
performed and the user is given the warning message:

	Warning, cannot write lv control block data

Most of the time, this is a result of database programs
accessing the raw logical volumes (and thus bypassing the
journaled filesystem) as storage media.  When this occurs, the
information for the database is literally written over the lvcb.
Although this may seem fatal, it is not the case.  Once the
lvcb has been overwritten, the user can still:

	1) Extend a logical volume
	2) Create mirrored copies of a logical volume
	3) Remove the logical volume
	4) Create a journaled filesystem with which to mount
		the logical volume (note that this will destroy any
		data sitting in the lvcb area)

However, there is a limitation caused by this deletion of the
lvcb.  The logical volumes with deleted lvcb's face possible,
incomplete importation into other AIX systems.  During an
"importvg", the LVM command will scan the lvcb's of all defined
logical volumes in a volume group for information concerning the
logical volumes.  Surprisingly, if the lvcb is deleted, the
imported volume group will still define the logical volume to
the new AIX system which is accessing this volume group, and
the user can still access the raw logical volume.  However, any
journaled filesystem information is lost and the logical volume
and its associated mount point won't be imported into the new AIX
system.  The user must create new mount points and the availability
of previous data stored in the filesystem is NOT assured.  Also, during
this import of a logical volume with an erased LVCB, some non-jfs
information concerning the logical volume, which is displayed with
the "lslv" command, cannot be found.  When this occurs, the system uses
default logical volume information to populate the logical volume's
ODM information.  Thus, some output from the "lslv" will be inconsistent
with the real logical volume.  If logical volume copies still exist on
the original disks, this information will not be correctly reflected in
the ODM database.  The user should use "rmlvcopy" and "mklvcopy" to
rebuild any logical volume copies and synchronize the ODM.  Finally,
with an erased lvcb, the output from the "lslv" command might be
misleading or unreliable.


------------------------------

1.704: What's the limit on Physical Partitions Per Volume Group?
From: shieh@austin.ibm.com (Johnny Shieh)

1016 Physical Partitions Per Disk in a Volume Group:

     In the design of LVM, each Logical Partition
maps to one Physical Partition.  And, each Physical
Partition maps to a number of disk sectors.  The design
of LVM limits the number of Physical Partitions that LVM
can track PER DISK in a volume group to 1016.  In most cases,
not all the possible 1016 tracking partitions are used by a disk.
The default size of each Physical Partition during a
"mkvg" command is 4 MB, which implies that individual
disks up to 4 GB can be included into a volume group.

     If a disk larger than 4 GB is added to a volume
group (based on usage of the default 4 MB size for
Physical Partition) the disk addition will fail with a
warning message that the Physical Partition size needs
to be increased.*  There are two instances where this
limitation will be enforced.  The first case is when the
user tries to use "mkvg" to create a volume group where
the number of physical partitions on one of the disks in
the volume group would exceed 1016.  In this case, the
user must pick from the available Physical Partition ranges of:

1, 2, (4), 8, 16, 32, 64, 128, 256

Megabytes and use the "-s" option to "mkvg".  The second
case is where the disk which violates the 1016 limitation
is attempting to join a pre-existing volume group with
the "extendvg" command.  The user can either recreate the
volume group with a larger Physical Partition size (which
will allow the new disk to work with the 1016 limitation)
or the user can create a standalone volume group (consisting
of a larger Physical Partition size) for the new disk.

     In AIX 4.1 and 3.2.5, if the install code detects
that the rootvg drive is larger than 4 GB, it will change
the "mkvg -s" value until the entire disk capacity can be
mapped to the available 1016 tracks.**  This install change
also implies that all other disks added to rootvg, regardless
of size, will also be defined at that new Physical Partitions size.

For RAID systems, the /dev/hdiskX name used by LVM in AIX may
really consist of many non-4GB disks.  In this case, the 1016
limitation still exists.  LVM is unaware of the size of the
individual disks that may really make up /dev/hdiskX.  LVM bases
the 1016 limitation on the AIX recognized size of /dev/hdiskX,
and not the real independent physical disks that make up /dev/hdiskX.

The questions asked of this issue are:
1) What are the symptoms of this problem?
2) How safe is my data?  What if I never use mirroring or migratepv?
3) Can I move this volume group between RS/6000 systems and versions
   of AIX?

Here are the answers:
A) What are the symptoms of this problem?
     The 1016 VGSA is used to track the "staleness of mirrors".
     If you are in violation of 1016, you may possibly get a false
     report of a non-mirrored logical volume being "stale" (which
     is an oxymoron) or you may get a false indication that one of
     the your mirror copies has gone stale.  Next, migratepv may
     fail because migratepv briefly uses mirroring to move a logical
     volume from one disk to another.  If the target logical
     partition is incorrectly considered "stale", then the migratepv
     cannot remove the source logical partition and the migratepv
     command will fail in the middle of migration.

B) How safe is my data?  What if I never use mirroring or migratepv?
     The data is as safe (in your mind) as the day before you found
     out about 1016 violations.  The only case where data may be
     lost is if one is mirroring a logical volume and ALL copies go
     bad at the same time and LVM isn't aware of it because the
     copies that go bad are beyond the 1016 tracking range.  However,
     in this case, you would lose data even if you were within the
     1016 range.  If you never mirror or use migratepv, then this
     issue shouldn't concern you.  But, it might be unwise to state
     you'll NEVER use either of those options.

C) Can I move this volume group between RS/6000 systems and versions
   of AIX?
     Yes you can.  The enforcement of this 1016 limit is only
     during mkvg and extendvg.  The "safeness" of the data on the
     volume group on AIX 3.2 is the same as it is on AIX 4.1.


* This bug was fixed in apar ix48926.  Current AIX 3.2.5 and
4.1.1, which do not have this fix on applied, will allow the
creation of volume groups with more than 1016 partitions.  The
implication of this bug allowing more than 1016 physical
partitions is that the user may access all portions of the logical
volume.  However during disk mirroring, the status of partitions
beyond the 1016 limit will not be tracked correctly.  If mirrors
beyond the 1016 range become "stale", LVM will not be aware of
their condition and data consistency may become an issue for
those partitions.  Additionally, the "migratepv" command creates
mirrors and deletes them as a method for moving logical volumes
around within/between disks.  If the 1016 limit is violated,
then the "migratepv" command may not behave correctly.
The user should pick up apar ix51754, which clarifies the error
message when this condition is detected.  Additionally, the user
can read the non-ptf documentation apar ix50874 which is a companion
to ix48926 and ix51754.

** This bug was fixed for AIX 3.2.5 rootvg install in apars
ix46862 and ix46863.  This bug does not exist in AIX 4.1.1.

------------------------------

1.705: Why am I having trouble adding another disk to my VG?
From: shieh@austin.ibm.com (Johnny Shieh)

In some instances, the user will experience a problem adding
a new disk to an existing volume group or in the creation of
a new volume group.  The warning message provided by LVM will
be:

	Not enough descriptor space left in this volume group.
	Either try adding a smaller PV or use another volume group.

On every disk in a volume group, there exists an area called the
Volume Group Descriptor Area (VGDA).  This space is what allows
the user to take a volume group to another AIX system and
"importvg" that volume group into that AIX system.  The VGDA
contains the names of disks that make up the volume group, their
physical sizes, partition mapping, logical volumes that exist in
the volume group, and other pertinent LVM management information.

When the user creates a volume group, the "mkvg" command
defaults to allowing the new volume group to have a maximum
of 32 disks in a volume group.  However, as bigger disks have
become more prevalent, this 32 disk limit is usually not
achieved because the space in the VGDA is used up faster, as
it accounts for the capacity on the bigger disks.  This
maximum VGDA space, for 32 disks, is a fixed size which is
part of the LVM design.  Large disks require more management
mapping space in the VGDA, which causes the number and size
of available disks to be added to the existing volume group
to shrink.  When a disk is added to a volume group, not only
does the new disk get a copy of the updated VGDA, but all
existing drives in the volume group must be able to accept
the new, updated VGDA.

The exception to this description of the maximum VGDA is
rootvg.  In order to provide AIX users more free space, when
rootvg is created, "mkvg" does not use the maximum limit of
32 disks that are allowed into a volume group.  Instead in
AIX 3.2, the number of disks picked in the install menu of
AIX is used as the reference number by "mkvg -d" during the
creation of rootvg.  For AIX 4.1, this "-d" number is 7 for
one disk and one more for each additional disk
picked. i.e. you pick two disks, the number is 8.  you pick
three disks, the number is 9, and so on.....  This limit does
not mean the user cannot add more disks to rootvg in the
post-install phase.  The amount of free space left in a VGDA,
and thus the number of size of the disks added to a volume
group, depends on the size and number of disks already
defined for a volume group.  However, this smaller size
during rootvg creation implies that the user will be able to
add fewer disks to rootvg than compared to a non-rootvg
volume group.

If the customer requires more VGDA space in the rootvg, then
they should use the "mksysb" and "migratepv" commands to
reconstruct and reorganize their rootvg (the only way to
change the "-d" limitation is recreation of the rootvg).

Note:  It is always strongly recommended that users do not place
user data onto rootvg disks.  This separation provides an extra
degree of system integrity.

------------------------------

1.706: What are the limits on a file, filesystem?

There are other limits but these come up most often.  Logical Volumes
do not _have_ to contain Journaled File Systems and therefore can be
larger than 2GB even in 3.2.5.

	File	jfs-Filesystem
3.2.5	2GB	2GB
4.1.x	2GB	64GB
4.2	64GB	128GB

While it *might* be possible to create larger file systems,  the limits
shown here represent values that IBM has supposedly tested.	

------------------------------

1.707:  Hints for Segate 9 GB and other disks larger than 4 GB? 

[read 1.704]


------------------------------

1.708: How do I fix Volume Group Locked?

>From /usr/lpp/bos/README (AIX 3.2.5) and 1.800.IBM.4FAX #2809

If you get '0516-266 publvodm: volume group rootvg is locked, try again'
or something similar, you can use (putlvodm -K `getlvodm -v <vgname>`)

------------------------------

1.709: How do I remove a volume group with no disks?
From: shieh@austin.ibm.com (Johnny Shieh)

This is a very common question about AIX LVM and I thought
I might take some time to explain what is going on.  Within
a volume group is the Volume Group Descriptor Area (VGDA) is
is kinda a "suitcase" of lvm information.  This is what allows
you to pick up your drives and take them to another machine,
importvg them, and get filesystems automatically defined.

What happens is that when you importvg the volume group,
the RS/6000 goes out and reads the VGDA and finds out about
all the logical volumes and filesystems that may exist on the
volume group.  It then checks for clashes (name conflicts, etc..)
on its own machine and then, here is the important part, populates
its own database with information about the new volume group and
its associated logical volumes.  In cases of filesystems, it will
go into the /etc/filesystems file and add the new filesystem entries
that came along with the imported volume group.

Okay, the key point is that you've got this independent volume group
that has "docked" at the new RS/6000.  What keeps the two tethered
to each other is the varyonvg command.  When this is started on the
volume group, a software link is created where you can't separate the
volume group from the AIX operating system unless the volume group
is no longer seen as active by the system.  In very rare cases, a
situation can occur where the VGDA thinks that someone has it (the
volume group) activated, but the operating system doesn't think it has the
volume group opened up.  This is pretty rare.

The main question I see is "I've taken away the disks, but how do
I get rid of the volume group".  The question should really say,
"How do I get rid of the volume group INFORMATION" since that's
all you have on the system.  You've got possible entries in
the /etc/filesystems and definitely entries in the ODM.  Just 
do:
	exportvg <vgname>

It does a reverse importvg, except it doesn't go off and read
the VGDA.  It nukes anything relating to the volume group in
the /etc/filesystems and ODM.  The only time this won't work is
if the system detects that the volume group is varied on.  Then,
it would be like trying to change tires on a moving car, we won't
let you do it!

Some people are concerned that doing an exportvg will somehow damage
the volume group and/or its VGDA. As I said, all it does is affect the
information about the volume group on the RS/6000 box, not on the actual
disk platter itself.  Thus, the volume group you exported is safe to
take to another system.  The only time the VGDA gets overwritten is when
you create a new volume on top of it.

The second most often asked question is "How do I get rid of a disk
that is no longer really in the volume group?"

In this case, you DON'T want to do an exportvg.  What you want to do
is tell the system you want to cut out the memory of the old, bad disk
from the RS/6000 AND from the VGDA of the volume group.  You simply
do:

		reducevg -d -f <vgname> <hdname>

or if the hdname can't be found:

		reducevg -d -f <vgname> <PVID>

Be careful with this command.  Unlike the exportvg command, actions done
with this command WILL affect the VGDA information on the platter.

Hope this clarifies some questions about volume groups.

------------------------------

1.710:  What are the theoritical limits within the LVM?
From: Gerry FitzGerald <G.FitzGerald@uk22p.bull.co.uk>

  -------------------------------------
  LVM Limits within AIX (my perception)
  -------------------------------------
  
  The system may have 1 to 255 Volumes Groups (VG's).
  Each VG may contain 1 to 32 Physical Volumes (PV's).
  Each PV may contain upto 1016 Physical Partitions (PP's).
  Each PP may have a size (square of 2) from 1 to 256MB (1024MB for AIX 4.3).
  
  Therefore, if you can get hold of a 260,096 MB disk (one PV with 1016 
  x 256MB PPs), you can install 32 of these in a single VG giving you 
  8,323,072MB per VG. You may have up to 255 VG's in one AIX system so 
  you could (in theory) create the maximum addressable AIX storage area 
  of 2,122,383,360 MB (2,072,640 GB or 2,024 TB or approx. 2 PB). This 
  is based on the current limitations of AIX V4.1.
  
  The limits for file and filesystem sizes are:

[Editor's note: the original values in this mail appeared to
 be slightly wrong, I have corrected that to the values as per
 my interpretation of the AIX manual.]
  
  AIX V3.2  Max filesystem size:  2,147,483,647 bytes (2 GB)
  Max single file size:  2,147,483,647 bytes (2 GB)
  
  AIX V4.1  Max filesystem size:  1,099,511,627,776 bytes (1 TB)
  Max single file size:  2,147,483,647 bytes (2 GB)
  
  AIX V4.2  Max filesystem size:  1,099,511,627,776 bytes (1 TB)
  Max single file size:  68,589,453,312 (~64 GB)

  AIX V4.3  Max filesystem size:  1,099,511,627,776 bytes (1 TB)
  Max single file size:  68,589,453,312 (~64 GB)

The 1TB maximum file system size is given by the rule that each
fragment must be addressable by an 28 bit number, with the largest
fragment size being 4096 bytes (4096*2^28).

------------------------------

1.800: How do I control how hostnames are resolved?
From: <kraem@ibm.de> Frank Kraemer

Information from AIX 4.1.2 Infoexplorer:

The default order can be overwritten by creating the configuration file,
/etc/netsvc.conf and specifying the desired order. Both the default and
/etc/netsvc.conf can be overwritten with the environment variable,
NSORDER. If either the /etc/netsvc.conf file or environment variable,
NSORDER are defined, then at least one value must be specified along with
the option.

examples: 
    echo hosts = local,nis,bind >/etc/netsvc.conf
    NSORDER=local,bind; export NSORDER

------------------------------

Subjet: 1.801: dtlogin ignores /etc/profile?
From: Trevor Bourget (trevor@thomsoft.com)

Read the /usr/dt/bin/Xsession script.  You can add a file to the
/etc/dt/config/Xsession.d and it will get sourced as part of the
startup.  The order is: $HOME/.dtprofile, /etc/dt/config/Xsession.d/*,
/usr/dt/config/Xsession.d/* (backwards, in my opinion, but CDE is a
committee result after all).

>From: Ed Ravin <eravin@panix.com>

If you want your terminal session to automatically read in
/etc/profile and your .profile when they start up, you need to either
invoke them with the "-ls" option (which I couldn't figure out how to
do, perhaps someone else can elaborate), or set up the default X
resources so that they set:

*Dtterm*loginShell:     true

You could always do this with the .Xresources file in your own account,
but that wouldn't fix any other users in the system.  To make this change
globally:

CDE configuration files are kept in /usr/dt/config
 
Those files warn you strenuously not to change them, since AIX upgrades
will overwrite them and lose your changes.  They recommend that you copy
the files to /etc/dt/config and change them there, so:

# cd /usr
# find dt/config -print | cpio -pdvum /etc
... (files get copied)
# cd /etc/dt/config/C
# echo "*Dtterm*loginShell:     true" >> sys.resources
# cd ../en_US
# echo "*Dtterm*loginShell:     true" >> sys.resources

From: Olaf Meeuwissen <olaf@IMSL.shinshu-u.ac.jp>

The problem is in /usr/dt/bin/Xsession.  This script only recognizes
the following login shells: sh, ksh and csh (as of $Revision: 1.6 $).
All other shells are considered non-standard.

The fix is to have your sys-admin add any other login shells in the
right places in the script (twice in the "Start the session" part).
Look for "case ${SHELL##*/} in" and add shells in the patterns.

Note that this script will be overwritten unconditionally by system
updates :-( and, unlike much other stuff in /usr/dt/, copying it to
/etc/dt/ does not work.

For which shells to add, you may want to:

   $ grep shells /etc/security/login.cfg

------------------------------

1.802:  Where's the C compiler?

As of AIX 4.1,  the C compiler has been "unbundled."  It's a separate product,
and you must purchase a separate license for it.  IBM does offer free
time limited trial licenses if you want to "try before you buy."

The GNU C compiler is available from various sources.  The most convenient
is probably <http://www-frec.bull.com/>.  <ftp://aixpdslib.seas.ucla.edu/>
is another source.

------------------------------

1.803:  Why doesn't Netscape work?

See question 1.515.

------------------------------

1.900: SCSI-1 and SCSI-2 "interoperability" got you confused?  

A.  SCSI-1 devices are supported on a SCSI-2 adapter.  This
    config will provide SCSI-1 performance.

B.  SCSI-2 devices are supported on a SCSI-1 adapter.  This
    config will provide SCSI-1 performance.

C.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-1
    adapter.  All devices will have SCSI-1 performance.

D.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-2
    adapter.  SCSI-2 devices will have SCSI-2 performance (10 MB/sec)
    and SCSI-1 devices will have SCSI-1 performance (4-5 MB/sec).

------------------------------

1.901: How to get your keyboard back after unplugging it from the 6000
From: Mickey Coggins and Anne Serre and L. Mark Larsen

When you unplug your keyboard from a running system, and plug it back
in, the key mapping is wrong.  For example, keys like Caps Lock and Ctrl
don't work as designed.

Solution: Type at the command line

        /usr/lpp/diagnostics/da/dkbd

Your screen goes black, you hear a few beeps, and your keyboard is reset.
It works with any environment, Xwindows, hft, NLS...

For Models 220, 230 and M20, use the following commands:

/usr/lpp/diagnostics/da/dkbd
/usr/lpp/diagnostics/da/dkbdsal   (for the 220)

After running the keyboard diagnostics to reset keyboard mappings, the
repeat rate is also reset to some slow value (11, according to the man
page).  If the user is in X, you need to open an hft window.  Do this
with "xopen /bin/csh".  Once you have an hft window, run "chhwkbd -r30".

------------------------------

1.902: How do I set up pcsim, the DOS emulator?

[Editor's Note: this product does not exist in AIX 4.x.]

You must have a bootable DOS diskette to install pcsim. Either DOS 3.3, 
4.x, or 5.0 will work. IBM do not officially support DOS 5.0 for pcsim
but I have no problems with it. Just don't try to be fancy with the UMB 
and memory manager stuff.

With a bootable DOS disk in the drive, do:
$touch /u/dosdrive (this is the AIX file for DOS emulation)
$pcsim -Adiskette 3 -Cdrive /u/dosdrive
You would now get an A prompt. Type:
A> fdisk
Create the virtual C drive of whatever size you choose. Make it large 
enough for your needs since you cannot enlarge it later.
A> format c: /s (to format the virtual C drive)
Now exit from pcsim with ESCpcsim (Esc key followed by pcsim).

Now create a simprof file. Following is a starter:

Adiskette   : 3
Cdrive      :/u/dosdrive
lpt1        : name of printer queue
refresh     : 50
dmode       : V
mouse       : com1

You can now start pcsim anytime by typing pcsim. Make sure no floppies
are in the drive. For further information, refer to publication
SC23-2452, Personal Computer Simulator/6000 Guide and Reference.
       
------------------------------

1.903: How do I transfer files between AIX and DOS disks?

In the AIX package bos.dosutils are commands for transferring files between
DOS diskettes and AIX. The commands are dosread, doswrite, dosdir, dosdel,
and dosformat. Many users have mentioned that the mtools package from
prep.ai.mit.edu is better than the native AIX programs.


------------------------------

1.904: Where is the crypt program?

The crypt *program* (as opposed to the crypt subroutine) has been
deleted, probably to conform to U.S. law regarding export of
cryptographic technology.

Other programs such as PGP are available,  but their use and/or
possesion may be subject to local laws and regulations.

If anyone has a better answer to this question,  feel free to
contribute it.

------------------------------

1.905: How do I play audio CDs?
From: woan@austin.ibm.com (Ronald S. Woan)

Get xmcd by anonymous FTP from ftp.x.org in /contrib/applications/xmcd/
<URL:ftp://ftp.x.org/contrib/applications/xmcd/>

------------------------------

1.906: How can I get the mouse back after unplugging it?

/usr/lpp/diagnostics/da/dmousea

------------------------------

1.907: Where can I get source code to the operating
                system binary xxxxx?

AIX source code is not generally available.  Two other UNIX OS' do
make their source available, Linux & freeBSD.  Check
<ftp://ftp.uu.net/systems/unix/bsd-sources/> and
<ftp://ftp.uu.net/systems/unix/linux/>

------------------------------

1.908: What's the difference between the POWER and
                POWERPC architectures?

Read the POWERPC FAQ at
<http://www.mot.com/SPS/PowerPC/library/ppc_faq/ppc_faq.html>

------------------------------

1.909: Will there be date rollover problems in the year 2000?
From: mbrown@austin.ibm.com (Mark Brown)

IBM has a major corporate-wide push for *all* of its software products
to be "safe" in this regard by the end of 1996.

<http://www.software.ibm.com/year2000/paper.html> is the general-purpose
[Year 2000] URL for IBM.

As far as AIX is concerned, we had to fix three things in AIXv4.1.4
(some logging commands handled date ranges wrong) as PTFs, but other
than that, we are there.

...and we handle the leap year issue correcly. also.

------------------------------

1.910: How can I build an "installp format" file?

Jim Abbey <jim@systelecom.com> has a tool called "lppbuild".
It is now available from "aixpdslib.seas.ucla.edu"
in either of

/pub/lppbuild/RISC/3.2/src/lppbuild.1.0.tar.Z
/pub/lppbuild/RISC/4.1/src/lppbuild.1.0.tar.Z

Both are identical and the procedures also work on 4.2.

Ciaran Diegnan <C.Diegnan@frec.bull.fr> has built a tool called
"mklpp".  You can retrieve a copy (along with many other
smit-installable freeware packages) from <http://www-frec.bull.com/>.

------------------------------

1.911: Is there a generic SCSI driver for AIX?
From: Rogan Dawes <rdawes@jhbelec.co.za>

Yes. Matthew Jacob (mjacob@feral.com) has written a generic SCSI driver
for AIX 4.1.  It can be found at <ftp://ftp.feral.com/pub/aix/gsc.tar.gz>.
------------------------------

1.912: Viruses or virus scanning on AIX?
From: mww@microfocus.com (Michael Wojcik)

FWIW, AIX comes with a virus-scanning utility (/usr/bin/virscan),
though IIRC the original version had an empty signature file (in
/usr/lib/security/scan/virsig.lst) and even the later populated
signature file only contains PC viruses.  Quoth the man page, "at
this time [virsig.lst] contains no known AIX virus signatures".
Apparently we are to infer that there *were* no known AIX virus
signatures.

I note that my 4.2.1 AIX system still has the 1991 signature file.

Even a DOS-only virus list could potentially be useful on a Unix
file server, though.  Provided, of course, that it had a recent
signature list (and preferably mutant-detection and similar
heuristics), which virscan probably does not.

And to be fair there are plenty of Unix vulnerabilities, and even
viruses potentially among them.  David Harley, keeper of the
alt.comp.virus FAQ, mentioned some "lab" Unix viruses when this
thread appeared in October '87, and I recall a discussion of using
crypto hashes to validate major system commands on some Unix group
not that long ago - which is essentially virus-scanning technology,
though not necessarily for the same purpose it generally serves
on PCs.

That said, viruses are not the problem for Unix systems that they
are for PCs.  Network security, guessable usernames and passwords,
and the like should generally be a higher priority.

------------------------------

2.00: C/C++

Contrary to many people's belief, the C environment on the RS/6000 is
not very special.  The C compiler has quite a number of options that can
be used to control how it works, which "dialect" of C it compiles, how
it interprets certain language constructs, etc.  InfoExplorer includes a
Users Guide and a Reference Manual.

The compiler can be invoked with either xlc for strict ANSI mode and cc
for RT compatible mode (i.e. IBM 6150 with AIX 2).  The default options
for each mode are set in the /etc/xlc.cfg file, and you can actually add
another stanza and create a link to the /bin/xlc executable.

The file /usr/lpp/xlc/bin/README.xlc has information about the C
compiler, and the file /usr/lpp/bos/bsdport (AIX 3 only) contains useful
information, in particular for users from a BSD background.

The file /etc/xlc.cfg also shows the symbol _IBMR2 that is predefined,
and therefore can be used for #ifdef'ing RS/6000 specific code.

------------------------------

2.01: I cannot make alloca work

A famous routine, in particular in GNU context, is the allocation
routine alloca().  Alloca allocates memory in such a way that it is
automatically free'd when the block is exited.  Most implementations
does this by adjusting the stack pointer.  Since not all C environments
can support it, its use is discouraged, but it is included in the xlc
compiler.  In order to make the compiler aware that you intend to use
alloca, you must put the line

#pragma alloca

before any other statements in the C source module(s) where alloca is
called.  If you don't do this, xlc will not recognize alloca as anything
special, and you will get errors during linking.

For AIX 3.2, it may be easier to use the -ma flag.

------------------------------

2.02: How do I compile my BSD programs?

The file /usr/lpp/bos/bsdport contains information on how to port
programs written for BSD to AIX 3.  This file may be very useful for
others as well.

A quick cc command for most "standard" BSD programs is:
  
  $ cc -D_BSD -D_BSD_INCLUDES  -o [loadfile] [sourcefile.c] -lbsd

If your software has system calls predefined with no prototype
parameters, also use the -D_NO_PROTO flag.

------------------------------

2.03: Isn't the linker different from what I am used to?

Yes.  It is not at all like what you are used to:

- The order of objects and libraries is normally _not_ important.  The
  linker reads _all_ objects including those from libraries into memory
  and does the actual linking in one go.  Even if you need to put a
  library of your own twice on the ld command line on other systems, it
  is not needed on the RS/6000 - doing so will even make your linking slower.

- One of the features of the linker is that it will replace an object in
  an executable with a new version of the same object:

  $ cc -o prog prog1.o prog2.o prog3.o		# make prog
  $ cc -c prog2.c				# recompile prog2.c
  $ cc -o prog.new prog2.o prog			# make prog.new from prog
						# by replacing prog2.o
  
- The standard C library /lib/libc.a is linked shared, which means that
  the actual code is not linked into your program, but is loaded only
  once and linked dynamically during loading of your program.

- The ld program actually calls the binder in /usr/lib/bind, and you can
  give ld special options to get details about the invocation of the
  binder.  These are found on the ld man page or in InfoExplorer.

- If your program normally links using a number of libraries (.a files),
  you can 'prelink' each of these into an object, which will make your
  final linking faster.  E.g. do:

  $ cc -c prog1.c prog2.c prog3.c
  $ ar cv libprog.a prog1.o prog2.o prog3.o
  $ ld -r -o libprog.o libprog.a
  $ cc -o someprog someprog.c libprog.o

This will solve all internal references between prog1.o, prog2.o and
prog3.o and save this in libprog.o Then using libprog.o to link your
program instead of libprog.a will increase linking speed, and even if
someprog.c only uses, say prog1.o and prog2.o, only those two modules
will be in your final program.  This is also due to the fact that the
binder can handle single objects inside one object module as noted above.

If you are using an -lprog option (for libprog.a) above, and still want
to be able to do so, you should name the prelinked object with a
standard library name, e.g. libprogP.a (P identifying a prelinked
object), that can be specified by -lprogP.  You cannot use the archiver
(ar) on such an object.

You should also have a look at section 3.01 of this article, in
particular if you have mixed Fortran/C programs.

Dave Dennerline (d.dennerline@bull.com) claims that his experiences
in prelinking on AIX does not save much time since most people have
separate libraries which do not have many dependencies between them,
thus not many symbols to resolve.

------------------------------

2.04: How do I statically link my program?

  cc -o prog -bnoso -bI:/lib/syscalls.exp obj1.o obj2.o obj3.o

will do that for a program consisting of the three objects obj1.o, etc.

[Editor's note: You should never link programs statically that are
supposed to leave your local environment, e.g. intended for
distribution. Statically linked programs may fail to work after
installing a new AIX version or even after installing a PTF.]

From: Marc Pawliger (marc@sti.com)

As of AIX 3.2.5, you can install a speedup for AIXwindows called
Shared Memory Transport.  To static link an X application after the
SMT PTF has been installed, you must link with
-bI:/usr/lpp/X11/bin/smt.exp and the executable will NOT run on a
machine where SMT is not installed.  See /usr/lpp/X11/README.SMT

2.05: How do I make my own shared library?

To make your own shared object or library of shared objects, you should
know that a shared object cannot have undefined symbols.  Thus, if your
code uses any externals from /lib/libc.a, the latter MUST be linked with
your code to make a shared object.  Mike Heath (mike@pencom.com) said it
is possible to split code into more than one shared object when externals
in one object refer to another one.  You must be very good at
import/export files.  Perhaps he or someone can provide an example. 

Assume you have one file, sub1.c, containing a routine with no external
references, and another one, sub2.c, calling stuff in /lib/libc.a.  You
will also need two export files, sub1.exp, sub2.exp.  Read the example
below together with the examples on the ld man page. 

---- sub1.c ----
    int addint(int a, int b)
    {
      return a + b;
    }
---- sub2.c ----
    #include <stdio.h>

    void printint(int a)
    {
      printf("The integer is: %d\n", a);
    }
---- sub1.exp ----
    #!
    addint
---- sub2.exp ----
    #!
    printint
---- usesub.c ----
    main()
    {
      printint( addint(5,8) );
    }

The following commands will build your libshr.a, and compile/link the
program usesub to use it.  Note that you need the ld option -lc for
sub2shr.o since it calls printf from /lib/libc.a.  [Note that you can leave
out the "-T512 -H512" on AIX 4. -- Ed.]

  $ cc  -c sub1.c
  $ ld -o sub1shr.o sub1.o -bE:sub1.exp -bM:SRE -T512 -H512 
  $ cc  -c sub2.c
  $ ld -o sub2shr.o sub2.o -bE:sub2.exp -bM:SRE -T512 -H512  -lc
  $ ar r libshr.a sub1shr.o sub2shr.o
  $ cc -o usesub usesub.c -L: libshr.a
  $ usesub
  The integer is: 13
  $

------------------------------

2.06: Linking my program fails with strange errors.  Why?

Very simple, the linker (actually called the binder), cannot get the
memory it needs, either because your ulimits are too low or because you
don't have sufficient paging space.  Since the linker is quite different
>from normal Unix linkers and actually does much more than these, it also
uses a lot of virtual memory.  It is not unusual to need 10000 pages (of
4k) or more to execute a fairly complex linking.

If you get 'BUMP error', either ulimits or paging is too low, if you get
'Binder killed by signal 9' your paging is too low.

First, check your memory and data ulimits; in korn shell 'ulimit -a' will
show all limits and 'ulimit -m 99999' and 'ulimit -d 99999' will
increase the maximum memory and data respectively to some high values. 
If this was not your problem, you don't have enough paging space.

If you will or can not increase your paging space, you could try this:

- Do you duplicate libraries on the ld command line? That is never
  necessary.

- Do more users link simultaneously? Try having only one linking going
  on at any time.

- Do a partwise linking, i.e. you link some objects/libraries with the
  -r option to allow the temporary output to have unresolved references,
  then link with the rest of your objects/libraries.  This can be split
  up as much as you want, and will make each step use less virtual memory.

  If you follow this scheme, only adding one object or archive at a
  time, you will actually emulate the behavior of other Unix linkers.

If you decide to add more paging space, you should consider adding a new
paging space on a second hard disk, as opposed to just increasing the
existing one.  Doing the latter could make you run out of free space on
your first harddisk. It is more involved to shrink a paging space
but easier to delete one.

------------------------------

2.07: Why does it take so long to compile "hello world" with xlc?

Some systems have experienced delays of more than 60 seconds in
compiling "#include <stdio.h> int main () {printf ("Hello world");}"
The problem is with the license manager contact IBM to make sure
you've got the latest PTF.

------------------------------

2.08: What's with malloc()?
 
malloc() uses a late allocation algorithm based on 4.3 BSD's malloc()
for speed.  This lets you allocate very large sparse memory spaces,
since the pages are not actually allocated until they are touched for
the first time.  Unfortunately, it doesn't die gracefully in the face of
loss of available memory.  See the "Paging Space Overview" under
InfoExplorer, and see the notes on the linker in this document for an
example of an ungraceful death.

If you want your program to get notified when running out of memory, you
should handle the SIGDANGER signal.  The default is to ignore it. 
SIGDANGER is sent to all processes when paging space gets low, and if
paging space gets even lower, processes with the highest paging space
usage are sent the SIGKILL signal.

malloc() is substantially different in 3.2, allocating memory more
tightly.  If you have problems running re-compiled programs on 3.2,
try running them with MALLOCTYPE=3.1.

Early Page Space Allocation (EPSA) added to AIX 3.2: see
/usr/lpp/bos/README.PSALLOC - IX38211 / U422496 Allows setting of
early allocation (vs. default late allocation) on a per-process basis.

------------------------------

2.09: Why does xlc complain about 'extern char *strcpy()'

The header <string.h> has a strcpy macro that expands strcpy(x,y) to
__strcpy(x,y), and the latter is then used by the compiler to generate
inline code for strcpy.  Because of the macro, your extern declaration
contains an invalid macro expansion.  The real cure is to remove your
extern declaration but adding -U__STR__ to your xlc will also do the
trick, although your program might run a bit more slowly as the compiler
cannot inline the string functions any more.

------------------------------

2.10: Why do I get 'Parameter list cannot contain fewer ....'

This is the same as above (2.9).

------------------------------

2.11: Why does xlc complain about
               '(sometype *)somepointer = something'

Software that is developed using gcc may have this construct. However,
standard C does not permit casts to be lvalues, so you will need to
change the cast and move it to the right side of the assignment. If you
compile with 'cc', removing the cast completely will give you a warning,
'xlc' will give you an error (provided somepointer and something are of
different types - but else, why would the cast be there in the first place?)

------------------------------

2.12: Some more common errors

Here are a few other common errors with xlc:

305 |     switch((((np)->navigation_type) ? (*((np)->navigation_type)) :
      ((void *)0)))
      .a...........  
a - 1506-226: (S) The second and third operands of the conditional
operator must be of the same type.

The reason for this is that xlc defines NULL as (void *)0, and it does
not allow two different types as the second and third operand of ?:. 
The second argument above is not a pointer and the code used NULL
incorrectly as a scalar. NULL is a nil pointer constant in ANSI C and
in some traditional compilers.

You should change NULL in the third argument above to an integer 0.


------------------------------

2.13: Can the compiler generate assembler code?

Starting with version 1.3 of xlc and xlf the -S option will generate a
.s assembly code file prior to optimization. The option -qlist will
generate a human readable one in a .lst file.

There is also a disassembler in /usr/lpp/xlc/bin/dis include with the
1.3 version of xlc (and in /usr/lpp/xlC/bin/dis with the 2.1 version
of xlC) that will disassemble existing object or executable files.

------------------------------

2.14: Curses

Curses based applications should be linked with -lcurses and _not_ with
-ltermlib. It has also been reported that some problems with curses are
avoided if your application is compiled with -DNLS.

Peter Jeffe <peter@ski.austin.ibm.com> also notes:

>the escape sequences for cursor and function keys are *sometimes*
>treated as several characters: eg. the getch() - call does not return
>KEY_UP but 'ESC [ C.'

You're correct in your analysis: this has to do with the timing of the
escape sequence as it arrives from the net. There is an environment
variable called ESCDELAY that can change the fudge factor used to decide
when an escape is just an escape. The default value is 500; boosting
this a bit should solve your problems.

Christopher Carlyle O'Callaghan <asdfjkl@wam.umd.edu> has more comments
concerning extended curses:

1) The sample program in User Interface Programming Concepts, page 7-13
   is WRONG. Here is the correct use of panes and panels.

#include <cur01.h>
#include <cur05.h>

main()
{
PANE *A, *B, *C, *D, *E, *F, *G, *H;
PANEL *P;

initscr();

A = ecbpns (24, 79, NULL, NULL, 0, 2500, Pdivszp, Pbordry, NULL, NULL);
D = ecbpns (24, 79, NULL, NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
E = ecbpns (24, 79, D,    NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
B = ecbpns (24, 79, A, D, Pdivtyh, 3000, Pdivszp, Pbordry, NULL, NULL);
F = ecbpns (24, 79, NULL, NULL, 0, 0,    Pdivszf, Pbordry, NULL, NULL);
G = ecbpns (24, 79, F,    NULL, 0, 5000, Pdivszp, Pbordry, NULL, NULL);
H = ecbpns (24, 79, G,    NULL, 0, 3000, Pdivszp, Pbordry, NULL, NULL);
C = ecbpns (24, 79, B, F, Pdivtyh, 0, Pdivszf, Pbordry, NULL, NULL);
P = ecbpls (24, 79, 0, 0, "MAIN PANEL", Pdivtyv, Pbordry, A);

ecdvpl (P);
ecdfpl (P, FALSE);
ecshpl (P); 
ecrfpl (P);
endwin();
}

2) DO NOT include <curses.h> and any other <cur0x.h> file together.
   You will get a bunch of redefined statements.

3) There is CURSES and EXTENDED CURSES. Use only one or the other. If the
   manual says that they're backwards compatible or some other indication 
   that you can use CURSES routines with EXTENDED, don't believe it. To 
   use CURSES you need to include <curses.h> and you can't (see above).

4) If you use -lcur and -lcurses in the same link command, you will get
   Memory fault (core dump) error. You CANNOT use both of them at the same
   time. -lcur is for extended curses, -lcurses is for regular curses.

5) When creating PANEs, when you supply a value (other than 0) for the
   'ds' parameter and use Pdivszf value for the 'du' parameter, the 'ds'
   will be ignored (the sample program on page 7-13 in User Interface
   Programming Concepts is wrong.) For reasons as yet undetermined,
   Pdivszc doesn't seem to work (or at least I can't figure out how to
   use it.)

6) If you're running into bugs and can't figure out what is happening,
   try the following:
   include -qextchk -g in your compile line
	-qextchk will check to make sure you're passing the right number of
  	 parameters to the functions
	-g enables debug

7) Do not use 80 as the number of columns if you want to use the whole
   screen. The lower right corner will get erased.  Use 79 instead.

8) If you create a panel, you must create at least 1 pane, otherwise you
   will get a Memory fault (core dump).

9) When creating a panel, if you don't have a border around it, any title
   you want will not show up.

10) to make the screen scroll down:
    wmove (win, 0, 0);
    winsertln (win)

11) delwin(win) doesn't work in EXTENDED WINDOWS

    To make it appear as if a window is deleted, you need to do the following:
    for every window that you want to appear on the screen
	touchwin(win)
	wrefresh(win)

    you must make sure that you do it in the exact same order as you put
    them on the screen (i.e., if you called newwin with A, then C, then B,
    then you must do the loop with A, then C, then B, otherwise you won't
    get the same screen back).  The best thing to do is to put them into
    an array and keep track of the last window index.

12) mvwin(win, line, col) implies that it is only used for viewports and
    subwindows. It can also be used for the actual windows themselves.

13) If you specify the attribute of a window using wcolorout(win), any
    subsequent calls to chgat(numchars, mode) or any of its relatives
    will not work. (or at least they get very picky.)

------------------------------

2.15: How do I speed up linking

Please refer to sections 2.03 and 2.06 above.

From: losecco@undpdk.hep.nd.edu (John LoSecco) and
      hook@chaco.aix.dfw.ibm.com (Gary R. Hook)

From oahu.cern.ch in /pub/aix3 you can get a wrapper for the existing
linker called tld which can reduce link times with large libraries by
factors of 3 to 4.

------------------------------

2.16: What is deadbeef?

When running the debugger (dbx), you may have wondered what the
'deadbeef' is you occasionally see in registers.  Do note, that
0xdeadbeef is a hexadecimal number that also happens to be some kind
of word (the RS/6000 was built in Texas!), and this hexadecimal number
is simply put into unused registers at some time, probably during
program startup.


------------------------------

2.17: How do I make an export list from a library archive?
From: d.dennerline@bull.com (Dave Dennerline)

[ This script has been moved to section 8.10 ]

------------------------------

2.19: Building imake, makedepend
From: crow@austin.ibm.com (David L. Crow)

[Editor's note: if you have AIX 4.x,  you need the X11.adt.imake LPP
and probably most if not all of the X11.adt.* LPPs.  Imake, xmkmf and
other utilities are delivered precompiled.]

    You need X11dev.src release 1.2.3.0 (ie the R5 release) [on AIX 3.2].


     Unless you have an R5 release of AIXwindows, there is no xmkmf.
  These are the steps that I use to make imake, makedepend and all
  of it's config files, and then install them in the working tree
  (ie not the Xamples) for daily use:
  
      cd /usr/lpp/X11/Xamples
      make Makefile
      make SUBDIRS="config util" Makefiles
      make SUBDIRS="config util" linklibs
      make SUBDIRS="config util" depend
      make SUBDIRS="config util" 
      make SUBDIRS="config util" install
      
  Then redo the steps everytime you apply an X11 update.

------------------------------

2.20: How can tell what shared libraries a binary is linked with?

Use "dump -H <execfilename>" and see if anything other than /unix is
listed in the loader section (at the bottom).  The first example is
/bin/sh (statically linked) and the second example is
/usr/local/bin/bash (shared).

INDEX  PATH                          BASE                MEMBER              
0      /usr/lib:/lib                                                         
1      /                             unix                                    

INDEX  PATH                          BASE                MEMBER              
0      ./lib/readline/:./lib/glob/:/usr/lib:/lib               
1                                    libc.a              shr.o               
2                                    libcurses.a         shr.o               

The freeware tool "ldd" lists all the shared libraries needed
by an executable, including those recursively included by other
shared libraries. See question 2.27 "Where can I find ldd for AIX?".

------------------------------

2.21: Can I get a PTF for my C/C++ compiler from the net?

<http://service.software.ibm.com/>  contains pointers to most PTFs, including
compilers.  You'll need the fixdist program (see 1.142) to retrieve them.

------------------------------

2.22: Why does "install"ing software I got from the net fail?

Note that the RS/6000 has two install programs, one with System V flavor
in the default PATH (/etc/install with links from /usr/bin and /usr/usg),
and one with BSD behavior in /usr/ucb/install.

------------------------------

2.23: What is Linker TOC overflow error 12?

There is a hard coded limit in the AIX 3.2.5 linker that is fixed in
AIX 4.1.  A kind soul donated the following information to help people
get the 3.2.5 fix

    The LPS (paperwork) 
      AIX TOC Data Binder/6000 #P91128
      Version 1.1
      Program Number 5799-QDY
      Reference No. GC23-2604-00, FC 5615
    Pre Reqs listed were AIX 3.2.5
      IBM C Set++ V2 (5765-186)

The above is not available any longer, see section 1.006.

You could also put some of the application code into shared libraries
or, in the case of gcc, use -mminimal-toc.

------------------------------

2.24: What is the limit on number of shared memory segments
               I can attach?

Each process has 16 segments.  One is used for private code, one for
stack, one for heap; those, if memory serves, are segments 0, 1, and
2.  (If you look in sys/shm.h, you'll see that SHMLOSEG is 3 -- the
lowest segment, in number and in the process' virtual address space,
available to shmat.)

SHMHISEG, the highest segment you can attach to (also defined in
sys/shm.h), is 12.  Segments 3 through 12 are available to shmat,
giving the 10 segments your program used successfully.  (NSHMSEGS in
sys/shm.h will give you this value, though it's of limited use, since
most platforms that I've seen don't define it.)

Segment 13 is used by shared code your program has attached to;
I think one of the others might be for kernel-mode data.

See also mmap.

------------------------------

2.25: I deleted libc.a by accident --- how do I recover?
From: Ed Ravin <eravin@panix.com>

You can recover from this without rebooting or reinstalling, if you
have another copy of libc.a available that is also named "libc.a".  If
you moved libc.a to a different directory, you're in luck -- do the
following:

export LIBPATH=/other/directory


And your future commands will work.  But if you renamed libc.a, this
won't do it.  If you have an NFS mounted directory somewhere, you can
put libc.a on the that host, and point LIBPATH to that directory as
shown above.

Failing that, turn off your machine, reboot off floppies or other
media, and get a root shell.  I don't think you should do "getrootfs"
as you usually do when accessing the root vg this way -- AIX may start
looking for libc.a on the disk, and you'll just run into the same
problem.  So do an importvg, varyonvg, and then mount /usr somewhere,
then manually move libc.a back or copy in a new one from floppy.

------------------------------

2.26: Where can I find dlopen, dlclose, and dlsym for AIX?

An implementation of these dynamic code loading functions was written by
Jens-Uwe Mager <jum@anubis.han.de> and can be found at
<http://www.han.de/~jum/aix/dlfcn.shar>

From: Gary R. Hook <hook@austin.ibm.com>

Starting with AIX 4.2 a dlopen et. al. are included in the base OS in
the libdl.a library. Under AIX 4.1 this is available as SLHS (Shared
Library Hookable Symbols) as APAR IX IX71849 for the runtime package and
APAR IX IX72973 for the development tools.

------------------------------

2.27: Where can I find ldd for AIX?
From: Jens-Uwe Mager <jum@anubis.han.de>

Try <http://www.han.de/~jum/aix/ldd.c>. Also the "aix.tools"
package from <http://www-frec.bull.com>

------------------------------

2.28:  How do I make my program binary executable on the
                POWER, POWER2, and POWERPC architecures?

AIX will emulate those instructions not available in POWERPC processors, but
you can avoid this emulation and consequent performance degradtation by
using only the common to all.

If you are using IBM's xlc (cc) compiler, the default is to use the common
instruction set.  If you want to be explicit, use the -qarch=com option.

The option -mcpu=common makes GCC use the common instruction set.  Please
note that (unlike xlc) this is *not* the default with GCC on AIX.

------------------------------

2.29: How do I access more than 256 Megabytes of memory?

By default each program gets one segment register (see 2.24) for its
data segment. As each segment register covers 256 MB, any calls to
malloc more will fail. Also programs that declare large global or static
arrays may fail to load. To allocate more segment registers to your
program, use the linker option -bmaxdata to specify the number of bytes
you need in the data segment as follows:

cc -o myprog -bmaxdata:0x20000000 myprog.c

The example above would allocate an additional segment register to allow
for 512MB of data.

------------------------------

2.30: How do I use POSIX threads with gcc 2.7.x?
From: David Edelsohn <dje@watson.ibm.com>

The code generated by GCC is compatible with threads, but gcc-2.7 
was released so long ago that it did not provide an option to perform
the extra link steps necessary to support threads:

1) Compile all source files with "-D_THREAD_SAFE" macro defined.
2) Link with "-L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a"
   to obtain the pthreads support 
   and add "-nostartfiles /usr/lib/crt0_r.o" to the beginning of the
   link command line (using gcc to link!) to initialize threads.

------------------------------

2.31: Why does pthread_create return the error code 22?

Using Posix threads under AIX requires a special C runtime startup
initialization as well as special versions of some libraries. The IBM C
compiler includes these special libraries if called by the name xlc_r
(or xlC_r for C++). There also other maing variations to support various
defaults, consult the file /etc/xlC.cf for details.

------------------------------

2.32: How do I build programs under a later AIX release that run
	under earlier releases as well?

IBM develops AIX only for binary compatibility with older AIX releases,
not the other way around. You will thus need to build programs on the
oldest AIX release the program is supposed to run on. You will also need
to link programs dynamically, if you link in the system libraries
statically the program will probably only run on the machine you
performed the link on.

With some preparation it is appearently possible to get around that
limitation. Bob Halblutzel has put together a web page describing the
detailed steps how to set up such a build environment at the following
web page:

<http://www.hablutzel.com/aix_compatibility_build.html>

Please not that this is not a supported way to build your programs, you
will probably receive not any support by IBM if you have problems with
that environment.

------------------------------

3.00: Fortran and other compilers

This section covers all compilers other than C/C++.  On Fortran, there
seem to have been some problems with floating point handling, in
particular floating exceptions.

------------------------------

3.01: I have problems mixing Fortran and C code, why?

A few routines (such as getenv, signal, and system) exist in both the
Fortran and C libraries but with different parameters. In the recent
past, if you have a mixed program that calls getenv from both C and
Fortran code, you have to link them carefully by specifying the correct
library first on your command line. This is no longer needed starting
with version 1.5 of the compilers.


------------------------------

3.02: How do I statically bind Fortran libraries and dynamically
               bind C libraries?
From: amaranth@vela.acs.oakland.edu (Paul Amaranth)

[ Editor's note: Part of this is also discussed above under the C compiler
  section, but I felt it was so valuable that I have left it all in. 
  I've done some minor editing, mostly typographical. ]

The linker and binder are rather versatile programs, but it is not
always clear how to make them do what you want them to.  In particular,
there are times when you do not want to use shared libraries, but
rather, staticly bind the required routines into your object.  Or, you
may need to use two versions of the same routine (eg, Fortran & C).  Here
are the results of my recent experiments.  I would like to thank Daniel
Premer and Brad Hollowbush, my SE, for hints.  Any mistakes or omissions
are my own and I have tended to interchange the terms "linker" and
"binder".  These experiments were performed on AIX 3.1.2.  Most of this
should be applicable to later upgrades of 3.1.

1)  I have some C programs, I want to bind in the runtime routines.  How
    do I do this? [Mentioned in section 2.04 of this article as well, ed.]

    You can put the -bnso binder command on the link line.  You should
    also include the -bI:/lib/syscalls.exp control argument:
      
      $ cc *.o -bnso -bI:/lib/syscalls.exp -o foo

    This will magically do everything you need.  Note that this will bind
    _all_ required routines in.  The -bI argument tells the linker that
    these entry points will be resolved dynamically at runtime (these are
    system calls).  If you omit this you will get lots of unresolved 
    reference messages.

2)  I want to statically bind in the Fortran runtime so a) my customers 
    do not need to buy it and b) I don't have to worry about the runtime
    changing on a new release.  Can I use the two binder arguments in
    1) to do this?

    You should be able to do so, but, at least under 3002, if you do
    you will get a linker error referencing getenv.  In addition, there
    are a number of potential conflicts between Fortran and C routines.
    The easy way just does not work.  See the section on
    2 stage linking for C and Fortran on how to do this.  The getenv
    problem is a mess, see the section on Comments & Caveats for more.

    From: Gary R. Hook <hook@austin.ibm.com>

    The xlf runtime is a no-charge feature, you can download and install
    it without having to buy it. This change was made >2 years ago.

3)  I have a mixture of C and Fortran routines, how can I make sure
    that the C routines reference the C getenv, while the Fortran routines
    reference the Fortran getenv (which has different parameters and, if
    called mistakenly by a C routine results in a segmentation fault)?

    From Mike Heath (mike@pencom.com):

    Use -brename:symbol1,symbol2 when pre-linking the modules from one
    of the languages. It does not matter which one you choose.

4)  I have C and Fortran routines.  I want to bind in the xlf library, while
    letting the rest of the libraries be shared.  How do I do this?

    You need to do a 2 stage link.  In the first stage, you bind in the
    xlf library routines, creating an intermediate object file.  The
    second stage resolves the remaining references to the shared libraries.

    This is a general technique that allows you to bind in specific system
    routines, while still referencing the standard shared libraries.

    Specifically, use this command to bind the xlf libraries to the Fortran
    objects:

       $ ld -bh:4 -T512 -H512 <your objects> -o intermediat.o \
         -bnso -bI:/lib/syscalls.exp -berok -lxlf -bexport:/usr/lib/libg.exp \
         -lg -bexport:<your export file>

    The argument -bexport:<your export file> specifies a file with the
    name of all entry points that are to be visible outside the intermediate 
    module.  Put one entrypoint name on a line.  The -bI:/lib/libg.exp line 
    is required for proper functioning of the program.  The -berok argument 
    tells the binder that it is ok to have unresolved references, at least 
    at this time (you would think -r would work here, but it doesn't seem to).  
    The -bnso argument causes the required modules to be imported
    into the object.  The -lxlf, of course, is the xlf library.

    Then, bind the intermediate object with the other shared libraries in
    the normal fashion:

       $ ld -bh:4 -T512 -H512 <C or other modules> intermediate.o \
         /lib/crt0.o -lm -lc

    Note the absence of -berok.  After this link, all references should
    be resolved (unless you're doing a multistage link and making another
    intermediate).

    NOTE THE ORDER OF MODULES.  This is extremely important if, for example,
    you had a subroutine named "load" in your Fortran stuff.  Putting the
    C libraries before the intermediate module would make the C "load"
    the operable definition, rather than the Fortran version EVEN THOUGH 
    THE FORTRAN MODULE HAS ALREADY BEEN THROUGH A LINK AND ALL REFERENCES 
    TO THE SYMBOL ARE CONTAINED IN THE FORTRAN MODULE.  This can
    be extremely difficult to find (trust me on this one :-)  Is this
    a bug, a feature, or what?
    
    [As mentioned in section 2.03 of this article, it is a feature that you
    can replace individual objects in linked files, ed.]

    The result will be a slightly larger object than normal.  (I say slightly
    because mine went up 5%, but then it's a 2 MB object :-)


Comments & Caveats:

   From the documentation the -r argument to the linker should do what
   -berok does.  It does not.  Very strange results come from using the
   -r argument.  I have not been able to make -r work in a sensible manner
   (even for intermediate links which is what it is supposed to be for).

       Note from Mike Heath (mike@pencom.com):

       'ld -r' is essentially shorthand for 'ld -berok -bnogc -bnoglink'.
       Certainly, using -berok with an export file (so garbage collection
       can be done) is preferable to ld -r, but the latter is easier.

   When binding an intermediate module, use an export file to define the
   entry points you want visible in the later link.  If you don't do this,
   you'll get the dreaded "unresolved reference" error.  Import files name
   entry points that will be dynamically resolved (and possibly where).

   If you are in doubt about what parameters or libraries to link, use the
   -v arg when linking and modify the exec call that shows up into 
   an ld command.  Some thought about the libraries will usually yield an
   idea of when to use what.  If you don't know what an argument is for,
   leave it in.  It's there for a purpose (even if you don't understand it).

   Watch the order of external definitions (ie, libraries) when more than
   one version of a routine may show up, eg "load".  The first one defined
   on the ld command line is the winner.  

   The getenv (and system and signal) problem is a problem that started out
   minor, got somewhat worse in 3003 and, eventually will be correctly fixed.
   Basically, you should extract the 3002 version of these three routines
   from xlf.a before doing the update and save them away, then link these
   routines in if you use these Fortran system services.  


------------------------------

3.03: How do I check if a number is NaN?
From: sdl@glasnost.austin.ibm.com (Stephen Linam)

NaN is "Not a Number".  It arises because the RISC System/6000 uses
IEEE floating point arithmetic.

To determine if a variable is a NaN you can make use of the property
that a NaN does not compare equal to anything, including itself.
Thus, for real variable X, use

	IF (X .NE. X) THEN	! this will be true if X is NaN

Floating point operations which cause exceptions (such as an overflow)
cause status bits to be set in the Floating Point Status and Control
Register (FPSCR).  There is a Fortran interface to query the FPSCR, and
it is described in the XLF Fortran manuals -- I don't have the manuals
right here, but look for FPGETS and FPSETS.

The IBM manual "Risc System/6000 Hardware Technical Reference - General
Information" (SA23-2643) describes what floating point exceptions can
occur and which bits are set in the FPSCR as a result of those exceptions.


------------------------------

3.04: Some info sources on IEEE floating point.

1. ANSI/IEEE STD 754-1985 (IEEE Standard for Binary Floating-Point
   Arithmetic) and ANSI/IEEE STD 854-1987 (IEEE Standard for
   Radix-Independent Floating-Point Arithmetic), both available from IEEE. 

2. David Goldberg, "What Every Computer Scientist Should Know About
   Floating-Point Arithmetic", ACM Computing Surveys, Vol. 23, No. 1,
   March 1991, pp. 5-48.

------------------------------

3.05: Why does it take so long to compile "hello world" with xlf? 

[read 2.07]

------------------------------

4.00: GNU and Public Domain software

GNU software comes from the Free Software Foundation and various other
sources. A number of ftp sites archive them. Read the GNU license for 
rules on distributing their software.

Lots of useful public domain software have been and continue to be ported
to the RS/6000. See below for ftp or download information.

------------------------------

4.01: How do I find sources?
From: jik@GZA.COM (Jonathan Kamens)

There is a newsgroup devoted to posting about how to get a certain
source, comp.sources.wanted.  An archive of information about sources,
including FTP sites is available from

------------------------------

4.02: Are there any ftp or WWW sites?

SMIT-installable precompiled packages of popular freeware for AIX 4.x at
<http://www-frec.bull.com/>.  Download the ".exe" files with your WWW
browser. These are auto-uncompressing files, just like on PCs (it uses
similar technology to PKZIP). Mark the file as executable (chmod +x),
then execute it to generate a .bff file. The .bff file can then be
installed using "smit install_latest". For more information
read the INSTALL.txt file on the server.

There are mirrors of this site at http://www.bull.de/ and
http://ftp.univie.ac.at/aix/.

The package explicitly referenced below are ones Ciaran consideres
"solid."  That is, the binary has been "tested by lots of people."

Bull provides many other freeware packages as well.  If you use the
service,  be sure and thank Ciaran and Bull.

Below are some ftp sites that are supposed to have RS/6000 specific
software.  I haven't verified all the entries.

US sites:
<ftp://aixpdslib.seas.ucla.edu/pub/>		128.97.2.211
<ftp://aix.boulder.ibm.com/>
<ftp://software.watson.ibm.com/>

European sites:
<ftp://nic.funet.fi/pub/unix/AIX/RS6000/>		128.214.6.100
<ftp://iacrs1.unibe.ch/pub/>			130.92.11.3
<ftp://ftp.zrz.TU-Berlin.DE/pub/aix/>		130.149.4.50
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>	129.104.3.60
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>		129.69.8.13

The first one is dedicated to software running on AIX.  It might not
always be the latest versions of the software, but it has been ported
to AIX (normally AIX version 3 only).  Please use the European sites
very sparingly.  They are primarily to serve people in Europe and most
of the software can be found in the US sites originally.

The remaining sites are simply ones that archie indicated contained
AIX related materials.

<ftp://ibminet.awdpa.ibm.com/>	#IBM announcements, oem hardware
<ftp://cac.toronto.ibm.com/>	#marketing-info
<ftp://ftp.egr.duke.edu/>
<ftp://straylight.acs.ncsu.edu/>
<ftp://alpha.gnu.ai.mit.edu/rs6000>
<ftp://ftp.uni-stuttgart.de/sw/rs_aix32/>
<ftp://iacrs2.unibe.ch/pub/aix/>
<ftp://ftp.u.washington.edu/pub/RS6000/>
<ftp://aixive.unb.ca/>
<ftp://ftp.ans.net/pub/misc/>
<ftp://uvaarpa.virginia.edu/pub/misc/>
<ftp://ux1.cts.eiu.edu/pub/rs6000/>
<ftp://ftp.bsc.nopub/Src/>
<ftp://ftp-aix.polytechnique.fr/pub/binaries/rios/>
<ftp://aix1.segi