home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / programm / 5332 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  2.3 KB

  1. Xref: sparky comp.unix.programmer:5332 comp.sys.sun.misc:5314
  2. Newsgroups: comp.unix.programmer,comp.sys.sun.misc
  3. 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
  4. From: casper@fwi.uva.nl (Casper H.S. Dik)
  5. Subject: Re: Installing a shared library without screwing up.
  6. Message-ID: <1992Nov18.101840.7688@fwi.uva.nl>
  7. Keywords: libc.so replacing
  8. Sender: news@fwi.uva.nl
  9. Nntp-Posting-Host: adam.fwi.uva.nl
  10. Organization: FWI, University of Amsterdam
  11. References: <mark.722062866@coombs>
  12. Date: Wed, 18 Nov 1992 10:18:40 GMT
  13. Lines: 43
  14.  
  15. mark@coombs.anu.edu.au (Mark) writes:
  16.  
  17. >On SunOS 4.x.x:
  18. >I've heard a lot of horror stories about mistakes with libc.so replacing and
  19. >how dynamic library loading programs die real quick if you tamper with their
  20. >library.
  21.  
  22. >What is the right/best way to replace a libc.so with your site customised
  23. >version? I dont want to have to go find the installation tape everytime
  24. >I attempt it. Do I use 'cp' or 'cat mylib > /usr/lib/libc.so' or what? Im a
  25. >bit worried that a context switch will happen halfway through it and bugger
  26. >it all up.
  27.  
  28. >How would you guys replace it?
  29.  
  30. The best way is probably to install the new library with the
  31. next highest tiny revision number. E.g., if you have libc.so.1.7.1,
  32. you install the new lib as libc.so.1.7.2. Rember that you MUST also
  33. install a new version of libc.sa as libc.sa.1.7.2. (link or copy
  34. the old one, if you haven't changed anything).
  35.  
  36. Never cp or cat over the current version of libc.so, all programs
  37. using it will crash (even if the old and the new libc are
  38. byte for byte identical, there is a high probabliity. There's a 100%
  39. chance of this happening when both libraries aren't identical)
  40. Even removing the old one after this steps is not safe when /usr is shared
  41. over NFS.
  42.  
  43. What we do is:
  44.  
  45.     cp mylib /usr/lib/newlibc.so
  46.     mv /usr/lib/newlibc.so /usr/lib/libc.so.X.Y.Z
  47.     ln /usr/lib/libc.sa.X.Y /usr/lib/libc.sa.X.Y.Z
  48.     ldconfig
  49.  
  50.  
  51. You can copy to the new name in one step, but using a cp followed by
  52. a move will never give you an invalid libc.so in /usr/lib while just
  53. a cp gives you a small period in which a invalid libc.so exists which
  54. could give soe of your users problems. But usually, the ld.so cache
  55. prevents problems like that.
  56.  
  57. Casper
  58.