home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.programmer:5330 comp.sys.sun.misc:5312
- Path: sparky!uunet!ogicse!henson!n8743196
- From: n8743196@henson.cc.wwu.edu (Jeff Wandling)
- Newsgroups: comp.unix.programmer,comp.sys.sun.misc
- Subject: Re: Installing a shared library without screwing up.
- Keywords: libc.so replacing
- Message-ID: <1992Nov18.095017.14952@henson.cc.wwu.edu>
- Date: 18 Nov 92 09:50:17 GMT
- Article-I.D.: henson.1992Nov18.095017.14952
- References: <mark.722062866@coombs>
- Organization: Howling Dog
- Lines: 49
-
- mark@coombs.anu.edu.au (Mark) writes:
-
- >On SunOS 4.x.x:
- >I've heard a lot of horror stories about mistakes with libc.so replacing and
- >how dynamic library loading programs die real quick if you tamper with their
- >library.
-
- >What is the right/best way to replace a libc.so with your site customised
- >version? I dont want to have to go find the installation tape everytime
- >I attempt it. Do I use 'cp' or 'cat mylib > /usr/lib/libc.so' or what? Im a
- >bit worried that a context switch will happen halfway through it and bugger
- >it all up.
-
- >How would you guys replace it?
-
- One way to test it without mucking up your system is to set the
- environment variable LD_LIBRARY_PATH to the directory where your
- newly created libc.so lives.. Like:
-
- example--
-
- % cd /usr/lib/shlib.etc
- % setenv LD_LIBRARY_PATH `pwd`
-
- Then you can run programs that will exercise the lib you've created.
-
- If you find a problem with your lib, and are able to
-
- % unsetenv LD_LIBRARY_PATH
-
- you'll be using the default libs and running with a clean lib once again.
-
- Once you are certain that aspects of your site-custom lib are ok, then you
- (as root) could cp it to /usr/lib, give it 755 perms and run ldconfig.
-
- By using the environment variable, you can at least test your lib without
- worrying about trashing other users's processes.
-
- I don't recommend doing this at times where a "crash" would be a *bad
- thing*. Also, keep track of the names of libc.so's in /usr/lib. Once
- I had a bad lib and had to remove it in single user mode. Leave the old
- libs alone.
-
- (See Also trace(1) and ldconfig(1))
-
- --
- perl -e '$a="Japhuneasorcttlk h eae r r ,";$]=0;$s=$];while($s<4){do{$_ .= pack
- ("c",vec($a,$],8));$]+=4;}while($]<length($a)&&vec($a,$],8)!=32);$s++;$]=$s;$_
- .= ' ';}chop;print;' Jeff Wandling <jdw@physics.wwu.edu> "will hack for food"
-