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

  1. Xref: sparky comp.unix.programmer:5342 comp.sys.sun.misc:5328
  2. Newsgroups: comp.unix.programmer,comp.sys.sun.misc
  3. Path: sparky!uunet!ferkel.ucsb.edu!taco!rock!stanford.edu!bcm!cs.utexas.edu!zaphod.mps.ohio-state.edu!rpi!newsserver.pixel.kodak.com!laidbak!tellab5!sdc!emike
  4. From: emike@sdc.com (E. Mike Durbin)
  5. Subject: Re: Installing a shared library without screwing up.
  6. Message-ID: <1992Nov18.183613.6637@sdc.com>
  7. Keywords: libc.so replacing
  8. Sender: news@sdc.com (Netnews administrator)
  9. Nntp-Posting-Host: louie
  10. Organization: Systems Development Corporation
  11. References: <mark.722062866@coombs>
  12. Date: Wed, 18 Nov 1992 18:36:13 GMT
  13. Lines: 36
  14.  
  15. In article <mark.722062866@coombs> mark@coombs.anu.edu.au (Mark) writes:
  16. >On SunOS 4.x.x:
  17. >I've heard a lot of horror stories about mistakes with libc.so replacing and
  18. >how dynamic library loading programs die real quick if you tamper with their
  19. >library.
  20. >
  21. >What is the right/best way to replace a libc.so with your site customised
  22. >version? I dont want to have to go find the installation tape everytime
  23. >I attempt it. Do I use 'cp' or 'cat mylib > /usr/lib/libc.so' or what? Im a
  24. >bit worried that a context switch will happen halfway through it and bugger
  25. >it all up.
  26. >
  27. >How would you guys replace it?
  28. >
  29. >Any hints welcome.
  30. >Mark
  31. >mark@coombs.anu.edu.au
  32. >mark@gnu.ai.mit.edu
  33. >markm@rmit.edu.au
  34.  
  35. The problem is with any executable, binary or shell script.  SunOS uses
  36. the origional file as backing store, so if it is modified while it is
  37. running, you have problems.
  38.  
  39. Because the kernal identifies any file by it's inode, use 'mv' to
  40. maintain the integrity of any file that is memory mapped:
  41.  
  42.     mv libc.so.3.1 libc.so.3.1.old
  43.  
  44. before overwritting it (again, same is true for shell scripts and
  45. any binary executable).  Then, after you know that the '.old' file
  46. is no longer referenced (wait a day, week, month?), you can remove
  47. it.
  48.  
  49. E. Mike Durbin
  50. emike@sdc.com  or  emike@obs.com
  51.