[comp.unix.aix] LIBPATH

jsalter@slo (11/15/90)

In article <1028@casbah.acns.nwu.edu> roger@eccles.psych.nwu.edu (Roger Ratcliff) writes:
>By the way, each system should come with a big warning message:
>NEVER EVER mv libc.a.  You usually have to reload the system.

Heh, heh.  I remember learning about this around January during standards-
conformance testing.  The answer is two fold:

	1) You *can* move libc.a, but make sure that the LIBPATH environment
	   is set to the new directory.

	2) If you read the relevant portions of the load() subroutine, it
	   says:

		"... LIBPATH is ignored when the exec'd program has more
		 privilege than the caller, for example, in the case of an
		 suid program."

	   So, if want to make some mod's to libc.a, and *you know what you're
	   doing* (have read the INFO sections and practiced) you should make
	   a copy of original libc.a and set LIBPATH to look at your copy
	   first.

If you do a search for "LIBPATH" under Info, you should see quite a bit of
information on the subject.  If you don't think the information is complete
enough, open an APAR on the documentation.

>Roger

jim/jsalter  IBM AWD, Palo Alto  T465/(415)855-4427   VNET: JSALTER at AUSVMQ
Internet: jsalter@slo.awdpa.ibm.com         UUCP: ..!uunet!ibmsupt!jsalter 
  PS/2 it, or DIE!  :-)  The ramblings above have nothing to do with Big Blue.

marc@arnor.uucp (11/16/90)

The safe way to test a new version of libc.a is to 

mount /whatever/libc.a /lib/libc.a

and see if it works.  This will cause all subsequent uses of libc.a
to be the new one BUT, if you crash and reboot you're back to the old
one.

The safe way to replace libc.a is:

cd /lib
cp libc.a libc.a.orig (if you don't already have a backup IN /lib
cp /whatever/libc.a libc.a.new
sync
mv libc.a.new libc.a

mv is atomic - you'll either have the new or the old even if you crash
right then and there.

It is possible to fix libc.a if you've trashed it.

boot from diskettes.

/etc/continue hdisk0 exit

which stops the start up before anything is mounted.

you can then mount /dev/hd4 someplace and restore libc.a.  (At that
point, there is a copy in /lib/libc.a (from the diskette) which will
work.)  Make sure the diskettes are at the same level as the machine.