Tuesday, October 22, 2013

AIX Frequently Asked Questions (Part 1 of 4)


Frequently Asked Questions about AIX and the IBM RS/6000 Section 1
__________________________________________________________________

This posting contains frequently asked questions and answers about the
IBM RS/6000 series workstations and AIX version 3. 
This article covers only AIX 3.x and the RS/6000, except when noted.

If you suspect you have software defect problems
call (800) 237-5511. If you have hardware problems call (800) IBM-SERV.
______________________________________________________________________________

Table of contents:

1.0    General concepts
1.000  The AIX operating system - what is it?
1.001  I know neither Unix nor AIX - where do I find more information?
1.002  What is the Object Database?
1.003  How do I get rid of the verbose error messages?
1.004  Which release of AIX do I have?
1.005* What hardware do I have?  What is availible?  WITS?

1.1    SMIT, system administration
1.100  I am used to Unix systems programming, why should I learn SMIT?
1.101  How do I turn off the "running man" in smit?
1.102  How do I import an /etc/passwd or /etc/group file from another box?
1.103  Cleaning up utmp, who, and accounting problems
1.104  How to fsck the root filesystem
1.105  How can I unmount /usr to run fsck on it?
1.108  How do I see/change parameters like number of processes per user?
1.109  How do I shrink the default paging space on hd6?
1.110  The swapper seems to use enormous amounts of paging space, why?
1.111  How much paging space do I need?
1.112  How do I mount a floppy disk as a filesystem?
1.113  How do I remove a committed lpp?
1.114  How can I recover space after installing updates?
1.115  Where are the AIX log files kept?
1.116  How can I log information about ftp accesses to a file?
1.117  How do I find a file name from the inode number?
1.118  How do I set up postscript accounting?
1.119  How do I create boot diskettes for 3.2?
1.120  Where can I find tools for performance monitoring?
1.121  How can I tell what virtual printer a print queue is using?
1.122  Two srcmstr's are less useful than one?
1.123  How do I set the tty name associated with a physical port?
1.124  How do I use mksysb to clone a system?
1.125  How do I retain timestamps with mksysb?
1.126  How can I find out the machine type?
1.127  Updating to 3.2.5
1.128  AIX fix strategy
1.129  Are passwords limited to 8 char?
1.130  How do I increase the number of ptys > 64?
1.131  CERT advisories on sendmail and xterm
1.132  How do I remove a non-existant physical volume?
1.133  How do I kill a process that ignores kill -QUIT -KILL -STOP?
1.134  How can I see "console" messages?
1.135  Where can I find TOP for AIX?
1.136  How can I restrict root logins to specific terminals?
1.137  How do I merge my /etc/password and /etc/security/password for Crack
1.138  I lost the root password, what should I do?
1.139  How can I resolve DEV_WAIT status for a local print queue?
1.140  SMIT problems forcing/overwriting install?
1.141  Which distribution tape do I have?
1.142  How can I get PTF (fixes) via ftp?  What is fixdist?

Section 2

1.2    Backups, tape
1.200  Some info about tape backups
1.201  How do I do remote backup?
1.202  How do I backup a multi-disk volume group?
1.203  How do I put multiple backups on a single 8mm tape?
1.204  How can I make an exact duplicate of a tape over the network?
1.205  What is tape block size of 0?
1.206  Resetting a hung tape drive...
1.207  How do I read a mksysb tape with tar?
1.208  How do I read a 5Gbyte tape on a 2Gbyte drive?
1.209  What can Sysback do for me?
1.210  How can I get my HP 4mm DAT to work?

1.3    Memory and process management
1.300  Some info about the memory management system
1.301  How much should I trust the ps memory reports?
1.302  Which simms do RS6000's use?
1.303  What is kproc?

1.4    Shells, commands, man pages, InfoExplorer
1.400  How do I make an informative prompt in the shell?
1.401  How do I set up ksh for emacs mode command line editing?
1.402  Listing files with ls causes a core dump
1.403  How do I put my own text into InfoExplorer?
1.404  InfoExplorer ASCII key bindings 
1.405  How can I add new man pages to the system?
1.406  Why can't I read man pages?  Where is nroff?
1.407  Why is my enviornment only loaded once?
1.408  Where is the 'nawk' command on my AIX system?
1.409  How do I copy InfoExplorer (manpages and more) to my hard drive?
1.410  Why can't I set my default shell to one we've just installed?
1.411  Why do I get the "Unable to connect socket: 3" starting Info-Explorer?

Section 3

1.5    Video, Graphics, X11
1.500  Which release of X11 do I have?
1.501  How to prevent ctrl-alt-backspace from killing the X session
1.502  Who has a termcap/terminfo source for aixterm or the HFT console?
1.503  How can I look at PostScript files?  Why is "dpsexec" so lousy?
1.504  unix:0 vs `hostname`:0
1.505  VT100 key bindings for aixterm
1.506  Is there a screen saver that does not use excessive CPU?
1.507  Where are the colors, availible for an X session, listed.
1.508  Why does my app hang the X server but not an X station?
1.509  How do I switch the control and caps lock key bindings?
1.510  Missing fonts?
1.511  What's the termcap entry for an IBM 3151 look like?
1.512  Errors starting X11 application binaries from aixpdslib.
1.513* .XShm*, .sm* (Shared memory) Link errors building Xwindows applications.
1.514  How do I set my DISPLAY when I login to another machine?
1.515  Why doesn't Netscape work?
 
1.6    Networks and communications
1.600  My named dies frequently, why?
1.601  How do I trace ethernet packets on an AIX system?
1.602  What is the authorized way of starting automount at boot time?
1.603  How do I set a tty port for both dial-in and dial-out?
1.604  How to move or copy whole directory trees across a network
1.605  How can I send mail to hosts that cannot be pinged?
1.606  How to configure dialup SLIP
1.607  Where is DCE discussed?
1.608  How do I make /var/spool/mail mountable?
1.609  getty spawning too rapidly
1.610  Does AIX support Compressed SLIP (CSLIP)?
1.611  How do I setup anonymous ftp on my AIX system?
1.612  Talk, getting notification.
1.613  Disabling software flow control; using RTS/CTS.
1.614  NIS security
1.615  Why can't non-anonymous users login using WU-FTP?
1.616  NIS users can't login, do I need '*' in /etc/passwd?
1.617  HP JetDirect cards and virtual printers?  mkvirprt problems?
1.618  How can I hack libc.a to alter how hostnames are resolved?
1.619  What modem settings do I need?
1.620+ NIS slave server config with master on different subnet?

1.7    LVM
1.701  How do I shrink /usr?  (formerly 1.106)
1.702  How do I make a filesystem larger than 2Gb? (formerly 1.107)
1.703  Chlv warning, is the first 4k of a LV safe? (formerly 1.139)
1.704  What's the limit on Physical Partitions Per Volume Group?
1.705  Why am I having trouble adding another disk to my VG?
1.706  What are the limits on a file, filesystem?
1.707  Hints for Segate 9 GB and other disks larger than 4 GB? (see 1.704)
1.708+ How do I fix Volume Group Locked?

1.8    AIX 4.1
1.800  How do I control how hostnames are resolved?

1.9    Miscellaneous
1.900  SCSI-1 and SCSI-2 "interoperability" got you confused?
1.901  How to get your keyboard back after unplugging it from the 6000
1.902  How do I set up pcsim, the DOS emulator?
1.903  How do I transfer files between AIX and DOS disks?
1.904  Where is the crypt program?
1.905  How do I play audio CDs?
1.906  How can I get the mouse back after unplugging it?
1.907+ Where can I get source code to the operating system binary xxxxx?

2.00  C/C++
2.01  I cannot make alloca work
2.02  How do I compile my BSD programs?
2.03  Isn't the linker different from what I am used to?
2.04  How do I statically link my program?
2.05  How do I make my own shared library?
2.06  Linking my program fails with strange error, why?

Section 4

2.07  Why does it take so long to compile "hello world" with xlc?
2.08  What's with malloc()?
2.09  Why does xlc complain about 'extern char *strcpy()'
2.10  Why do I get 'Parameter list cannot contain fewer ....'
2.11  Why does xlc complain about '(sometype *)somepointer = something'
2.12  Some more common errors
2.13  Can the compiler generate assembler code?
2.14  Curses
2.15  How do I speed up linking?
2.16  What is deadbeef?
2.17  [moved to 2.04]
2.18  How do I make an export list from a library archive?
2.19  imake, makedepend 
2.20  How can tell what shared libraries a binary is linked with?
2.21  Can I get a PTF for my C/C++ compiler from the net?
2.22  Why does "install"ing software I got from the net fail?

3.00  Fortran and other compilers
3.01  I have problems mixing Fortran and C code, why?
3.02  How do I statically bind Fortran libraries and dynamically bind
      C libraries?
3.03  How do I check if a number is NaN?
3.04  Some info sources on IEEE floating point
3.05  Why does it take so long to compile "hello world" with xlf? (see 2.07).

4.00  GNU and Public Domain software
4.01  How do I find PD software?
4.02  Are there any ftp sites?
4.03  General hints
4.04  GNU Emacs
4.05  gcc/gdb
4.06  GNU Ghostscript
4.07  TeX - Document processing
4.08  Perl - Scripting language
4.09  X-Windows
4.10  Bash - /bin/ksh alternative from FSF
4.11  Elm - Mail reader
4.12  Oberon 2.2
4.13  Kermit - Communications 
4.14  Gnu dbm
4.15  tcsh - /bin/ksh alternative
4.16  Kyoto Common Lisp
4.17  Tcl/Tk - X-Windows scripting
4.18  Expect
4.19  Public domain software on CD
4.20  Andrew Toolkit
4.21  sudo
4.22  Flexfax/HylaFax and other fax software
4.23  lsof - LiSt Open Files
4.24  popper - POP3 mail daemon
4.26  mpeg link errors version 2.0
4.27  NNTP, INN - news (usenet) news transport protocol, news server software
4.28* Zmodem - File transfer
4.29  Patch - automated file updates
4.30  XNTP - network time protocol, synchronizes clocks

5.00  Third party products
5.02  Disk/Tape/SCSI
5.03  Memory
5.04  Others
5.05  C++ compilers
5.06* Memory leak detectors
5.07* PPP
5.08  Graphics adapters.
5.09  Training Courses

6.00  Miscellaneous other stuff
6.01* Can I get support by e-mail?
6.02  List of useful faxes
6.03  IBM's ftp, gopher and WWW presence
6.04  Some RS232 hints
6.05  What publications are available for AIX and RS/6000?
6.06  Some acronyms
6.07  How do I get this by mailserver or ftp?
6.08  Hypertext version of the FAQ
6.09  Where can I send suggestions for tools?
6.10  comp.unix.aix archive availible on the WWW

7.00  Contributors

______________________________________________________________________________
1.000: The AIX operating system - what is it?

This is best answered by reading the text files in /usr/lpp/bos. The
README file there contains general information and the bsd file contain
useful information if you know BSD and/or System V.

The last release for the RT PC is 2.2.1. The latest release for PS/2s
and Intel architecture machines is AIX 1.3; for PS/2s only, 1.2.1. For
the RS/6000, there are three major levels, 3.1, 3.2, 4.1, and various
intermediate levels. IBM has dropped support for 3.1.

For those who don't have a copy of /usr/lpp/bos/README or bsd, I'll
sumarize: IBM tried to follow IEEE, POSIX 1003.1, ANSI C, FIPS and
then X/Open Issue 3.  Beyond that, AIX is a combination of System V
and BSD.


1.001: I know neither Unix nor AIX - where do I find more information?

If you are new to Unix, you should look at the other newsgroups in the
comp.unix hierarchy, in particular comp.unix.questions.  There are
FAQs more most of these groups as well.

If you need information about C programming, try comp.lang.c or
comp.std.c, the latter for Standard ANSI C issues.  comp.lang.c has a
FAQ posting.


1.002: What is the Object Database?
From: Uwe Geuder <Uwe.Geuder@informatik.uni-stuttgart.de>

AIX stores most of the system management information in /etc/objrepos,
/usr/lib/objrepos, and /usr/share/lib/objrepos. Files (also referred to
as system object classes) in these directories are adminstered by the
Object Database Manager, ODM, which is a set of library routines and
programs providing basic object oriented database facilities.

Under most circumstances, only SMIT or the commands SMIT call (see
1.100) should be used to change the contents of the system object
classes. A harmless way to look at the object database is to use odmget
<Class> where <Class> is one of the files in /etc/objrepos.

Experienced users can use the ODM editor, odme, to navigate the database
in detail. Modifying the database should only be attempted if you know
exactly what you are doing.
 

1.003: How do I get rid of the verbose error messages?
Corrected by Bjorn P. Brox <brox@corena.n>

Many of the messages from the Unix commands are available in different
languages. This is controlled by the LANG environment variable, the
default being En_US meaning English in the US. All the default messages
have a message number associated with them, e.g.:

$ cat no-such-file
cat: 0652-050 Cannot open no-such-file.

If you prefer the terser Unix-looking error message, set your
environment variable LC_MESSAGES to C, and you will get:

$ cat no-such-file
cat: Cannot open no-such-file.

By default LC_MESSAGES is the same as your environment LANG.  Setting
LANG does also work, but should be avoided since it changes
app-defaults lookup etc.  See locale(): LC_ALL


1.004: Which release of AIX or other products do I have?

New with 3.2.5: The oslevel command shows OS and component levels.
Run oslevel -help to see options

The command 'lslpp -h bos.obj' will show all lines referring to the BOS, 
Basic Operating System.  E.g.:

Fix Id  Release         Status    Action     Date       Time     User Name
------- --------------- --------- ---------- ---------- -------- ---------
Path: /usr/lib/objrepos
bos.obj
        03.02.0000.0000 COMPLETE  COMMIT     12/31/69   18:00:00 root
U401864 03.02.0000.0000 COMPLETE  COMMIT     11/12/92   20:09:35 root
U401968 03.02.0000.0000 COMPLETE  COMMIT     11/12/92   23:18:21 root
U401969 03.02.0000.0000 COMPLETE  COMMIT     11/12/92   23:18:20 root
                 ..........................
U418349 03.02.0000.0000 COMPLETE  COMMIT     08/28/93   15:34:13 root
U419950 03.02.0000.0000 COMPLETE  COMMIT     08/28/93   15:34:11 root

For AIX 3.2, you may come across discussions on 3.2.0, 3.2.1, 3.2.2,
3.2.3 extended, 3.2.4 and 3.2.5.  There is no absolute way to tell which
of these you are running since the newer releases are simply 3.2.0 with
some sets of PTFs added. See above example listing. These selective
fixes could mean there are literally thousands of slightly different
variations of 3.2 in use. Please see section 6 to request some useful
faxes to help with this number game.

AIX 3.2.4 and later attempts to resolve this confusion. The OS is
broken down into subsystems so that updates can be applied to an entire
subsystem.  lslpp also sports a new option; use 'lslpp -m bos.obj' to
show what level and update the system is running. You can also use the
new oslevel command. Unless you have a pressing need (such as
applications unsupported on > 3.2.3), it is recommended that you update
to this level. Also see 1.128.


1.005: What hardware do I have?  What is availible?  WITS?
From: C.Deignan@frec.bull.fr (C.DEIGNAN)

#!/bin/ksh
#
#  wits - What Is The System
#       A shell scripth that gives information about the RS60000
#       that it is being executed on.
#
# model E0 (motorola) hasn't been included yet.
#
# informations from : man uname (AIX4.1.2)
#                     Bull DPX/20 Reference Guide (rev. 5.3)
# lines with '#' haven't been verified
#
# Rev: 1.2
# Send comments and new info to C.Deignan@frec.bull.fr
#
##################################################################

# set -x
#exec 2>/dev/null

USAGE="Usage : $0 [-l]"
MODNUM=""

#
# input parameters control
#
case $# in
0) MACHIDNUM=`uname -m`
CPUNUM=`echo $MACHIDNUM | cut -c3-8`
MODNUM=`echo $MACHIDNUM | cut -c9-10`
;;

1) if [[ $1 = "-l" ]]
then
clear
print "Model Number\t Model ID   |\tModel Number\t Model ID"
print "\t\t\t\t|\t\t\t\t"
print "DPX/20 100/105\t\t43\t|\tDPX/20 100/110\t\t45"
print "DPX/20 100/130\t\t47\t|\tDPX/20 100/150\t\t46"
print "DPX/20 200/215\t\t42\t|"
print "DPX/20 300/310\t\t48\t|"
print "DPX/20 400/420\t\t37\t|\tDPX 20 400/455\t\t77"
print "DPX/20 400/460\t\t76\t|\tDPX/20 400/465\t\t76"
print "DPX/20 400/470\t\t75\t|\tDPX/20 400/475\t\t75"
print "DPX/20 400/480\t\t58\t|\tDPX/20 400/485\t\t57"
print "DPX/20 400/490\t\t57\t|\tDPX/20 400/495\t\t58"
print "DPX/20 600/630\t\t77\t|\tDPX/20 600/640\t\t67"
print "DPX/20 600/660\t\t66\t|\tDPX/20 600/680\t\t71"
print "DPX/20 600/690\t\t70\t|"
print "DPX/20 800/810\t\t63\t|\tDPX/20 800/840\t\t64"
print "DPX/20 800/890\t\t80\t|\tDPX/20 800/890H\t\t82"
print "\t\t\t\t|\t\t\t\t"
print "DPX/20 ESCALA D201-D401\tA0\t|"
print "DPX/20 ESCALA R201-R401\tA3\t|"
print "DPX/20 ESCALA M101-M401\tA6\t|"
print "\nWhich Model ID do you want ?\t\c"
read MODNUM
else
print $USAGE
exit
fi
;;

*) echo $USAGE
   exit
;;

esac


if test "$TERM" != emacs
then
tput clear
fi

#
# result of `uname -m` :
# 12 digits machine id: xxyyyyyymmss
# where :       xx      system = 00
#       yyyyyy  cpu id
#       mm      model id
#       ss      submodel number = 00

processor=""
processor_num=""
clock_mhz=""
dcache_kB=""
icache_kB=""
L1cache_kB=""
L2cache_MB=""
mflops=""
specmarks=""
specint92=""
specfp92=""
mcabuses=""
mcarate_MBps=""
mem_MB=""
#memrate_MBps=""
other=""

case $MODNUM in

"18") BULLMODEL="Bull DPX/20 Model 620"
IBMMODEL="IBM RISC System/6000 Model 530H"
#  clock_mhz="33"
#  dcache_kB="64"
#  icache_kB="8"
#  mflops="20.2"
#  specmarks="59.9"
#  specint92="28.5"
#  specfp92="45.3"
#  mcabuses="1"
#  mcarate_MBps="40"
#  mem_MB="128"
#  memrate_MBps="528"
;;

"34") BULLMODEL="Bull DPX/20 Model 610"
IBMMODEL="IBM RISC System/6000 Model 520H"
#  clock_mhz="25"
#  dcache_kB="32"
#  icache_kB="8"
#  specint92="21.5"
#  specfp92="45.3"
#  mcabuses="1"
#  mcarate_MBps="40"
#  other="Integrate_MBpsd ethernet\nIntegrate_MBpsd SCSI-1"
;;

"35") BULLMODEL="Bull DPX/20 Model 430"
IBMMODEL="IBM RISC System/6000 Model 320H"
#  clock_mhz="25"
#  dcache_kB="32"
#  icache_kB="8"
#  mflops="11.7"
#  specmarks="43.3"
#  mcabuses="1"
#  mcarate_MBps="40"
#  mem_MB="64"
#  memrate_MBps="160"
;;

"37") BULLMODEL="Bull DPX/20 Model 420"
IBMMODEL="IBM RISC System/6000 Model 34H"
processor="Power"
clock_mhz="42"
dcache_kB="32"
icache_kB="32"
L2cache_MB="No"
#  mflops="14.8"
#  specmarks="56.6"
specint92="48.1"
specfp92="83.3"
mcabuses="1"
mcarate_MBps="80"
mem_MB="from 16 to 512"
#  memrate_MBps="264"
#  other="Integrate_MBpsd ethernet\nIntegrate_MBpsd SCSI"
;;

"38") BULLMODEL="Bull DPX/20 Model 450"
IBMMODEL="IBM RISC System/6000 Model 350"
#  clock_mhz="41.7"
#  dcache_kB="32"
#  icache_kB="8"
#  mflops="18.6"
#  specmarks="71.4"
#  mcabuses="1"
#  mcarate_MBps="40"
#  mem_MB="64"
#  memrate_MBps="333"
#  other="Integrate_MBpsd ethernet\nIntegrate_MBpsd SCSI"
;;

"41") BULLMODEL="Bull DPX/20 Model 115,125,125W,130S,135,135G,140,140S"
IBMMODEL="IBM RISC System/6000 Model 22W,22W,22W+,230S,22G,22G,220,220+"
#  clock_mhz="33"
#  dcache_kB="8"
#  icache_kB="0"
#  mflops="6.5"
#  specmarks="25.9"
#  specint92="16.6"
#  specfp92="26.1"
#  mcabuses="1"
#  mcarate_MBps="40"
#  mem_MB="32"
#  memrate_MBps="89"
#  other="Integrate_MBpsd ethernet\nIntegrate_MBpsd SCSI"
;;

"42") BULLMODEL="Bull DPX/20 Model 215"
IBMMODEL="IBM RISC System/6000 Model 41W"
processor="PowerPC"
clock_mhz="80"
dcache_kB="32"
L2cache_MB="No"
specint92="78.8/88.1"
specfp92="90.4/98.7"
mem_MB="from 16 to 256"
;;

"43") BULLMODEL="Bull DPX/20 Model 105"
#  IBMMODEL="IBM RISC System/6000 Model M20"
#  clock_mhz="33"
#  specint92="16.6"
#  specfp92="26.1"
#  mcabuses="1"
#  mcarate_MBps="40"
;;

"45") BULLMODEL="Bull DPX/20 Model 110"
#  IBMMODEL="IBM RISC System/6000 Model 220"
;;

"46") BULLMODEL="Bull DPX/20 Model 150"
IBMMODEL="IBM RISC System/6000 Model 250"
processor="PowerPC"
clock_mhz="66/80"
dcache_kB="32"
L2cache_MB="No"
specint92="62.6/78.8"
specfp92="72.2/90.4"
mcabuses="1"
mcarate_MBps="80"
mem_MB="from 16 to 256"
;;

"47") BULLMODEL="Bull DPX/20 Model 130"
IBMMODEL="IBM RISC System/6000 Model 230"
processor="Power"
clock_mhz="45"
dcache_kB="8"
L2cache_MB="No"
specint92="28.5"
specfp92="39.9"
mcabuses="1"
mcarate_MBps="40"
mem_MB="from 16 to 64"
;;

"48") BULLMODEL="Bull DPX/20 Model 310"
IBMMODEL="IBM RISC System/6000 Model C10"
processor="PowerPC"
clock_mhz="80"
dcache_kB="32"
L2cache_MB="0/1"
specint92="78.8/90.5"
specfp92="90.4/100.8"
mcabuses="1"
mcarate_MBps="80"
mem_MB="from 16 to 256"
;;

"57") BULLMODEL="Bull DPX/20 Model 485 or 490"
IBMMODEL="IBM RISC System/6000 Model 3AT or 390"
processor="Power2 or Power2-L2"
clock_mhz="59 or 67"
dcache_kB="64"
icache_kB="32"
L2cache_MB="0/0.5/1"
specint92="99.3 or 109.7/113.2/114.3"
specfp92="187.2 or 202.1/204.5/205.3"
mcabuses="1"
mcarate_MBps="80"
mem_MB="from 32 to 512"
;;

"58") BULLMODEL="Bull DPX/20 Model 480 or 495"
IBMMODEL="IBM RISC System/6000 Model 380 or 3BT"
processor="Power2 or Power2-L2"
clock_mhz="59 or 67"
dcache_kB="64"
icache_kB="32"
L2cache_MB="No"
specint92="99.3 or 109.7"
specfp92="187.2"
mcabuses="1"
mcarate_MBps="80"
mem_MB="from 32 to 512"
;;

"5C") BULLMODEL="Bull DPX/20 Model 650"
IBMMODEL="IBM RISC System/6000 Model 560"
#  clock_mhz="50"
#  dcache_kB="64"
#  icache_kB="8"
#  mflops="30.5"
#  specmarks="89.3"
#  mcabuses="1"
#  mcarate_MBps="40"
#  mem_MB="128"
#  memrate_MBps="800"
;;

"63") BULLMODEL="Bull DPX/20 Model 810 or 820"
IBMMODEL="IBM RISC System/6000 Model 97B or 970"
processor="Power"
clock_mhz="50"
dcache_kB="64"
icache_kB="32"
L2cache_MB="No"
#  mflops="30.7"
#  specmarks="100.3"
specint92="58.8"
specfp92="108.9"
mcabuses="2"
mcarate_MBps="80"
mem_MB=" from 128 to 2048"
;;

"64") BULLMODEL="Bull DPX/20 Model 830 or 840"
IBMMODEL="IBM RISC System/6000 Model 980 or 98B"
processor="Power"
clock_mhz="62.5"
dcache_kB="64"
icache_kB="32"
L2cache_MB="No"
specint92="73.3"
specfp92="134.6"
mcabuses="2"
mcarate_MBps="80"
mem_MB="from 128 to 2048"
;;

"66") BULLMODEL="Bull DPX/20 Model 660"
IBMMODEL="IBM RISC System/6000 Model 580"
processor="Power"
clock_mhz="62.5"
dcache_kB="64"
icache_kB="32"
L2cache_MB="No"
specint92="73.3"
specfp92="134.6"
mcabuses="1"
mcarate_MBps="80"
mem_MB="from 64 to 2048"
;;

"67") BULLMODEL="Bull DPX/20 Model 640"
IBMMODEL="IBM RISC System/6000 Model 570"
processor="Power"
clock_mhz="50"
dcache_kB="32"
icache_kB="32"
L2cache_MB="No"
specint92="57.5"
specfp92="99.2"
mcabuses="1"
mcarate_MBps="80"
mem_MB="from 32 to 1024"
;;

"70") BULLMODEL="Bull DPX/20 Model 690"
IBMMODEL="IBM RISC System/6000 Model 590"
processor="Power2"
clock_mhz="66.6"
dcache_kB="256"
icache_kB="32"
L2cache_MB="No"
specint92="121.4"
specfp92="254.2"
mcabuses="1"
mcarate_MBps="80"
mem_MB="from 64 to 2048"
;;

"71") BULLMODEL="Bull DPX/20 Model 680"
IBMMODEL="IBM RISC System/6000 Model 58H"
processor="Power2"
clock_mhz="55.5"
dcache_kB="256"
icache_kB="32"
L2cache_MB="No"
specint92="97.6"
specfp92="203.9"
mcabuses="1"
mcarate_MBps="80"
mem_MB="from 64 to 2048"
;;

"75") BULLMODEL="Bull DPX/20 Model 470 or 475"
IBMMODEL="IBM RISC System/6000 Model 370 or 375"
processor="Power"
clock_mhz="62 or 62.5"
dcache_kB="32"
icache_kB="32"
L2cache_MB="No"
specint92="70.3"
specfp92="121.1"
mcabuses="1"
mcarate_MBps="80"
mem_MB="from 32 to 512"
;;

"76") BULLMODEL="Bull DPX/20 Model 460 or 465"
IBMMODEL="IBM RISC System/6000 Model 360 or 365"
processor="Power"
clock_mhz="50"
dcache_kB="32"
icache_kB="32"
L2cache_MB="No"
specint92="57.5 or 45"
specfp92="99.2 or 89"
mcabuses="1"
mcarate_MBps="80"
mem_MB="from 16 to 512"
;;

"77") BULLMODEL="Bull DPX/20 Model 455 or 630"
IBMMODEL="IBM RISC System/6000 Model 355 or 550L"
processor="Power"
clock_mhz="42"
dcache_kB="32"
icache_kB="32"
L2cache_MB="No"
specint92="48.1"
specfp92="83.3"
mcabuses="1"
mcarate_MBps="80"
mem_MB="from 32 to 256"
;;

"80") BULLMODEL="Bull DPX/20 Model 890"
IBMMODEL="IBM RISC System/6000 Model 990"
processor="Power2"
clock_mhz="71.5"
dcache_kB="256"
icache_kB="32"
L2cache_MB="No"
specint92="131"
specfp92="279"
mcabuses="2"
mcarate_MBps="80"
mem_MB="from 128 to 2048"
;;

"82") BULLMODEL="Bull DPX/20 Model 890H"
IBMMODEL="IBM RISC System/6000 Model R00 or R24"
processor="Power2-L2"
clock_mhz="71.5"
dcache_kB="128"
icache_kB="32"
L2cache_MB="2"
specint92="131.5"
specfp92="273.8"
mcabuses="2"
mcarate_MBps="80"
mem_MB="from 128 to 2048"
;;

"A0") BULLMODEL="Bull DPX/20 ESCALA Model D201 or D401"
IBMMODEL="IBM RISC System/6000 Model J30"
processor="PowerPC-601"
processor_num="2 or 4 (later 6 or 8)"
clock_mhz="75"
L1cache_kB="32"
L2cache_MB="1"
specint92="77 (per processor)"
specfp92="84 (per processor)"
mcabuses="1 to 2 (D201) or 2 (D401)"
mcarate_MBps="160 to 2x160 (D201) or 2x160 (D401)"
mem_MB="from 64 to 2048 (D201) or 256 to 2048 (D401)"
;;

"A3") BULLMODEL="Bull DPX/20 ESCALA Model R201 or R401"
IBMMODEL="IBM RISC System/6000 Model R30"
processor="PowerPC-601"
processor_num="2 or 4 (later 6 or 8)"
clock_mhz="75"
L1cache_kB="32"
L2cache_MB="1"
specint92="77 (per processor)"
specfp92="84 (per processor)"
mcabuses="2"
mcarate_MBps="2x160"
mem_MB="from 64 to 2048"
;;

"A6") BULLMODEL="Bull DPX/20 ESCALA Model M101, M201 or M401"
IBMMODEL="IBM RISC System/6000 Model G30"
processor="PowerPC-601"
processor_num="1, 2 or 4"
clock_mhz="75"
L1cache_kB="32"
L2cache_MB="0.5"
specint92="77 (per processor)"
specfp92="84 (per processor)"
mcabuses="1"
mcarate_MBps="160"
mem_MB="from 32 to 512 (M101) or 64 to 512 (M201)"
;;

"E0") BULLMODEL="Bull DPX/20 ESTRELLA Model DT603M"
#  IBMMODEL=""
;;

*) BULLMODEL="Error:  This system type ("$MODNUM") is unrecognized, you need a
later version of wits"

esac

#
# Results screen
#
echo "Marketing Reference Information"
echo "\n${BULLMODEL}\n${IBMMODEL}\n"
if [ -n "${processor}" ]; then echo "processor : ${processor}" ; fi
if [ -n "${processor_num}" ];
 then echo "Number of Processors : ${processor_num}\n" ; fi
if [ -n "${clock_mhz}" ]; then echo "clock : ${clock_mhz} MHz\n" ; fi
if [ -n "${dcache_kB}" ]; then echo "data cache : ${dcache_kB} KBytes" ; fi
if [ -n "${icache_kB}" ];
 then echo "instruction cache : ${icache_kB} KBytes"; fi
if [ -n "${L1cache_kB}" ];
 then echo "L1 cache : ${L1cache_kB} KBytes per CPU"; fi
if [ -n "${L2cache_MB}" ];
 then echo "L2 cache : ${L2cache_MB} MByte per CPU\n" ; fi
if [ -n "${mem_MB}" ]; then echo "memory : ${mem_MB} MB\n"; fi
if [ -n "${mcabuses}" ] && [ -n "${mcarate_MBps}" ]
then
 echo "${mcabuses} Microchannel bus(es)"
 echo "\tat ${mcarate_MBps} MBytes/sec\n"
elif [ -n "${mcabuses}" ]
then
 echo "${mcabuses} Microchannel bus(es)\n"
fi
if [ -n "${mflops}" ]; then echo "performances : ${mflops} MFLOPS" ; fi
if [ -n "${specmarks}" ];
 then echo "performances : ${specmarks} SPECmarks" ; fi
if [ -n "${specint92}" ];
 then echo "performances : ${specint92} SPECint92" ; fi
if [ -n "${specfp92}" ];
 then echo "performances : ${specfp92} SPECfp92\n" ; fi
if [ -n "${other}" ]; then echo "${other}"; fi

if [ $# -eq 0 ]
then
 print "\nType return to continue"
 read rep
 clear
 exec 2>/dev/null
 print "Current Configuration Information\n"
 echo "Hardware ID :  $CPUNUM\tModel ID :  $MODNUM\n"
 count_cpu=$(lscfg -l "proc*" 2>/dev/null | tail -n +3 | wc -l)
 if [ $count_cpu -gt 1 ]
 then
  print $count_cpu "Processors"
 else
  print "Mono-Processor"
 fi
 echo ""
 lscfg -l "mem*" | tail -n +3 | cut -c39-70
 echo ""
 lscfg -l "bus*" | tail -n +3 | cut -c39-70
 echo ""
 lscfg -l "hd*" | tail -n +3 | cut -c39-79
 echo ""
 lscfg -l "rmt*" | tail -n +3 | cut -c39-79
 echo ""
 lscfg -l "cd*" 2>/dev/null | tail -n +3 | cut -c39-79
 echo ""
fi


______________________________________________________________________________
1.100: I am used to Unix systems programming, why should I learn SMIT?

Using SMIT is probably very different from your normal way of doing
system administration, but could prove very useful in the long run. In
some areas, in particular TCP/IP, NFS, etc., you can also do things the
normal way, but it is unfortunately difficult to know exactly when the
normal way works. Again, always using SMIT is probably your best way
to go, even when you have to learn a new tool. 

What SMIT actually does is build up commands with all required options
to perform the functions requested and execute them. The commands
called and the output they produce are stored in the files smit.script
and smit.log in your home directory. Looking in smit.script may teach
you more about system administration.


1.101: How do I turn off the "running man" in smit?

Use smitty, the standard curses version or add this line to your .kshrc file:
alias smit="smit -C"


1.102: How do I import an /etc/passwd or /etc/group file from another box?

Make sure that you run usrck, pwdck (/etc/passwd), and grpck
(/etc/group) to let AIX work its password/group magic.


1.103: Cleaning up utmp, who, and accounting problems
From: fritz@scipp.UCSC.EDU (Frederick Staats)

This applies if you are running an X11R5 xterm on 3.2.
Add this to the top of X11R5 mit/clients/xterm/main.c:

#ifdef AIXV3
#define USE_SYSV_UTMP
#define HAS_UTMP_UT_HOST
#define WTMP_FILENAME "/var/adm/wtmp"
#endif

And your utmp problems should go away. If you want xterminal sessions
to go into the wtmp file you need to define -DWTMP in the Imakefile and
be sure the WTMP_FILENAME is set to the right place.

The following program by jfh@rpp386.cactus.org (John F. Haugh)
if run in the background by root will clean up the utmp file.

#include <sys/types.h>
#include <utmp.h>
#include <fcntl.h>

main ()
{
 int fd;
 struct utmp utmp;

 while (1) {
  if ((fd = open ("/etc/utmp", O_RDWR)) < 0)
   exit (1);

  while (read (fd, &utmp, sizeof utmp) == sizeof utmp) {
   if (utmp.ut_type == USER_PROCESS &&
     kill (utmp.ut_pid, 0) != 0) {
    lseek (fd, - (long) sizeof utmp, 1);
    utmp.ut_type = DEAD_PROCESS;
    write (fd, &utmp, sizeof utmp);
   }
  }
  close (fd);
  sleep (60);
 }
}

Another utmp program was posted to comp.sources.unix, volume 25, issue
96 by David W. Sanderson (dws@cs.wisc.edu) that also works on AIX 3.1.


1.104: How to fsck the root filesystem

You can run fsck either in maintenance mode or on mounted filesystems.
Try this:

  1. boot from diskette
  2. select maintenance mode
  3. type /etc/continue hdisk0 exit (replace hdisk0 with boot disk if
     not hdisk0)
  4. fsck /dev/hd4


1.105: How can I unmount /usr to run fsck on it?
From: accapadi@mathew.austin.ibm.com (Matt Accapadi)
[ This is for 3.2. ]

In order to fsck /usr, it has to be unmounted. But /usr cannot be
unmounted because /bin is symbolically linked to /usr/bin. Also
/etc/fsck is symbolically linked to /usr/sbin/fsck.

To work around this, when you boot from the boot/maintenance diskettes
and enter maintenance mode, enter "getrootfs hdisk0 sh" instead of
"getrootfs hdisk0" where hdisk0 is the name of the boot disk. Then run
"fsck /dev/hd2".


1.108: How do I see/change parameters like number of processes per user?

You can use SMIT as described below or simply use lsattr/chdev.
The former will list the current setting as in:

  # lsattr -E -l sys0 -a maxuproc
  maxuproc 40 Maximum # of processes allowed per user True

and you can then increase the maxuproc parameter:

  # chdev -l sys0 -a maxuproc=200
  sys0 changed

If you just type 'lsattr -E -l sys0' you will get a list of all
parameters, some of which can be changed but not others.

If you want to use smit, do as follows:

smit
  System Environments and Processes
    Change / Show Operating System Parameters
      - on this screen you can change by overtyping the following fields:
        - Maximum number of PROCESSES allowed per user
        - Maximum number of pages in block I/O BUFFER CACHE
        - Maximum Kbytes of real memory allowed for MBUFS
      - toggle fields exist for:
        - Automatically REBOOT system after a crash  (false/true)
        - Continuously maintain DISK I/O history (true/false)

Info 1.30 erroneously suggests that in AIX 3.2.5 you can set different
limits for different users.


1.109: How do I shrink the default paging space on hd6?

1) create a paging space to use temporarily
   mkps -s 20 -a rootvg

2) change default paging space hd6 so it is not used at next reboot
   chps -a n hd6

3) For AIX 3.1, edit /etc/rc.boot4 and change swapon /dev/hd6;
   for AIX 3.2, edit /sbin/rc.boot and change swapon /dev/hd6
   swapon /dev/paging00

4) Update information in boot logical volume
   bosboot -a             (3.1)
   bosboot -a -d hdisk0   (3.2)

5) shutdown and reboot

6) remove current hd6 and create a new one of smaller size
   rmps hd6
   mklv -y hd6 -t paging rootvg <size of PS in 4 Meg blocks>

7) Re-edit /etc/rc.boot4 (3.1), /sbin/rc.boot (3.2) to swap to /dev/hd6
   swapon /dev/hd6

8) Update information in boot logical volume
   bosboot -a             (3.1)
   bosboot -a -d hdisk0   (3.2)

9) change current paging device (paging00) so it is inactive at next boot
v   chps -a n /dev/paging00

10) shutdown, reboot, remove paging00 using the command:
    rmps paging00

You can check your paging space with `lsps -a`

1.110: The swapper seems to use enormous amounts of paging space, why?

When you run ps, you may see a line like:

USER   PID %CPU %MEM    SZ   RSS     TT STAT  TIME CMD
root     0 0.0%  14% 386528  8688      -    S 17:06 swapper

This is normal behavior, the swapper looks to ps like it has the entire
paging space plus real memory allocated.


1.111: How much paging space do I need?

See answer 2 in question 1.300.


1.112: How do I mount a floppy disk as a filesystem?
From: op@holmes.acc.Virginia.EDU (Olaf Pors)

You can build a filesystem on a floppy and mount it, however the
filesystem will be read only. The reason that the filesystem will be
read only is because AIX Version 3.1.5 cannot create a journal log on a
diskette. The intended use is for temporary access to read only data. 
The diskette file system must be unmounted after use and during system
backup procedures or errors could occur.

To make the read only filesystem on a floppy:

1. Make a subdirectory on an existing filesystem and place all of the
   files that the diskette will contain into this subdirectory.

2. Enter the following command to create a prototype file containing
   information about the new filesystem, in the example /dir_struct
   is the pathname of the subdirectory created in step 1, and
   proto_filename is the name of the prototype file to be created.

         proto /dir_struct > proto_filename

3. Place a formatted floppy into the drive.

4. Edit the prototype file and replace the first line with the following:

         <noboot> 0 0

5. Enter the following command to make the filesystem on your floppy:

          mkfs -p proto_filename -V jfs /dev/fd0

6. Create the directory upon which you will mount the floppy based
   filesystem, or you can use /mnt. Mount the filesystem:

          mount -r -V jfs /dev/fd0 /your_mount_point

7. To unmount the filesystem:

          umount /dev/fd0

Since the filesystem is read-only it may be of limited use but if you
are going to use it for utility programs and other data that does not
change much, it may still be useful. If you need to change the data,
you can copy the directory from the floppy into another directory, make
your modifications, and remake the filesystem using this procedure.


1.113: How do I remove a committed lpp?

You can get rid of COMMITTED lpps/ptfs by installing with the force
option and then rejecting the package.

AIX 4.1 users: installp has a new option, uninstall (-u) which can be
used to remove lpps.


1.114: How can I recover space after installing updates?
From: Milt Cloud <cloud@ux1.cso.uiuc.edu>

Note: If you are a /usr server, do not use this because the files
      mentioned below are needed by /usr clients and cannot be deleted.

Installp creates numerous files in /usr to clean up after
failed/rejected installs and also for de-installing uncommitted lpps. 
Once you have COMMITted packages you can remove these files safely. 
Depending on your installation activity the numbers can be significant:
hundreds-to-thousands of files, megabytes of data.

Files eligible for removal are associated with each "product" you have
installed; the largest collection being due to bos. After
COMMITting bos lpps, you may safely remove all files of the form:

              /usr/lpp/bos/deinstl*
              /usr/lpp/bos/inst_U4*
              /usr/lpp/bosadt/deinstl*
        and   /usr/lpp/bosadt/inst_U4*

You may repeat this for all additional COMMITted products (e.g.,
bostext1, bosnet, xlc) you have on your system.

This problem of lingering install files is a known defect in installp. 
If you have installed PTF U411711 (or any superseder of it: U412397,
U413366, U413425) the deadwood in /usr will not be quite as prevalent. 
No single PTF currently available completely corrects this problem.

On my own 320, the following freed up 12.4M in /usr:

       # rm -R /usr/lpp/bos/deinstl*
       # rm -R /usr/lpp/bos/inst_U4*


1.115: Where are the AIX log files kept?
From: dirk@kimosabi.ucsc.edu (Dirk Coldewey)

AIX logs messages as specified in /etc/syslog.conf.  Here's an
example

#
*.err;kern.debug;auth.notice;user.none          /dev/console
*.err;kern.debug;daemon,auth.notice;mail.crit;user.none /var/adm/messages
lpr.debug                                       /var/adm/lpd-errs

*.alert;kern.err;daemon.err;user.none           operator
*.alert;user.none                               root
*.emerg;user.none                               *

# for loghost machines, to have authentication messages (su, login, etc.)
# logged to a file, un-comment out the following line and adjust the 
# file name as appropriate.
#
# if a non-loghost machine chooses to have such messages 
# sent to the loghost machine, un-comment out the following line.
#
auth.notice                     /var/log/authlog
mail.debug                      /var/log/syslog

# following line for compatibility with old sendmails. they will send
# messages with no facility code, which will be turned into "user" messages
# by the local syslog daemon. only the "loghost" machine needs the following
# line, to cause these old sendmail log messages to be logged in the
# mail syslog file.
#
user.alert                       /var/log/syslog
#
# non-loghost machines will use the following lines to cause "user"
# log messages to be logged locally.
#
user.err                         /dev/console
user.err                         /var/adm/messages
user.alert                       `root, operator'
user.emerg                       *


1.116: How can I log information about ftp accesses to a file?
From: elr@trintex.uucp (Ed Ravin) and
      map@hal.maths.monash.edu.au (Michael Page)

1) In /etc/syslog.conf, add the line:
   daemon.debug  /tmp/daemon.log

2) # touch  /tmp/daemon.log
   # refresh -s syslogd

3) Modify your inetd.conf so that ftpd is called with the "-l" flag.
   You may also want the "-d" flag. This can be done with 'smit inetdconf'.

All the syslog messages from various system daemons should now appear in
the file "/tmp/daemon.log".


1.117: How do I find a file name from the inode number?
From: svpillay@berlioz.crs4.it (Kanthan Pillay)

     find /mntpoint -xdev -inum nnnn -print


1.118: How do I set up postscript accounting?
From: taluskie@utpapa.ph.utexas.edu (Vince Taluskie)

Ephraim Vider originally wrote this program to configure postscript page
accounting. It acts as a backend wrapper which logs accounting
information in /etc/qconfig and can be ftp'd from utpapa.ph.utexas.edu
in /pub/aix/psacct.tar.Z.

Compile with:

cc  pswrap.c -o pswrap -lqb

and then make this program suid root:

chown root pswrap
chmod u+s pswrap

If this step is not done, the printer will hang.

Then start up SMIT and go to :

Spooler
  Manage Local Printer Subsystem
    Local Printer Queue Devices
      Change / Show Characteristics of a Queue Device
        <Select Queue>
          <Select Device>

and change "BACKEND PROGRAM pathname" to the full pathname of pswrap
since pswrap will now handle the backend interface with the queue.

A stream of info will be written to a logfile in /tmp (prob lp0.log) but
this file is mainly used for status info and raw pagecounts. If the
accounting data is going to the qconfig-specified acctfile, then use the
'pac' command to read it. I prefer to have readable ascii data files
instead, so I just comment out the '#define WANT_PAC' line and it will
only go to the ACCTFILE specfied in pswrap.c.

/*  pswrap.c

 compile with:   cc pswrap.c -o pswrap -lqb
 (for doc on the qb library see "understanding backend routines in libqb")

 BTW:  The log_charge() function doesn't seem to do anything,
       but log_pages() updates the accounting info.

Ephraim Vider, original author 

--
Feb 10, 1993

You can set pswrap up to use either the accounting file specified in
/etc/qconfig (which means that you need to get your data from 'pac') or
you can comment out the #define WANT_PAC line and then the accounting
data will only go into the ACCTFILE.

Also modified the logging to the ASCII acctfile so that it looks more
readable.

Vince Taluskie
*/

 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
 #include <fcntl.h>
 #include <signal.h>
 #include <setjmp.h>
 #include <sys/wait.h>
 #include <IN/backend.h>
 #include <IN/standard.h>
 #include "qprocs.h"
 
 char     *nextword (char *p);
 char     *skipvalue (char *p);
 
 #define LOGDIR     "/tmp"
 #define ACCTFILE   "/usr/adm/acct/lpr/ps-acct"
/* #define WANT_PAC  1 */     /* this define will also send accounting
                                 info to the acctfile specified in
     /etc/qconfig file.  If this define is 
     commented out then accounting info will
     only go to ACCTFILE  */
 

 char     pcprog[] = "statusdict begin pagecount = end\n\x04";
 
 char     *keyw[] = {
     "idle",
     "busy",
     "waiting",
     "printing",
     "initializing",
     NULL
 };
 enum     { PS_IDLE, PS_BUSY, PS_WAIT, PS_PRINT, PS_INIT, PS_UNKNOWN };
 
 void     giveup();
 jmp_buf  jumper;
 
 char     logfname[30];
 FILE     *logfile, *acctfile;
 
 main (argc, argv)
 int argc;
 char     *argv[];
 {
     char *devname;
     int  pagcnt, c;
     int  pid;
     int  w, status;
 
     if (argc < 2) {
          fprintf(stderr, "Usage: psbe file\n");
          exit(-1);
     }
     if (log_init(argv[1]) < 0) {
          fprintf(stderr, "log_init failed!\n");
          exit(EXITBAD);
     }
     sprintf(logfname, "%s/%s.log", LOGDIR, get_device_name());
     if ((logfile = fopen(logfname, "a")) == NULL) {
          fprintf(stderr, "Can't open logfile.\n");
          exit(EXITBAD);
     }

     if ((acctfile = fopen(ACCTFILE, "a")) == NULL) {
  fprintf(stderr, "Can't open logfile.\n");
  exit(EXITBAD);
  }

     setvbuf(logfile, NULL, _IOLBF, BUFSIZ);
     setvbuf(acctfile, NULL, _IOLBF, BUFSIZ);

     setvbuf(stdin, NULL, _IONBF, 0);
     setvbuf(stdout, NULL, _IONBF, 0);
     fprintf(logfile, "start Job no. %d, queued on %s\n", get_job_number(),
               get_qdate());
     log_status(WAITING);
     pagcnt = getpagecnt();
     log_status(RUNNING);
     if ((pid = fork()) < 0) {
          perror("fork");
          exit(EXITBAD);
     }
     if (pid == 0) {
          argv[0] = "piobe";
          execv("/usr/lpd/piobe", argv);
          perror("exec");
          exit(EXITBAD);
     }
     while ((w = wait(&status)) != pid)
          if (w == -1) {
               perror("wait");
               exit(EXITBAD);
          }
     if (WEXITSTATUS(status) != 0)
          exit(WEXITSTATUS(status));
     log_status(WAITING);

     if (pagcnt > 0 && (c = getpagecnt()) > 0) {
#ifdef WANT_PAC 
          log_pages(c - pagcnt);
#endif
 }

     fprintf(logfile, "end Job no. %d, queued on %s\n", get_job_number(),
               get_qdate());

/* the accounting file format is 

pages_printed     user     queue_printed_on   time_queued

*/

     fprintf(acctfile, "%d %35s %7s    %s \n", (c - pagcnt), get_from(), get_queue_name(), get_qdate());

     fclose(logfile);
     fclose(acctfile);
     exit(EXITOK);
 }
 
 void     giveup ()
 {
     longjmp(jumper, 1);
 }
 
 getpagecnt ()
 {
     int  pc = 0, pstat;
     char buf[81];
 
     if (setjmp(jumper) != 0) {
          fprintf(logfile, "giving up on status\n");
          return (0);
     }
     alarm(60 * 2);
     signal(SIGALRM, giveup);
     do {
          if (!gets(buf)) {
               sleep(5);
               putchar('\x14');    /* ^T returns status */
               sleep(1); /* wait for answer from printer */
               if (!gets(buf))
                    return (0);
          }
          fprintf(logfile, "%s\n", buf);
          if ((pstat = getstatus(buf)) == PS_WAIT) {
               putchar('\x04');
               sleep(1);
          }
     } while (pstat != PS_IDLE);
     alarm(0);
     while (gets(buf))
          fprintf(logfile, "%s\n", buf);
     printf("%s", pcprog);
     sleep(1); /* wait for answer from printer */
     if (!gets(buf))
          return (0);
     if (sscanf(buf, "%d", &pc) != 1)
          return (0);
     fprintf(logfile, "%d\n", pc);
     return (pc);
 }
 
 /*
  * Parser for printer status messages
  */
 
 getstatus (p)
 char     *p;
 {
     char *t;
     int  i;
 
     if ((p = strchr(p, '%')) == NULL)
          return (PS_UNKNOWN);
     if (strncmp(p, "%%[", 3) != 0)
          return (PS_UNKNOWN);
     for (p = nextword(p + 3) ; p != NULL ; p = skipvalue(p)) {
          t = p;
          p = strchr(p, ':');
          *p++ = '\0';
          p = nextword(p);
          if (strcmp(t, "status") == 0)
               break;
     }
     if (p == NULL)
          return (PS_UNKNOWN);
     t = p;
     p = strchr(p, ' ');
     if (p[-1] == ';')
          p--;
     *p = '\0';
     for (i = 0 ; keyw[i] != NULL ; i++)
          if (strcmp(t, keyw[i]) == 0)
               break;
     return (i);
 }
 
 char     *nextword (p)
 char     *p;
 {
     while (isspace(*p))
          p++;
     if (strncmp(p, "]%%", 3) == 0)
          return (NULL);
     return (p);
 }
 
 char     *skipvalue (p)
 char     *p;
 {
     char *t;
 
     while (p != NULL) {
          p = strchr(p, ' ');
          t = p;
          p = nextword(p);
          if (t[-1] == ';')
               break;
     }
     return (p);
 }

 /*********    qprocs.h    ***********/
 /* functions for communication between qdaemon and the backend */
 
 char     *get_from();
 char     *get_to();
 char     *get_qdate();
 char     *get_queue_name();
 char     *get_device_name();
 char     *get_title();


1.119: How do I create boot diskettes for 3.2?

You need to have four formatted diskettes.

boot disk:                bosboot -d /dev/fd0 -a
display disk:             mkdispdskt
display extension disk:   mkextdskt
Install/Maintenance disk: mkinstdskt


1.120: Where can I find tools for performance monitoring?

Free X based performance watcher: xsysstats - ftp site ftp.x.org:/contrib

For 3.2 a few tools are available in /usr/lpp/bosperf. There are tools
to monitor traces, I/O events, CPU, virtual memory, disk block usage,
kernel extensions, etc. It even has a simulator, rmss, that allows one
to try out different memory size configurations to see how it impacts
performance. See 6.05 for the AIX Performance and Tuning Guide.

Monitor is an excellent tty based program that includes:

 - cpu usage
 - load average (from kernel or by using loadavgd program)
 - virtual and real memory usage
 - paging information
 - process events
 - Disk I/O (summary and TOP disks 1.12)
 - TTY I/O
 - Network activity
 - top cpu users 
 - NFS operations (New to 1.11)
 - more detailed disk I/O screen (New to 1.11 with -disk option)
 - more detailed network I/O screen (New to 1.12 with -net option)
 - toggle between normal/top/net/disk display using t,n,d keys

Monitor is available from
ftp.funet.fi:pub/unix/AIX/RS6000/monitor-1.11.tar.Z


1.121: How can I tell what virtual printer a print queue is using?
From: yoder@austin.ibm.com (Stuart R. Yoder)

Use the command 'lsvirprt'. Don't use any parameters and it will
run in an interactive mode that will give you a menu of all virtual
printers on the system with the queue and device for each one.


1.122: Two srcmstr's are less useful than one?
From: hubert@rs530.ncs.mainz.ibm.com (Bernhard Zeller)

This can happen on systems that have no console, or systems with an
async terminal as the console but not attached or turned off. One of the
symptoms is a second srcmstr got run. But the second srcmstr is worthless
as we can't use the stop/startsrc commands, refresh inetd, qdaemon won't
start, etc.

To resolve this, type:

    smit chgtty

and add the keyword 'clocal' in following lines:

   STTY attributes for RUN TIME
   STTY attributes for LOGIN


1.123: How do I set the tty name associated with a physical port?
From: accapadi@mathew.austin.ibm.com (Matt Accapadi)

Let's say you wanted to make a tty on the s1 port and call it rs0000
and a tty on the s2 port and call it rs0001.

You could run:

mkdev -c tty -s rs232 -t tty -l rs0000 -p sa0 -w s1   # creates rs0000
and
mkdev -c tty -s rs232 -t tty -l rs0001 -p sa1 -w s2   # creates rs0001


1.124: How do I use mksysb to clone a system?
From: joann@ariadne.SLAC.Stanford.EDU (Jo Ann Malina)

I use the following steps on the master machine to clone an AIX system:
1) Remove the password from root.
2) Remove the NIS line from the end of the /etc/group file (the last
   line with the +: )
3) Change most of the level '2' designations in /etc/inittab to level
   '3' to prevent them from being started up when the new system is
   booted (the minimum ones to change are rc.nfs and rc.tcpip)
4) Boot in service mode and change the name and ip address to a "spare"
   set to avoid address collision.
5) Clear /tmp, /usr/tmp and /usr/spool/lpd/stat.
6) Run mkszfile and edit it to be sure /usr is as small as possible;
   then mksysb from the command line.

The above changes allow me to boot in normal mode the first time, get in
as root, change the above files back and do the other things necessary
to configure the new system.

Then, of course, I go back and clean up and reboot my master machine.

Note: 1 and 2 lets you log in even if you can't get on the network. 
   It prevents the login process from trying to reach an NIS server. 
   Step 2 needed only if you use NIS.


1.125: How do I retain timestamps with mksysb?
Originally From: graeme@ccu1.aukuni.ac.nz ( Graeme Moffat)

As of AIX 3.2.5 bosrest preserves timestamps and permissions as does pax.

In AIX 3.2.2 /usr/lpp/bosinst/bosnet (for net installs), and bosrest
(tape), the 'pax' commands all have '-pmop' options.  m = "DON'T
retain modification times".  So, simply change all the '-pmop' to
'-pop' and remake inst/maint diskettes or mksysb tapes.


1.126: How can I find out the machine type?
From: umar@compsci.cas.vanderbilt.edu (Sait Umar)

#!/bin/sh
#
#  Author G. Vitillaro              (peppe@ipgaix.unipg.it)
#  from an idea of Marc Pawliger    (marc@ibmpa.awdpa.ibm.com)
#
#  10/12/92  GVT  First (and last) implementation
#  2/21/95   posted by hjiwa@nor.chevron.com (Jeff Wang)
# machine : will get machine type on RISC/6000
#
#

awk '
  BEGIN {
    m["10"]="7013/530 or 7016/730";
    m["11"]="7013/540";
    m["14"]="7013/540";
    m["18"]="7013/530H";
    m["1C"]="7013/550";
    m["20"]="7015/930";
    m["2E"]="7015/950";
    m["2E"]="7015/950E";
    m["30"]="7013/520";
    m["31"]="7012/320";
    m["34"]="7013/520H";
    m["35"]="7012/320H or 320E";
    m["37"]="7012/340
    m["38"]="7012/350";
    m["41"]="7011/220";
    m["43"]="7008/M20";
    m["45"]="7011/M20";
    m["48"]="7009/C10";
    m["5C"]="7013/560";
    m["57"]="7012/390 or 7030/3BT";
    m["63"]="7015/970";
    m["64"]="7015/980";
    m["66"]="7015/580";
    m["67"]="7015/570";
    m["70"]="7013/590";
    m["71"]="7013/58H";
    m["75"]="7012/370, 375, or 37T";
    m["76"]="7012/360, 365, or 36T";
    m["77"]="7012/350, 355, or 7013/550L";
    m["78"]="7012/315 or 7013/510 ";
    m["80"]="7015/990";
    m["82"]="7015/R24";
    if ( m[code] != "" )
      print "This RISC/6000 is a " m[code];
    else
      print "Unknown Machine";
  }
' code=`uname -m | cut -c9-10` < /dev/null


1.127: Updating to 3.2.5
From: kraemerf@franvm3.VNET.IBM.COM (Frank Kraemer)

(Ed.  The following is useful if you have to update a large number of
systems, large being > 3.)

   *** WARNING : Modify the scripts if you need dataless, diskless   ***
   ***           or remote /usr support.                             ***

1) Receive the PMP3250 tape from your AIX support center the PTF number
   is U493250.

2) Create a filesystem with 240 MB of space (60 PP's) and mount it as

   /dev/pmp3250  -  /pub/pmp3250

3) Insert the tape (blocksize is 512) and install PTF U422467

   # installp -BXacgq -d /dev/rmt0 bos.obj 3.2.0.0.U422467

4) Use the following script to load the tape in the new filesystem

   # cd /pub/pmp3250
   # mktape2disk.sh 0 447             <<-- read 447 files from rmt0

=-=-=-=-=-=-=-= cut here =-=-=-=-=-=-=-=-=-=-=
#!/bin/ksh
# @(#) mktape2disk.sh  creates files from tape on disk.

# change name prefix here
NAME="f"

# from file #i to file #j
integer i=1
integer j

# test arguments
if [ -z "${1}" ]
then
  echo "\nusage: $(basename ${0}) <drive_no> <#files>\n"
  echo "\t<drive_no>: tape drive number (e.g. 0)"
  echo "\t<#files>  : number of files to copy from the tape\n"
  exit 1
fi
device=/dev/rmt${1}.1

# test arguments
if [ -z "${2}" ]
then
  echo "\nusage: $(basename ${0}) <drive_no> <#files>\n"
  echo "\t<drive_no>: tape drive number (e.g. 0)"
  echo "\t<#files>  : number of files to copy from the tape\n"
  exit 1
fi
j=${2}

tctl -f ${device} rewind
if [ $? -ne 0 ]
then
  exit 1
fi

# create tape
while [ ${i} -le ${j} ]
do
    echo "Copy file #${i} of #${j} from (${device}) to disk as (${NAME}${i})."
    dd if=${device} of="${NAME}${i}" bs=200k
    i=i+1
done
tctl -f ${device} rewind
exit 0
=-=-=-=-=-=-=-= cut here =-=-=-=-=-=-=-=-=-=-=

5) Create a new .toc file

   # cd /pub/pmp3250
   # inutoc .
   # pg .toc

6) Place the following file named 'runme.sh' in the PMP directory

=-=-=-=-=-=-=-= cut here =-=-=-=-=-=-=-=-=-=-=
#!/bin/ksh
# @(#) runme.sh for PMP3250
#
INSTP="/usr/sbin/installp"
LOG="/tmp/installp.log"
TEE="/usr/bin/tee"
PATCHDIR=$(pwd)
#
/usr/bin/cp /usr/lpp/info/data/ispaths /usr/lpp/info/data/ispaths.save
#
INFODIR="/usr/lpp/info/$LANG/aixmin"
/usr/bin/mkdir ${INFODIR} 2>/dev/null >/dev/null
if [ ! -w ${INFODIR} ]
then
    print "\n\t*ERROR* Can not (write) access [${INFODIR}]."
    print "\tPlease unmount CD or NFS filesystems.\n"
    exit -1
fi
#
# Commit all ptf's
#
${INSTP} -Xc all 2>&1 | ${TEE} ${LOG}.0
#
# Install latest installp patch
#
${INSTP} -BXacgq -d ${PATCHDIR} bos.obj 3.2.0.0.U422463 2>&1 | ${TEE} ${LOG}.1
#
# Install latest installp patch
#
${INSTP} -BXacgq -d ${PATCHDIR} bos.obj 3.2.0.0.U422467 2>&1 | ${TEE} ${LOG}.6
#
# Run the ptfdir clean utility.
#
/usr/sbin/ptfdir_clean -y -f -v 2>&1 | ${TEE} ${LOG}.2
#
# Install the PMP.    Version 1
#
/usr/lib/instl/sm_inst installp_cmd   \
        -T m -q -a -g -B              \
        -d ${PATCHDIR}                \
        -S '3250 AIX Maintenance Level U493250' \
        -c  -N  -X                    \
        2>&1 | ${TEE} ${LOG}.3
#
# Install the PMP.    Version 2
#
# /usr/sbin/update_all
#
# Install latest installp patch
#
/usr/bin/lppchk -v | ${TEE} ${LOG}.4
#
# Show level of installp patch
#
/usr/bin/lslpp -m bos.obj | ${TEE} ${LOG}.5
#
# Guess you should reboot now.
#
sync;sync
print - "\n\n\tDone......guess you should reboot now !!\n"
exit 0
=-=-=-=-=-=-=-= cut here =-=-=-=-=-=-=-=-=-=-=

7) To run the update on your server

   ===>> Please read the Installation Instructions first <<==

   # cd /pub/pmp3250
   # ./runme.sh

                   ........WAIT...........

   # /etc/shutdown -Fr

8) NFS export the PMP dir as READ-ONLY to all your clients.

9) To update a client system

    a -  Mount the PMP filesystem from the server
    b -  cd <mounted_filesystem>
    c -  execute ./runme.sh
    d -  Unmount PMP filesystem
    e -  reboot

10) To create a copy 1:1 of the tape you received use the script 'mktape.sh'

   # cd /pub/pmp3250
   # mktape.sh 0

=-=-=-=-=-=-=-= cut here =-=-=-=-=-=-=-=-=-=-=
#!/bin/ksh
# @(#) mktape.sh: creates a bootable tape from images on disk

# change name prefix here
NAME="f"

# usage: mktape drive_no
#        drive_no = tape drive number
# test arguments
if [ -z "${1}" ]
then
  echo "\nusage: mktape <drive_no>"
  echo "         <drive_no>: tape drive number (e.g. 0)\n"
  exit 1
fi
device=/dev/rmt${1}.1

tctl -f ${device} rewind
if [ $? -ne 0 ]
then
  exit 1
fi

# create tape
i=1
while test -r "${NAME}${i}"
do
    echo "copy ${i}"
    if [ $i -le 3 ]
    then
      dd if="${NAME}${i}" of=${device} conv=sync bs=1k
    else
      dd if="${NAME}${i}" of=${device} bs=200k
    fi
    let i=${i}+1
done
tctl -f ${device} rewind
exit 0


1.128: AIX fix strategy
From: leedp@austin.ibm.com (Dennis Lee, PMP Release Manager)

First, a little history...

The maintenance strategy for AIX 3.1 was cumulative updates. Every few
months, we'd put all available fixes in one large package and ship it. 
There was no real strategy for providing a single fix. Although we'd
occasionally produce an emergency patch, there was no method for
tracking them; if you got a second one, it might overwrite the first. 
So, after a few of these patches, it's hard to track.

In AIX 3.2 we introduced a "selective fix" strategy to support
individual fixes. The package contained information about other fixes
that were required for that fix to work correctly. For example, a Korn
shell fix might require a change in libc.a, which might in turn require
a fix in the kernel. This strategy allowed us to keep track of which
fixes were installed to make sure we didn't overwrite one with another,
and make sure they all worked together. But the initial selective fix
design still had a few problems.

  o None of the fixes were cumulative.  If you got a fix for Korn shell,
    you may not receive all of the fixes for Korn shell.  This left the
    possibility of rediscovering other problems that were already fixed.

  o Since we chose to fix everything possible that was reported as a
    problem, instead of deferring them to the next release, the number
    of available fixes became quite large.

  o The number of additional fixes required by any given fix could also
    be quite large.  Since the installation program ran once for each
    fix, the size and complexity of the fix packages grew, and
    installation time lengthens greatly.

While developing the AIX 3.2.4 upgrade, we undertook a large effort to
resolve the selective fix concerns, and dramatically increase the
quality of AIX 3.2.  The base operating system and most of the optional
program products were split into subsystems.  A subsystem is a group of
logically related files.  The division was made such that changes to a
given subsystem were less likely to affect other subsystems.  In total
there are approximately 500 subsystems, but in practice, files have been
modified in only about half of them.  The advantages of the new
packaging strategy are:

  o Each subsystem package is cumulative, containing all of the fixes
    and enhancements to date for that subsystem.

  o The cumulative subsystem package is tested as an entity.

  o The number of fix packages is greatly reduced because the number of
    subsystems is far fewer than the number of fixes and enhancements.

  o The number of other fixes required by any given fix is also greatly
    reduced because a subsystem package has requisites only on other
    subsystem packages.

  o The reduced number of fix packages greatly reduced installation time.

Some customers also told us that they liked the maintenance level
strategy that we used in AIX 3.1.  They liked being able to install all
of the known fixes, and they liked knowing what "level" of AIX they had. 
To meet these requirements, we produced a Preventive Maintenance Package
(PMP).  The PMP is simply a collection of the latest cumulative
subsystem packages tied together in such a way that it can be installed
by selecting a single fix.  We also added flags to the lslpp command and
added a new command, oslevel, to show which PMP is installed.  Now we
had both! The good attributes of selective fix along with the good
attributes of maintenance levels. 

A few Q&As: 

Q. Why is the fix I just received 130 megabytes!@#? I already have the
AIX 3.2.4 update installed!
A. Your fix may be part of the AIX 3.2.5 update. AIX 3.2.5 is another
PMP that contains all of the fixes to date, as well as enhancements 
to support the PowerPC model 250, and the new high-end RS/2 models
590 and 990, as well as support for new disk and tape drives, graphics
adapters and more.

Q. Why can't you just build my fix on 3.2.4? 
A. There really isn't such a thing as 3.2.1 or 3.2.2 or even 3.2.4. 
They're just collections of fixes and enhancements built on a 3.2 base. 
If the fix for your problem was built prior to 3.2.5, you can get the
older version. But if your fix was built for the first time in a 3.2.5
subsystem, that's the only version of the fix that exists.

See also 6.02.


1.129: Are passwords limited to 8 char?

AIX passwords are only significant to 8 characters. You can set a
passwd to more than 8 characters but anything over eight are ignored.
No messages or warnings are given.

Be careful if you're running NIS. You probably want to limit passwords
to 8 char on all machines (6000 and others) to be compatible.

Someone mentioned that DCE supports kerberos which supports passwords
greater than 8 characters.


1.130: How do I increase the number of ptys > 64?
From: mick@oahu.cern.ch (Mickey Coggins)

SMIT only allows 64. Try this:

odmget -q"attribute=num and uniquetype=pty/pty/pty" PdAt |
sed "s/0-64/0-512/" |
odmchange -q"attribute=num and uniquetype=pty/pty/pty" -o PdAt

chdev -l pty0 -anum=256 -P
reboot


1.131: CERT advisories on sendmail and xterm

The following fixes are available for some CERT advisories on problems
with sendmail and xterm.

sendmail        - fix available as U426396
xterm for X11R4 - fix available as U422575
xterm for X11R5 - fix available as U425811


1.132: How do I remove a non-existant physical volume?
Thanks to Johnny Shieh (shieh@austin.ibm.com)

To delete a phantom disk from the ODM use reducevg with the pvid
instead of the disk name.  You are running some command such as lsvg
or varyonvg and it is griping about a disk that is no longer findable
right?  In that warning message, it should give you a pvid.  Try one
of the following, (note: reducevg updates the VGDA but not the ODM).

reducevg -f <vgname> <pvid>

ldeletepv -g VGid -p PVid
      -g Required, specify the VGid of the volume group you are
         removing the physical volume from
      -p Required, specify the PVid of the PV to be removed


1.133  How do I kill a process that ignores kill -QUIT -KILL -STOP

If there is i/o pending in a device driver, and the driver does not
catch the signal, you can't kill it - a reboot is the only way to
clear it.

Furthermore, if the process stays hung for more than a few minutes,
you can find out what device is wedged by doing this --

% echo trace -k $(expr <pid> / 256) | crash | tee stack

If you can't figure out what is wrong, print that trace out and call
1-800-237-5511 and tell them that something is broken.  Tell them you
want to fax in the nice stack trace that you have as your testcase.


1.134: How can I see "console" messages?
From: crow@tivoli.com (David L. Crow)

Use the swcons command to redirect the console to a file.  Or use
chcons to do it permanently.


1.135: Where can I find TOP for AIX?

TOP functionality is included in an AIX package called Monitor
availible from aixpdslib.seas.ucla.edu:/pub/monitor among other
places.


1.136: How can I restrict root logins to specific terminals?
From: jfh@austin.ibm.com (John F. Haugh II)

Read FAX 2737 availible from the 800-IBM-4FAX number discussed in
section 6.02.  Refer to APAR IX45701 for fixes related to the rsh style
commands. 


1.137: How do I merge my /etc/password and /etc/security/password for Crack

/usr/sbin/mrgpwd.  You must have permissions to read /etc/security/password.


1.138: I lost the root password, what should I do?
(From: [a posting by] dramm@csusm.edu (Donald E. Ramm))

Boot from boot diskettes, bootable tape, or bootable CD.  
At the Installation/Maint menu select item 4, "Start a limited function
 maintenance shell.
At the subsequent "#" prompt enter the command:
 getrootfs hdiskN
 (where "N" is replaced by the number of a disk on your system
 that is in rootvg.)
That will run for about a minute or so and you get a # prompt back.  At this
 point you are logged in as root in single user mode.
Change to /etc/security and edit the passwd file.  Delete the three lines
 under root: password, update time (or whatever it's called), and
 flags.  Save the file.
Then at the prompt, give root a new password.
Shutdown/reboot in normal mode.  Log in with new password.


1.139:  How can I resolve DEV_WAIT status for a local print queue?
From: chuah@sam.po.my (Chuah Teik Chye)

Try "qadm -k && qadm -U"


1.140: SMIT problems forcing/overwriting install?

Installp does not support overwriting and installing prerequisite
software at the same time.

1.141: Which distribution tape do I have?
From: fuzzy@obelix.ncs.mainz.ibm.com (Thomas Braunbeck)

          AIX 3.2.5 (3250-04-09)
            |         |    |  |
            |         |    |  |
            |         |    |  Revision level
            |         |    Enhancement level
            |         Preventive Maintenance Package (PMP) level
            AIX Version, Release, Modification level



1.142: How can I get PTF (fixes) via ftp?  What is fixdist?

Get a copy of IBM's fixdist package.  This X-windows program can help
you find and transfer PTFs from IBM to your machine.  It is availible
from <URL:ftp://aix.boulder.ibm.com>/ and further instructions are
displayed after you login.  It is worth noting here that the files
fixdist retrieves are often quite large and therefore not recommended
for those with slow connections.

No comments: