SUBJECT: 6.05 What PUBLICATIONS Are Available for AIX and RS / 6000?
Publications List:
Http://www.rs6000.ibm.com/resource/aix_resource/pubs/
Aixpert magazine: http://www.developer.ibm.com/library/aixpert/
AIXPERT
IBM Corporation
Mail stop 36
472 WHEEEELERS FARMS Road
Milford, CT 06460
Fax: (203) 783-7669
The Ssemanuals Should Be Available from your favorite ibm office.
SC23-2204-02 Problem Solving Guide
SC23-2365-01 Performance Monitoring and Tuning Guide for AIX 3.2
SA23-2629-07 Service Request Number Cross Reference, Ver 2.2
SA23-2631-05 Diagnostic Programs: Operator Guide
SA23-2632-05 Diagnostic Programs: Service Guide
SA23-2643-01 Hardware Technical Reference: General Information
SA23-2646-01 Hardware Technical Reference: Options and Devices
IBM's International Technical Support Center Produces Redbooks -
Practical, How-to Manuals - ON A Wide Range of Technical Topics
Including AIX Migration, System Management, Internet Security, And
RS / 6000 Hardware. Abstracts and ORDERING INFORMATION AREAVAILABLE
From the redbooks homepage <
http://www.redbooks.ibm.com/>. (See Question)
6.09 Also.)
Computer Bookstores Offen Carry Many of The Following:
Power Risc System / 6000: Concepts, Facilities, Architecture, Chakravarty
McGraw-Hill ISBN 0070110476
"PowerPC: Concepts, Facilities, Architecture", CHAKRAVARTY / Cannon
McGraw-Hill ISBN 0070111928
"The Advanced Programmer's Guide to Aix 3.x", Colledge
McGraw-Hill ISBN 007707663X
"AIX Companion", Cohn
Prentice-Hall ISBN 0132912201
"AIX for RS / 6000: System & Administration Guide", Deroest
McGraw-Hill ISBN 0070364397
"A guide to aix 3.2", franklin
Metro-info systems 05/1993
"IBM RS6000 AIX System Administration", HollickerPrentice-Hall ISBN 0134526163
"IBM RISC System / 6000 - a Business Perspective", Hoskins
John Wiley & Sons ISBN 0471599352
"The Advanced Programmer's Guide To Aix 3.x", Phil Colledge
McGraw-Hill, 1994, ISBN: 0-07-707663-X
"AIX Performance Tuning", Frank Waters
Prentice-Hall 1996 ISBN 0-13-386707-2
"The Aix Survival Guide", Andreas Siegert
Addison-Wesley 1996 ISBN 1-201-59388-2
Subject: 6.06: Some Acronyms
APAR - Authorized Program Analysis Report
Created INTERNALY BY A Systems Programmer To Solve A Code Bug.
Bos - Base Operating System
DCR - Design Change Request
Someone asked to change.
LPP - licensed Program Product
ODM - Object Data Manager
Don't touch unsil you grok it.
PRPQ - Programming Request for Price Quotation
Essential, a Program That is not available off-the-shelf.
(E.G. Hacmp Started AS A Prpq, You Could Not Order Hacmp, But
You Could Ask IBM for a HIGHLY-AVAILABLE SOLUTION)
PTF - Program Temporary FIX
Temporary? Yes! Read "Tao of computing".
Smit - System Management Interface Tool
Smitty - Smit, Tty Interface, No Bells, No whistles. "Alias Smit = SMITTY"
Of Y2K - DONE. TOTAL NON-EVENT.
Subject: 6.07: How do i get this by mailserver or ftp?
Since the Articles Are Crossposted to News.answers, Any Archive
Carrying That NewsGroup Will Also Have these Articles. in particular,
Try ftp'ing to rtfm.mit.edu and checking the Directory
Pub / USENET / News.answers. This FAQ IS Archived AS "AIX-FAQ / Part [12345]".
The FAQ IS Also Availible Via Email Using The Address
Mail-server@rtfm.mit.edu two example from Aunix Prompt Fort FROMPT FOLLOW:
Echo Help | mail mail-server@rtfm.mit.edu
Echo Send UseNet / News.answers / AIX-FAQ / Part1 | mail mail-server@rtfm.mit.edu
Subject: 6.08: Hypertext Version of the FAQ
United States:
<
http://www.emerson.emory.edu/services/aix-faq/>
<
http://www.cis.ohio-state.edu/hypertext/faq/Usenet/aix-faq/top.html>
New Zealand:
France:
Canada:
Subject: 6.09: IBM AIX Documentation on The WWW.
<
http://www.ibm.com/servers/aix/library/> Contains Links to IBM
Documentation, this incrudes links to the redbooks site
Documents) As Well as Links to the Aix 4.3 Manuals.
Subject: 6.10: Comp.unix.Aix Archive Availible on the www
Michael Staats & Fred Hucht Have Informed Me That a Searchable Archive of
Comp.unix.Aix is Availible At:
<
http://www.thp.uni-duisburg.de/cuaix/cuaix.html>.
Subject: 6.11: How Can I Access The Comp.Unix.Aix NewsGroup
VIA Email (or Web)?
From: Ciaran Deignan <
C.deignan@frec.bull.fr>
It is possible to get "digests" of the aix newsgroup by email. Each
Digest Contains a Summary (Just The Subject Lines from Each Post)
Plus The Contents of a Series of News Articles Posted to the NewsGroup.
Each Digest Is About 800 Lines Long, And The NewsGroup Typically Genereates
5 Digest Mails Per Day.
To Get Thase Digests, You Have to Subscribe To a Mailing List. Send
An email to the address
Majordomo@dmshome.youngstown.oh.us, and put
The Text "Subscribe Aix-Digest" in the body of the message.
[Editor's Note: The Above Address Does Not Appear to Work Any Longer, IFANYONE KNOWS OF A Functional Equivalent Please Drop me a note.]
It is equerly possible to post articles to the newsgroup via email.
Any Mail Sent to The Address
Aixnews@cc.ysu.edu will be forwarded to
The comp.unix.Aix newsgroup.
Thase Services Are Provided by Doug Sewell <
Doug@cc.ysu.edu>.
Comp.unix.Aix Can Be Accessed from the Web Via
http://www.deja.com/
------------------------------
Subject: 8.03: How do i set up postscript accounting?
[formerly in section 1.118]
/ * 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 look more
Readable.
Vince TALUSKIE
* /
#include
#include
#include
#include
#include
#include
#include
#include
#include
#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 Ten Accounting Info Will
ONLY Go To AcctFile * /
Char pcProg [] = "statusdict begin pagecount = end / n / x04";
Char * keyw [] = {
"iDLE",
"busy",
"waiting",
"printing",
"inTIALIZING",
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 * defname;
INT PAGCNT, C;
int PI;
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, "A")) == null) {
FPRINTF (stderr, "can't open logfile./n");
exit (exitbad);
}
Setvbuf (logfile, null, _iolbf, bufsiz);
Setvbuf (AcctFile, Null, _iolbf, buffs);
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 (WAITI);
PAGCNT = getPagecnt ();
LOG_STATUS (RUNNING);
IF ((pID = for ()) <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);
}
WexitStatus (status)! = 0)
EXIT (WexitStatus);
LOG_STATUS (WAITI);
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_queue
* /
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 ();
Subject: 8.04: How can I find out the machine type?
From: anonymous
[formerly in section 1.126]
#! / bin / ksh
# Determine Machine Type
# Jim o'quinn 2/28/93
# Aix Software Support
# This does not represent my Employer, Use at Own Risk .....
# Changd to report new machine and unknown IDs. / Fred
# More new machines. / David
MachType = `uname -m | cut -c9-10`
Case $ MachType
in
02) nmachtype = "7015/930" ;;
10) nmachtype = "7013/530 or 7016/720 or 7016/730" ;;
11 | 14) nmachtype = "7013/540" ;;
18) nMachType = "7013 / 53h" ;; 1C) nmachtype = "7013/550" ;;
20) nmachtype = "7015/930" ;;
2E) nmachtype = "7015/950 or 7015 / 950e" ;;
30) nmachtype = "7013/520 OR 7018/740 or 7018/741" ;;
31) nmachtype = "7012/320" ;;
34) nmachtype = "7013 / 52h" ;;
35) nmachtype = "7012 / 32h or 7012 / 320E" ;;
37) nmachtype = "7012/340 or 7012/34h" ;;
38) nmachtype = "7012/350" ;;
41) nmachtype = "7011/220 OR 7011 / 22W OR 7011 / 22G OR 7011/230" ;;
42) nmachtype = "7006 / 41t or 7006 / 41w" ;;
43) nmachtype = "7008 / m20" ;;
45) nmachtype = "7011/220 or 7011 / m20 or 7011/230 or 7011 / 23w" ;;
46) nmachtype = "7011/250" ;;
47) nmachtype = "7011/230" ;;
48) nmachtype = "7009 / c10" ;;
49) nmachtype = "7011/250" ;;
4c) nmachtype = "604/43p" ;;
4D) nmachtype = "601 / 40p" ;;
57) nmachtype = "7012/390 or 7012 / 3BT OR 7030 / 3BT OR 7032 / 3at or 7011/390" ;;
58) nmachtype = "7012/380 or 7012 / 3at or 7030 / 3bt" ;;
59) nmachtype = "3CT or 39H" ;;
5c) nmachtype = "7013/560" ;;
63) nmachtype = "7015/970 or 7015 / 97b" ;;
64) nmachtype = "7015/980 or 7015 / 98b" ;;
66) nmachtype = "7013/580 or 7013 / 58f or 7015/580" ;;
67) nmachtype = "7013/570 or 7013/770 or 7013/771 OR 7013 / R10 OR 7015/570" ;;
70) nmachtype = "7013/590" ;;
71) nmachtype = "7013 / 58h" ;;
72) nmachtype = "7013 / 59h or 7013 / r12 or 7013 / 58h" ;;
75) nmachtype = "7012/370 or 7012/375 or 7012 / 37t" ;;
76) nmachtype = "7012/360 or 7012/365 or 7012 / 36T" ;;
77) nmachtype = "7012/315 or 7012/350 OR 7012/355 or 7012/510 OR 7012 / 55H OR 7012 / 55L" ;; 78) nMachType = "7012/315 OR 7013/510" ;;
NMACHTYPE = "7013/590" ;;
80) nmachtype = "7015/990" ;;
82) nmachtype = "7015 / r00 or 7015 / r24" ;;
90) nmachtype = "IBM C20" ;;
91) nmachtype = "604/42t" ;;
A0) nmachtype = "7013 / j30 or 7013 / r30";
A3) nmachtype = "7013 / r30";
A6) nmachtype = "7012 / g30" ;;
C4) nmachtype = "f40" ;;
E0) nmachtype = "603 / motorola powerstack" ;;
*) Nmachtype = "unknown ($ machineTYPE)"
ESAC
Echo "Machine Type:" $ nmachtype "
From: Jan Just Keijser <
KeijSerjj@logica.com>
I'VE Attached A C Program Which Determines The Model and The Amount of
Memory Installed In C C code (by querying the odm directly). IT CAN BE
Compiled using
Cc -o model model.c -lcfg -lodm
#include
#include
#include
#include
#include
#include
#include
Void main (void)
{
Struct Utsname Name;
INT MEMSIZE;
Char s [3];
Int model;
Struct Cuat * ODM_OBJ;
INTHOW_MANY;
UNAME (& name);
Printf ("sysname =% s / n", name.sysname);
Printf ("NodeName =% S / N", Name.NodeName);
Printf ("Release =% S / N", Name.Release);
Printf ("Version =% S / N", Name.Version;
Printf ("Machine =% S / N", Name.Machine;
Printf ("Model =");
/ * ON AIX, THE MODEL IS ENCODEDIT 2 NON-ZERO DIGITS
of the model code (uname -m)
* /
s [0] = name.machine [Strlen (Name.Machine) - 4]; s [1] = name.machine [strlen (name.machine) - 3];
s [2] = '/ 0';
Model = STRTOL (S, NULL, 16);
Switch (Model)
{
Case 0x10: PUTS ("Model 530/730");
Break;
Case 0x11:
Case 0x14: PUTS ("Model 540");
Break;
Case 0x18: PUTS ("Model 530h");
Break;
Case 0x1c: PUTS ("Model 550");
Break;
Case 0x20: PUTS ("Model 930");
Break;
Case 0x2e: PUTS ("Model 950 / 950E");
Break;
Case 0x30: PUTS ("Model 520 or 740/741");
Break;
Case 0x31: PUTS ("Model 320");
Break;
Case 0x34: PUTS ("Model 520h");
Break;
Case 0x35: PUTS ("Model 32H / 320E");
Break;
Case 0x37: PUTS ("Model 340 / 34H");
Break;
Case 0x38: PUTS ("Model 350");
Break;
Case 0x41: PUTS ("Model 220 / 22W / 22G / 230");
Break;
Case 0x42: PUTS ("Model 41T / 41W");
Break;
Case 0x43: PUTS ("Model M20");
Break;
Case 0x45: PUTS ("Model 220 / M20 / 230 / 23W");
Break;
Case 0x46:
Case 0x49: PUTS ("Model 250");
Break;
Case 0x47: PUTS ("Model 230");
Break;
Case 0x48: PUTS ("Model C10");
Break;
Case 0x4c: PUTS ("PowerPC 603/604 Model);
Break;
Case 0x4d: PUTS ("Model 40P");
Break;
Case 0x57: PUTS ("Model 390 / 3t / 3BT");
Break;
Case 0x58: PUTS ("Model 380 / 3t / 3Bt");
Break;
Case 0x59: PUTS ("Model 39H / 3CT");
Break;
Case 0x5c: PUTS ("Model 560");
Break;
Case 0x63: PUTS ("Model 970 / 97B");
Break;
Case 0x64: PUTS ("Model 980 / 98B");
Break;
Case 0x66: PUTS ("Model 580 / 58F");
Break;
Case 0x67: PUTS ("Model 570/770 / R10"); Break;
Case 0x70: PUTS ("Model 590");
Break;
Case 0x71: PUTS ("Model 58H");
Break;
Case 0x72: PUTS ("Model 59H / 58H / R12 / R20");
Break;
Case 0x75: PUTS ("Model 370/375 / 37T");
Break;
Case 0x76: PUTS ("Model 360/365 / 36T");
Break;
Case 0x77: PUTS ("Model 315/350/355/510 / 550H / 550L");
Break;
Case 0x79: PUTS ("Model 591");
Break;
Case 0x80: PUTS ("Model 990");
Break;
Case 0x81: PUTS ("Model R24");
Break;
Case 0x82: PUTS ("Model R00 / R24");
Break;
Case 0x89: PUTS ("Model 595");
Break;
Case 0x90: PUTS ("Model C20");
Break;
Case 0x91: PUTS ("Model 42T");
Break;
Case 0x94: PUTS ("Model 397");
Break;
Case 0xA0: PUTS ("Model J30");
Break;
Case 0xA1: PUTS ("Model J40");
Break;
Case 0xA3: PUTS ("Model R30");
Break;
Case 0xA4: PUTS ("Model R40");
Break;
Case 0xA6: PUTS ("Model G30");
Break;
Case 0xA7: PUTS ("Model G40");
Break;
Case 0xc4: PUTS ("Model F30");
Break;
Default: Printf ("Model Code:% S / N", S);
Break;
}
/ * Get The Amount of Installed Memory * /
ODM_SET_PATH ("/ etc / objrepos");
/ * Get a single odm object * /
ODM_OBJ = GetAttr ("SYS0", "RealMem", 0, & how_many);
Memsize = ATOI (ODM_OBJ-> Value) / 1024;
ODM_TERMINATE ();
Printf ("Memory =% D MB / N", MEMSIZE);
/ * Print The Number of Processors * /
Printf ("# processor configured =% d / n", sysconf (_sc_nprocessors_conf);
Printf ("# processor online =% d / n", sysconf (_sc_nprocessors_onln);}
Subject: 8.05: Updating to 3.2.5
[formerly in section 1.127]
= - = - = - = - = - = - = - = Cut here = - = - = - = - = - = - = - = - = - = - =
#! / bin / ksh
# @ (#) mktape2disk.sh creates files from time 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})
echo "/ t
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})
echo "/ t
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?
#
$ {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 / instal / 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
#
# Sw level of installp patch
#
/ usr / bin / lslpp -m bos.obj | $ {tee} $ {log} .5
#
# Guess You Should Reboot Now.
#
Sync; SYNC
Print - "/n/n/tdone....... City you shop 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
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
Echo "
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
Subject: 8.06: How do I do remove backup?
From:
Kraemerf@franvm3.vnet.ibm.com (Frank Kraemer)
[Formerly In Section 1.201]
#! / bin / ksh
# @ (#) CREATE A Backup Tape of The Private User Data.
# ===================================================== ================ ## script: usave.sh #
# Author: f. Kraemer #
# Date: 92/02/19 #
# Update: 92/10/29 #
# Info: The Ultimative Backup Script #
# Example: usave.sh / dev / rmt0 - save to local tape #
# Usave.sh/save/save.me - save to local file #
# USAVE.SH / TMP / PIPE - Save to Remote Tape #
# ------------------------------------------------- ---------------- #
PS4 = "( )"
#set-x
PROG = $ (BaseName $ 0)
Host = $ (Hostname)
Today = $ (DATE % H:% M:% s)
#
# clean
#
Cleanup ()
{
EC = $ 1
Error = $ 2
Case "$ EC"
in
"$ Usage_ec") # usage error
Error = "Usage: / t $ prog deficename / n" 1> & 2
;
"$ Notap_ec") # TAPE Error
Error = "Error: / t $ dev: $ device is not available on the system./n" 1> & 2
;
"$ Liste_ec") # List Error
Error = "Error: / T $ PROG: COULD NOT CREATE TAR LIST for $ logname. / n" 1> & 2
;
"$ Notar_ec") # tar command error
Error = "Error: / T $ PROG: TAR Command Failed./n" 1> & 2
;
"$ PIPEP_EC") #PIPE Error
Error = "Error: / T $ PROG: MKNOD COMMAND FAILED./N" 1> & 2
;
"$ Norsh_ec") # rsh errorerror = "Error: / T $ PROG: RSH - Remote Shell Command Failed./N" 1> & 2
;
"$ Rhost_ec") # Remote Host Error
Error = "Error: / t $ prop: remote host unknown./n" 1> & 2
;
*)
;
ESAC
Case "$ device"
in
#
# FIX The Block Size IF $ Device Is A Tape Device
#
/ DEV / RMT [0-9] *)
Echo "/ N / T $ PROG: REWINDING TAPE to Begin ......... (please wait) / n"
TCTL -F $ Device Rewind 2> / dev / null
;
*) ;;
ESAC
RM -F $ {list} $ {pipe} 2> / dev / null
[-n "$ error"] && echo "/ n $ {error} / n"
TRAP '' 0 1 2 15
EXIT "$ EC"
}
#
# Variables
#
USAGE_EC = 1 # EXIT CODE for Usage Error
NOMNT_EC = 2 # EXIT CODE WRONG Device Name
NOTAP_EC = 3 # EXIT CODE NO TAPE AVAILABLE
Liste_ec = 4 # exit code backup List Error
NOTAR_EC = 5 # EXIT CODE for WRONG TAR
Trapp_ec = 6 # EXIT CODE for TRAP
PIPEP_EC = 7 # EXIXE for PIPE
Rhost_ec = 8 # EXIT code for Bad ping
Norsh_ec = 9 # EXIT CODE for Bad RSH
Device = "$ 1" # Device to Tar Into
List = "/ tmp / .tar. $ Logname. $$" #
Remoteh = "# Remote Host for Backup
Remotet = "# Remote Tape for Backup
TapeDev = #
PIPE = "/ tmp / pipe" # Pipe for remote backup
#
# main ()
#
TPUT CLEAR
Echo "/ N / T $ PROG Started from $ logname @ $ Host On $ TEERM AT $ TODAY. / N"
RM -F $ LIST 2> / dev / null #
# Trap on exit / interrupt / break to clean up
#
Trap "Cleanup $ Trapp_ec /" Abnormal Program Termination. $ PROG "/" 0 1 2 15
#
# Check command Options
#
["$ #" -ne 1] && cleanup "$ usage_ec" ""
#
# Check device name
#
[`EXPR" $ device ":" [/] "` -eq 0] && cleanup "$ nomnt_ec" /
"$ PROG: Backup Device OR File Name Must Start with a '/'."
#
# Check Tape Device
#
Case "$ device"
in
#
# FIX The Block Size IF $ Device Is A Tape Device
#
/ DEV / RMT [0-9] *)
#
Echo "/ N / T $ PROG: VERIFY Backup Media ($ Device) .......... / n"
#
# See ififf a low or limited time density Tape Device WAS Specified
# (EG RMT0.1)
Density = "` EXPR $ Device: /
"/ DEV / RMT [0-9] * /. / ([0-9] * /)" `"
#
# strip / dev / from device name and
# Get the base name (eg translate:
# /DEV /RMT0.2 TO RMT0)
#
TapeDev = "` EXPR $ Device: /
"/ dev // (RMT [0-9] * /) [/.] * [0-9] *" `"
#
# Check if the tape is defined in the system.
LSDEV-C Tape -s Available -f "Name" | GREP $ TAPEDEV> / DEV / NULL 2> & 1
RC = $?
["$ rc" -ne 0] && cleanup "$ notap_ec" ""
#
# RESTORE OLD TAPE NAME.
#
["$ {Density: -1}" --lt 4] && Density = 1 || Density = 5
Device = "/ dev / $ {tapedev}. $ {Density}
Echo "/ N / T $ PROG: INSERT A TAPE IN ($ Device) ........ (press enter) / n"
Read Temp
echo "/ N / t $ prop: rebinding Tape to Begin ........... (please wait) / n"
TCTL -F $ Device Rewind 2> / dev / null
;
#
# Backup is Done on Remote Host. The Remote Shell Facility
#must be set up and running.
#
$ {Pipe} *)
#
Echo "/ N / T $ PROG: Assuming Remote Backup Via Network./n"echo" / t $ prop: Enter name of remote host ===> / c "
Read Remoteh
Echo "/ N / t $ prop: pinging remote host to test connection./n"
Ping $ {transoteh} 1 1> / dev / null 2> & 1
RC = $? # Give Up unknown host
["$ rc" -ne 0] && cleanup "$ rhost_ec" ""
Junk = $ (rsh $ {transoteh} "/ usr / sbin / lsdev -c -c Tape -s Available")
Rc = $? # Give Up rsh failed
["$ rc" -ne 0] && cleanup "$ norsh_ec" ""
Echo "/ T $ PROG: AVAILABLE TAPES ON $ {remoteh} area: / n / n / t / t $ {junk} / n"
Echo "/ t $ prop: Enter name of remote tape (E.g. / dev / rmt0) ===> / c"
Read Remotet
Echo "/ N / T $ PROG: INSERT TAPE ON $ {transoteh} in $ {remoteet} .. (press enter)
Read Temp
Echo "/ T $ PROG: REWINDING Remote Tape $ {remoteet} on $ {transoteh} ./ n"
RSH $ {transoteh} "tctl -f $ {remoteet} shutind"
Rc = $? # Give Up rsh failed
["$ rc" -ne 0] && cleanup "$ notap_ec" ""
RM -F $ {Pipe} 2> / dev / null
MKNOD $ {pipe} P
Rc = $? # Give Up Mknod failed
["$ rc" -ne 0] && cleanup "$ pipep_ec" ""
CAT $ {device} | rsh $ {remoteh} "DD of = $ {remoteet} OBS = 100b 2> / dev / null" &
;
*) ;;
ESAC
#
# Prepare the list
#
echo "/ N / t $ prop: CREATE LIST OF FILES to Be Saved ..."
Find $ homen -print> $ list
RC = $?
["$ rc" -ne 0] && cleanup "$ liste_ec" ""
#
# tar the files
#
Echo "/ N / T $ PROG: Changing current Directory to (/).... cc / / /> / 2 2 2 2 2
Echo "/ N / T $ PROG: Running Tar Format Backup from User ($ logname) ...."
TAR-CVF "$ authentic" -l "$ list"
Rc = "$?"
["$ rc" -ne 0] && cleanup "$ notar_ec" ""
#
# Backup completed
#
Today = $ (DATE % H:% M:% s)
Echo "/ N / t $ prog ended at $ ketay ............................ / n / n"
Cleanup 0
Subject: 8.06: How do I do remove backup? (Cont.)
From: henk van doorn <
hvdoorn@xs4all.nl>
#! / bin / ksh
######################################################################################################################################################################################################################################################################################################## #####################
# Rmksysb #
######################################################################################################################################################################################################################################################################################################## #####################
# # # # # # #
# Description: #
# Creates a bootable mksysb backup of a remote system running # #
# AIX 3.x or lists the table of contents of the current tape #
# # # # # # #
# Usage: #
# ./Rmksysb $ 1 [$ 2] #
# $ 1 - Remote Host to be backed up #
# $ 2 - OPTIONAL: LOCAL TAPE DEVICE (Default: RMT0) #
# ory #
# ./rmksysb -l [$ 2] #
# t list Table of Contents Saveset on Tape in $ 2 #
# (Only Useful on Tapes Created By Rmksysb) # #
# # # # # # #
# Output: #
# A bootable mksysb of the remote system ## or a listicing of the Toc Saveset on the current tape #
# # # # # # #
# Remarks: #
#. rmksysb can only Be buy by root #
#. This script will use tapedevice .1, so if #
# A> 2.3GB Drive is buy: Check Density_set_1 #
#. The remote host neseds /.rhosts to include the local host #
# For root access ( shell enabled in /etc/inetd.conf) #
#. You will need some room (> 1.5MB) on / tmp on the remote host #
# For standard mksysb .archive.list. * Etc. #
#. Remote Standard Output & Standard Error (Except Dd / Chdev) #
# Will Go To Local Stdout & Stderr #
#. Redirecting stdout can create Quite Large Log-Files (2MB) #
#. AIX Versions SHOULD NOT BE TOO FAR APART As The Boot-Saveset #
# Comes from the local system & the rest from the remote #
# (TESTED ON AIX 3.2.5, AIX 4 Definitely Won't work !!!) #
#. MOST LIKELY THIS Script Will Fail with multi-tape mksysb's: #
# Another incentive to keep rootvg as small as possible! #
# # # # # # #
# Author: #
# Henk Van Doorn #
# Email: hvdoorn@xs4all.nl #
# # # # # # #
# THANKS TO All WHO Contributed. Esp. Paul Wynn (aixpert '93), #
# My Colleagues Dominic Dinardo & Douwe Van Terwisga #
# The Input from UseNet Were Stimulating; Thanks Folks! #
# I Well Welcome Any Additions & Changes for the Better ... #
# # # # # # #
######################################################################################################################################################################################################################################################################################################## #####################
# Changes ################################################################################################################################################################################################################################################################################################# ################################
# # # # # # #
# Id WHO date descr #
# - - - ------------------------------- -------- #
# X000 hvd 6jan95 created this file. #
# X001 hvd 2Feb95 factory version #
######################################################################################################################################################################################################################################################################################################## #####################
SET U
# Global Variable definitions.
Umask = `umask`
BLK_SZ = 1024
Boot_blk_sz = 512
Host = $ {1}
# TAPE = $ 2 with / dev / &. * Removed, defaulting to rmt0
TAPE = $ {2: -rmt0}
TAPE = $ {TAPE # / dev /}
TAPE = $ {TAPE%. *}
USAGE ()
{
echo "Usage: ./rmksysb
echo "./rmksysb -l [
echo "with
Echo "default
Return
}
Check_parms ()
{
IF ["$ {Host}" = ""]
THEN
USAGE
EXIT 1
Fi
IF ["$ {host}" = "-l"]
THEN
# show Toc Block Which Contains Some Backup Details on RMksysb Tapes
GET_TAPE_BLOCK_SIZE
ChDEV -L $ {TAPE} -a block_size = $ {boot_blk_sz}> / dev / null 2> & 1
MT -F / DEV / $ {TAPE} REWIND
MT -F /DEV/$ (Tape }.1 fsf 2
DD if = / dev / $ {TAPE} count = 1 2> / dev / null
ChDEV -L $ {TAPE} -a block_size = $ {old_blk_sz}> / dev / null 2> & 1
Exit
Fi
}
Check_host ()
{
RSH $ {Host} Hostname> / dev / null 2> & 1
IF [$? -ne 0]
THEN
Echo "Check Hostname & RSH Access"> & 2Exit 1
Fi
}
GET_TAPE_BLOCK_SIZE ()
{
Valid =
`lsdev -cc tape | cut -f1 -d" "| GREP $ {TAPE} 2> & 1> / dev / null` &&
{
Old_blk_sz = `lsattr -el $ {tape} -a block_size | cut -f2 -d" "`
Valid = TRUE
}
IF ["$ VALID" = ""]
THEN
Echo "Tape Drive $ TAPE IS NOT A VALID LOCAL DRIVE!"> & 2
EXIT 1
Fi
}
#
# The main procedure is analogous to its c counterpart,
# This is the basic driver routine.
#
Main ()
{
IF ["` ID | grep 'uid = 0'` "=" "]
THEN
Echo "RMksysb Can Only Be Run As Root!"> & 2
EXIT 2
Fi
Umask 022
Check_parms
Check_host
GET_TAPE_BLOCK_SIZE
# Display Some Info on this Rmksysb Session
Echo "` date` / n / nremote system backup from remote $ {host} to local `hostname` on device: / n`lscfg -v -n '{tape} | SED-N' 3, 6p '| grep" [ AZ] "` / n "
# Here the an action starts
RSH $ Host-N / USR / BIN / MKSZFILE
RSH $ host -n "echo $ {blk_sz}> / Tapeblksz"
RSH $ Host -n "RM -F /TMP/PIPE.rmksysb"
RSH $ Host -n "RM -F /TMP/PIPE.rmksysb.out"
RSH $ host -n "rm -f /tmp/pipe.rmksysb.err"
RSH $ host -n "/ etc / mknod /tmp/pipe.rmksysb p"
RSH $ host -n "/ etc / mknod /tmp/pipe.rmksysb.out p"
RSH $ host -n "/ etc / mknod /tmp/pipe.rmksysb.err p"
# CREATE Remote Startup File for MKinSttape
RSH $ host -n "echo '#! / bin / ksh / nexport path = $ path; / usr / sbin / mkinsttape /tmp/pipe.rmksysb> /tmp/pipe.rmksysb.out 2> /tmp/pipe.rmksysb .err & '> /tmp/mkinsttape.start "
RSH $ host -n "chmod 700 /tmp/mkinsttape.start "chdev -l $ TAPE -A Block_size = $ {boot_blk_sz}> / dev / null 2> & 1
TCTL -F / DEV / $ {TAPE} Retension
echo
echo
Echo ">>> Saveset 1: bos boot image from` Hostname`
echo
Bosboot -d /dev/ $ $ $ $ ${
echo
echo
Echo ">>> Saveset 2: BOS Install Utilities from $ {Host} (Backup Format)
echo
RSH $ host -n "nohup /tmp/mkinsttape.start" &
# Get Remote Standard Out & Err To Local Stdout & Err
RSH $ Host -n "DD if = / tmp / pipe.rmksysb.out 2> / dev / null" | DD 2> / dev / null &
RSH $ host -n "dd if = / tmp / pipe.rmksysb.err 2> / dev / null" | (DD 2> / dev / null)> & 2 &
# Get Remote Mkinsttape to Local Tape Device
RSH $ host -n "dd if = / tmp / pipe.rmksysb 2> / dev / null" | DD 2> / dev / null | DD OF = / dev / $ {tape} .1 conv = sync 2> / dev / NULL
echo
echo
Echo ">>> Saveset 3: Backup Information (List with ./rmksysb -l [
echo
# Add dummy Toc To Tape with some backup information
Echo "` date` / n / nremote system backup from remote $ {host} to local `hostname` on device: / n`lscfg -v -n '{tape} | SED-N' 3, 6p '| grep" [ AZ] "` / n "| DD of = / dev / $ {TAPE} .1 conv = sync 2> / dev / null
# Change Blocksize to 1024 for Better Performance
ChDEV -L $ {TAPE} -a block_size = $ {blk_sz}> / dev / null 2> & 1
# REWIND & SKIP FIRST 3 SAVESETS
MT -F / DEV / $ {TAPE} REWIND
MT -F /DEV/$ (Tape }.1 fsf 3
echo
echo
Echo ">>> Saveset 4: mksysb (rootvg backup) from $ {host} (TAR FORMAT)
echo
# Start the actual remote mksysb
Echo "The Contents of the /.fs.size file on $ {host} area:" rsh $ host -n "cat /.fs.size"
echo
RSH $ host -n "nohup / usr / bin / mksysb> /tmp/pipe.rmksysb> /tmp/pipe.rmksysb.out 2> /tmp/pipe.rmksysb.err &"
# Get Remote Standard Out & Err To Local Stdout
RSH $ Host -n "DD if = / tmp / pipe.rmksysb.out 2> / dev / null" | DD 2> / dev / null &
RSH $ host -n "dd if = / tmp / pipe.rmksysb.err 2> / dev / null" | (DD 2> / dev / null)> & 2 &
# get remote mksysb to local Tape Device
RSH $ host -n "dd if = / tmp / pipe.rmksysb 2> / dev / null" | DD OBS = $ {BLK_SZ} 2> / dev / null | DD of = / dev / $ {TAPE} BS = $ {BLK_SZ} conv = sync 2> / dev / null
# c cing up
RSH $ Host -n "RM -F /TMP/PIPE.rmksysb"
RSH $ Host -n "RM -F /TMP/PIPE.rmksysb.out"
RSH $ host -n "rm -f /tmp/pipe.rmksysb.err"
RSH $ host -n "rm -f /tmp/mkinsttape.start"
ChDEV -L $ {TAPE} -a block_size = $ {old_blk_sz}> / dev / null 2> & 1
umask $ umask
# Display Some Closing Info on this Rmksysb Session
Echo "Remote System Backup from Remote $ {Host} to local` Hostname` is finished./n`date`/n
} #END of main
# Call the Driver
main
Subject: 8.07: How To Configure Dialup Slip
[Formerly In Section 1.606 Part 5]
#! / bin / ksh
# Slip login .profile
# Adapted from Comp.Unix.Aix FAQ
# by davide migliavacca
Davide.migliavacca@inferentia.it)
# $ Revision: 1.14 $
# Set this variable! = 0 to allow Multiple Logins from this userid
Allow_multiple_logins = 0
# NOTE: Script Currently Determines Destination IP Address from The Slip
# Interface Attributes, But It Assumes a Correspondence
# TTYXX <-> SLIPXX
# (See the "ipaddress =" awk line) # ip ipLies ON a client being able to read the ip address from
# The logon procedure output.
PATH = / usr / bin: / etc: / usr / sbin: / usr / ucb: $ homen / bin: / usr / bin / x11: / sbin: / usr / local / bin :.
Export Path Env Histsize
#
# Search for a Lck-file for ours for ur Tty if there is one
#
TTYDEV = `Tty`
TTYBASENAME = `basename $ TTYDEV`
TTYNUMBER = `Echo $ TTYBASENAME | SED -N -E" S / TTY / ([0-9] / {1, /} // 1 / p "`
IF [-f /etc/locks/lck..ttybasename];
Then Shpid = `Cat / etc / locks / lck .. $ TTYBASENAME`;
Else {
/ usr / bin / logger -t slip -p error "No LCK File for $ TTYDEV"
EXIT 64;
}
Fi;
# Search for Another Login from this userid
Otherslip = `ps -fu $ user |
Sed -n -e "s / ^ * $ user * [0-9] [0-9] *. * -. * // usr // sbin // slattach / (TTY [0-9] / {1, /} /) * $ // 1 / p`;
IF [! -z "$ ERSLIP"];
THEN
IF [$ allow_multiple_logins -eq 0];
THEN
Echo "Sorry, You are already connected to $ taherslip.";
Echo "Multiple Logins Are Not ALLOWED."
echo "for any question, contact
Helpdesk@inferentia.it ";
/ usr / bin / logger -t slip -p warn "$ user: Attempt to Connect On $ TTYBASENAME WHEN ALREADY Connected On $ Otherslip - Refused";
EXIT 64;
Fi
#ELSE ...
/ usr / bin / logger -t slip -p Warn "$ user: multiple login allowed, now uses also $ ttybasename";
Fi
#
# Search for u s sell to get the pid for checking against LCK-File
#
SH2PID = `ps -ft $ ttynumber |
Sed -n -e "s / ^ * $ user * / ([0-9] [0-9] * /). * -. * sh * $ // 1 / p`
#
# Is it the the same pid as in the Lck File So That We Can Start Working ??
Debug = 0
IF [$ debug-eq 1];
THEN
Echo TTYDEV: $ TTYDEV
Echo TTYBaseName: $ TTYBASENAME
Echo User: $ usecho shpid: $ SHPID
Echo SH2PID: $ SH2PID
Fi
IF [$ SHPID "-EQ" $ SH2PID "];
THEN
# Remove The Lck-File Because Slattach Does Not Like IT.
Rm -rf /etc/locks/lck feathers
# Add rts / cts Handshakeing to Our OWN TTY: Better Do IT IN / ETC / RC,
# Using the program from the comp.unix.Aix FAQ.
# Stty add rts
SLIPLINE = `Echo $ TTYBASENAME | awk '// {print substr ($ 1,4);}'`
Ipaddress = `lsattr-E -l SL $ SLIPLINE -A DEST 2> / dev / null | awk '// {print $ 2;}'`
IF [-z "$ ipaddress"]
THEN
/ usr / bin / logger -t slip -p error "$ user: attempt to use tty with no slip interface defined ($ TTYBASENAME)"
Echo "this TTY ($ TTYBASENAME) HAS NOT BEEN Enabled for Slip. Please try the iOnother One or Contact The System Administrator.
EXIT 64
Fi
Echo Slip Starting. Your IP Address IS $ ipaddress
/ usr / sbin / slattach $ TTYBASENAME
. # Get The Pid of slattach so. We can kill Him Later on.
SLPID = `ps --aef |
Sed -n -e "s / ^ * $ user * / ([0-9] [0-9] * /). * -. * // usr // sbin // slattach $ TTYBASENAME * $ / // 1 / P`
# Just Say That We Are Up.
Logger -t slip -p info "$ user: Starting Up Daemon (PID $ SLPID) FOR [$ ipaddress] on $ TTYDEV"
Else
# Something Must Be Wrong with the Lck-file
SH3PID = `ps --aef | awk '{print $ 2}' | GREP $ SHPID`
IF [. "$ sh3pid" =. ""]
THEN
SH3PID = "no_such_process"
Fi
IF [$ SHPID = $ SH3PID]
THEN
# There is a living process which oowns the lck-file !!
/ usr / bin / logger -t slip -p error "$ user: Cannot Remove Lck File for $ TTYDEV (NOT OWNER)"
EXIT 64
Else
# WHO The Hell Didn't Remove The Lck-file (SHOULD NEVER HAPPEN)
/ usr / bin / logger -t slip -p error "$ user: Lck File for $ TTYDEV FOUND with no owner" #echo `date`" Lck-file with nowner found !!! >> $ SLIPLOG
EXIT 64
Fi
Fi
IF [$ debug-eq 1]
THEN
/ usr / bin / logger -t slip -p debug "$ user: going to trap sign ..."
Fi
Nov 28 11:18:46 Sauternes Rexecd [21420]: Connect from Brachetto.inferentia.it
# Terminated)
Trap "Kill $ SLPID; / USR / BIN / LOGGER-TLIP -P INFO /" $ USER: KILLING DAEMON (PID $ SLPID) For $ TTYDEV / "; EXIT 0" 1
IF [$ debug-eq 1]
THEN
Trap "/ usr / bin / logger -t slip -p debug /" $ user: trap err / "" ERR
Trap "/ usr / bin / logger -t slip -p debug /" $ user: trap 0 / "0
Trap> /tmp/trap. #ttybasename.log
/ usr / bin / logger -t slip -p debug "$ user: trap return $? ..."
Fi
# We Will Have a Nice Sleep and nice Dreamings
IF [$ debug-eq 1]
THEN
/ usr / bin / logger -t slip -p debug "$ user: going to sleep-loop ..."
Fi
While [True];
DO
Sleep 60;
DONE
# Sanity Check (SHOULD NEVER HAPPEN ...)
/ usr / bin / logger -t slip -p error "$ user: error: .profile broomen"
Subject: 8.08: Disabling Software Flow Control; Using RTS / CTS.
[Formerly In Section 1.613]
/ * This Program is an adaptation of a program provided by IBM Defect Support.
IT is provided without warrantee, or support.
The syntax of the command is:
Setrts Tty [Tty [TTY [...]]]]]
The Program Will Loop Through Each Tty Provided On The Command Line, And
Turn on the 'RTS' Line Discipline. The Program Does Not Require That
THE Carrier Detect Signal Be Held High To Keep The Serial Device from
Blocking on the Attempt to Open It. The Program Works for all valid ttys.
Bugs: None That Are Known; However, Using The Program To Set 'Ptys' Maycause The 'Pty' To Become Unusable.
This Program Was Written by Robin D. Wilson, Pencom Software (with the
Specific 'ioctl ()' Call Provided by The IBM Defect Support Center.
I call it: "setrts"
To Compile:
cc -o-setrts setrs.c
Strip set
(Funny, But if you strip with the compiler (i.e., cc -s), you end up with
120 EXTRA BYTES in the Executable ...)
* /
#include
#include
#include
#include
#include
#include
#include
#define devdir "/ dev /"
#define Linedisp "RTS"
Main (Argc, Argv)
Int argc;
Char ** argv;
{
Int TTY;
Char TTYNAME [MAXPATHLEN];
/ * Give a 'usage' recommendation if they don't provide an argument * /
IF (argc <2) {
FPRINTF (stderr, "usage:% s
EXIT (-1);
}
/ * OtherWise, Loop THROUGH All the arguments ... * /
Else While (--Argc> = 1) {
Argv ;
/ * Check to see eti the input the 'Tty' Names with the devdir on them ...
* If not, Put it on ...
* /
IF (Strncmp (Devdir, Argv [0], Strlen (devdir))! = 0) {
STRCPY (TTYNAME, DEVDIR);
STRCAT (TTYNAME, Argv [0]);
}
Else
STRCPY (TTYNAME, Argv [0]);
/ * Open the TTY. Use the Non-blocking open (o_ndlay) To Open WITHOUT A
* Carrier (CD) Present on the line ...
* /
IF ((TTY = Open (TTYNAME, O_RDWR | O_NDELAY)) <0) {
FPRINTF (stderr, "% s: couldn't open tty device./n" ,ttyname);
EXIT (-2);
}
/ * Add the 'RTS' line discipline ... * /
(void) IOCTL (TTY, TXADDCD, LINEDISP);
(void) Close (TTY);
}
}
Subject: 8.09: How can I HACK LIBC.A To ALTER How Hostnames Are Resolved? [Formerly in section 1.618]
[Editor's Note: you might want to see quothes 2.07 for advice on
Recovering from a deleted or corrupted libc.a before attempting this
Hack. Note That this Procedure Is for Aix 3.2 ONLY --- AIX 4.x Already
HAS a supported method of controling name resolution. See Question 1.800.
1. Get The Resolv Source (I see a copy on ftp.u.net in networking / ip / dns
And There Are LIKELY COPIES ELSEWHERE). WE Are Using Version 2.1.1,
Which Appears to Be The Latest Available. Gethostnamadr.c Needs a Couple
of additions:
23A24, 26
> #ifdef _aix
> #include
> #ENDIF
35A39, 41
> #ifdef _aix
> #include
> #else
36A43
> #ENDIF
2. Use the folowing instead of the support shlib / makefile:
Libp = gethostnamadr.o Herror.o RES_DATA.O RES_QUERY.O RES_MKQUERY.O /
SetHostent.o Res_send.o res_debug.o res_
Comp.o res_init.o
Cflags = -o -d_bsd = 43 -d_no_proto -dnis -ddebug -u__str__
All: shr.o
SHR.O: $ (lib) setup
LD -O $ @ /Lib/syscalls.exp $ (lib) tmp.o -bm: Sre -be: shr.exp -be: /lib/syscalls.exp -bi: crypt.imp -h512 -t512 -bh: 4 -lc
Setup:
RM -F libc.a crypt.imp
CP /LIB/LIBC.A.
CHMOD 755 Libc.a
Ar xv libc.a shr.o
/ bin / dump -nv shr.o | GREP Exp | awk '{print $$ nf}'> shr.exp
ld -o tmp.o -bnso shr.o -r
@ echo '#!'> CRYPT.IMP
@ echo __crypt >> CRYPT.IMP
@ echo __setkey >> CRYPT.IMP
@ echo __encrypt >> CRYPT.IMP
Clean:
Rm -f shr.o tmp.o crypt.imp shr.exp $ (lib) libc.a
Install_libc: install_libc.c
Cc -o $ @ @STALL_LIBC.C -BNSO -BI: /LIB/SYSCALLS.EXPHERROR.O: ../herror.c
$ (Cc) $ (cflags) -c ../herror.c
RES_COMP.O: ../RES_
Comp.c
$ (Cc) $ (cflags) -c ../res_
Comp.c
Res_debug.o: ../res_debug.c
$ (Cc) $ (cflags) -c ../res_debug.c
Res_data.o: ../res_data.c
$ (Cc) $ (cflags) -c ../res_data.c
Res_init.o: ../res_init.c
$ (Cc) $ (cflags) -c ../res_init.c
RES_MKQUERY.O: ../res_mkquery.c
$ (Cc) $ (cflags) -c ../res_mkquery.c
Res_Query.o: ../res_query.c
$ (Cc) $ (cflags) -c ../res_query.c
Res_send.o: ../res_send.c
$ (Cc) $ (cflags) -c ../res_send.c
Gethostnamadr.o: ../gethostnamadr.c
$ (Cc) $ (cflags) -c ../gethostnamadr.c
Sthostent.o: ../sethostent.c
$ (Cc) $ (cflags) -c ../sethostent.c
Strpbrk.o: ../strpbrk.c
$ (Cc) $ (cflags) -c ../strpbrk.c
STRERROR.O: ../strerror.c
$ (Cc) $ (cflags) -c ../strerror.c
3. As shipped, ibm's /lib/syscalls.exp contains an entry for for for for for for fork ().
Needs to be removed as it will cause the new shr.o to use the system call
Entry Point Rather Than THE LIBRARY Wrapper and this Can Cause Some Rather
Odd Behavior. for Example, I Ran Across One Using The '!' Command IN VI
WHERE The Error / INFORMATIONAL MESSAGES WERE CORRUPTED.
4. You can use "ar r libc.a shr.o" but this will Leave a big hole in libc.a,
Since the new shr.o is slightly big than the original. i always extract
All the .o's from libc.a and build a brand new one - suit yourself.
5. Before The next step, You'll Want to Set Up Up Up Up.
THE FIRST IS /ETC/Resolv.conf and it is Basically the Same as Before
Except for the New Keyword "Search" - Intended to Replace The "Domain". See
The Resolver.5 Manual Page for Details (Included with The Resolv Source).
The Other File is /etc/host.conf, Which is where you set the order ofsearch. See resolv .8 for information on this.
6. Now, The Only Tricky Part Left Is To Get The New Libc.a Installed. You'll
Note The makefile has a target for install_libc. Just Put The Following
In Install_lib.c and run "make install_libc" to build.
------------------------------- Begin install_libc.c --------------- ------------
#include
Static char * nodns [= {"/usr/ccs/lib/libc.a", "/usr/ccs/lib/libc.a.orig"}
Static char * HASDNS [] = {"/usr/ccs/lib/libc.a.new", "/usr/ccs/lib/libc.a"}
#define old (0)
#define new (1)
Main ()
{
IF (Link (Nodns [OLD], NODNS [New])) {
PERROR ("link");
Exit (1);
}
IF (unlink (NODNS [OLD])) {
PERROR ("unlink");
Exit (1);
}
IF (HasDNS [OLD], Hasdns [New])) {
PERROR ("link");
Exit (1);
}
IF (unlink (HasDNS [OLD])) {
PERROR ("unlink");
Exit (1);
}
exit (0);
}
------------------------------- End install_libc.c --------------- ----------------
7. You'll Want to Do this ON A Quiet Machine. Move The New Libc.a To
/usr/ccs/lib/libc.a.new, Then Run Install_libc. IT IS PROBLY A Good
Idea to Reboot AfterWords (Though Not Strictly Required). WE Have A Similar
PROGRAM CALLED RESTORE_LIBC (EXERCISE for the reader for backing out the
Change.
Rather Than Do this on Every Machine (WE Have 170 RS / 6000's), I Simply
Put this New Libc.a Into My Network-Installable Image, Which i Blasted
Out over the year-end holiday break (i created a method for loading a new
Image Onto Machines without Having to Boot Off of Floppies and Turn Keys.
Of Course, for The Really Cautious, You Can Always Make The Change Insterbooting Off of the Maintenance Floppies ...
Subject: 8.10: How do i make an export list from a library archive?
[Formerly In Section 2.17]
This Script Will Only Extract The "Export" Able Names and Should Be
Useful in Starting The Shared Library Creation Process. The User MUST
DETERMINE Which Names Should Be Included in The Import and Export Lis.
IT's Only Been Tested On A Few Library Archives.
#! / bin / ksh
#
# MKEXPS - MAKE EXPORT LIST
# This program creates an export list by combining all the "." And Normal Names
# ion inte list.
#
IF [[["$ #" -ne 1]]]
THEN
Print "Usage: MKEXPS Archivefile"
EXIT-2
Fi
IF [[! -f $ 1]]]]
THEN
Print "MKEXPS: Cannot Open file /" $ 1 / ""
EXIT -1
Fi
DUMP -G $ 1 | awk '
Begin {
TOP = 1
}
/ ^ [] * [0-9] [0-9] * / {
IF ((N = Index ($ 2, "))> 0) {
Export_Array [TOP ] = Substr ($ 2, N 1, Length ($ 2))
}
Else {
Export_Array [TOP ] = $ 2
}
}
End {
For (i = 1; i { Print export_Array [i] } } '| sort | Uniq