home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.programmer:5332 comp.sys.sun.misc:5314
- Newsgroups: comp.unix.programmer,comp.sys.sun.misc
- Path: sparky!uunet!usc!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!news.netmbx.de!Germany.EU.net!mcsun!sun4nl!fwi.uva.nl!casper
- From: casper@fwi.uva.nl (Casper H.S. Dik)
- Subject: Re: Installing a shared library without screwing up.
- Message-ID: <1992Nov18.101840.7688@fwi.uva.nl>
- Keywords: libc.so replacing
- Sender: news@fwi.uva.nl
- Nntp-Posting-Host: adam.fwi.uva.nl
- Organization: FWI, University of Amsterdam
- References: <mark.722062866@coombs>
- Date: Wed, 18 Nov 1992 10:18:40 GMT
- Lines: 43
-
- 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?
-
- The best way is probably to install the new library with the
- next highest tiny revision number. E.g., if you have libc.so.1.7.1,
- you install the new lib as libc.so.1.7.2. Rember that you MUST also
- install a new version of libc.sa as libc.sa.1.7.2. (link or copy
- the old one, if you haven't changed anything).
-
- Never cp or cat over the current version of libc.so, all programs
- using it will crash (even if the old and the new libc are
- byte for byte identical, there is a high probabliity. There's a 100%
- chance of this happening when both libraries aren't identical)
- Even removing the old one after this steps is not safe when /usr is shared
- over NFS.
-
- What we do is:
-
- cp mylib /usr/lib/newlibc.so
- mv /usr/lib/newlibc.so /usr/lib/libc.so.X.Y.Z
- ln /usr/lib/libc.sa.X.Y /usr/lib/libc.sa.X.Y.Z
- ldconfig
-
-
- You can copy to the new name in one step, but using a cp followed by
- a move will never give you an invalid libc.so in /usr/lib while just
- a cp gives you a small period in which a invalid libc.so exists which
- could give soe of your users problems. But usually, the ld.so cache
- prevents problems like that.
-
- Casper
-