home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.programmer:5342 comp.sys.sun.misc:5328
- Newsgroups: comp.unix.programmer,comp.sys.sun.misc
- 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
- From: emike@sdc.com (E. Mike Durbin)
- Subject: Re: Installing a shared library without screwing up.
- Message-ID: <1992Nov18.183613.6637@sdc.com>
- Keywords: libc.so replacing
- Sender: news@sdc.com (Netnews administrator)
- Nntp-Posting-Host: louie
- Organization: Systems Development Corporation
- References: <mark.722062866@coombs>
- Date: Wed, 18 Nov 1992 18:36:13 GMT
- Lines: 36
-
- In article <mark.722062866@coombs> 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?
- >
- >Any hints welcome.
- >Mark
- >mark@coombs.anu.edu.au
- >mark@gnu.ai.mit.edu
- >markm@rmit.edu.au
-
- The problem is with any executable, binary or shell script. SunOS uses
- the origional file as backing store, so if it is modified while it is
- running, you have problems.
-
- Because the kernal identifies any file by it's inode, use 'mv' to
- maintain the integrity of any file that is memory mapped:
-
- mv libc.so.3.1 libc.so.3.1.old
-
- before overwritting it (again, same is true for shell scripts and
- any binary executable). Then, after you know that the '.old' file
- is no longer referenced (wait a day, week, month?), you can remove
- it.
-
- E. Mike Durbin
- emike@sdc.com or emike@obs.com
-