On Monday 19 December 2005 11:27, Gabe Yoder wrote:
> On Sunday 18 December 2005 07:14, Jeremy Henty wrote:
> > On Sun, Dec 18, 2005 at 03:04:06PM +1300, Peter Keller wrote:
> > > On Sunday 18 December 2005 09:31, Gabe Yoder wrote:
> > > > When it got to the install phase and zlib-1.2.3.so was
> > > > overwritten, a whole bunch of applications crashed.
> > >
> > > <etc>
> > >
> > > I believe that when one over-writes a library which is in use funny
> > > things can happen.
> >
> > That's my experience too.  I script a lot of things in Ruby so I
> > always have Ruby programs running.  When I upgrade the Ruby shared
> > library all those programs crash.  There are no problems after a
> > restart.
>
> That's interesting that other people have seen it with other things, but
> there must be a way around it.  I also have a Gentoo system, and I can use
> portage to rebuild zlib as much as I like, and I never get the problems
> that I have on my LFS system.  They must have some sort of voodoo hidden in
> there, so I guess I'll have to take a closer look at what they are doing. 
> If I find a solution, I'll post it here.

For those who are curious, I have found a way to avoid the troublesome 
crashes.  The library and the symlinks that alias the library (foo.1 -> 
foo.1.2.3) can be replaced by first making the new file/symlink and then 
using mv to overwrite the old file.  I haven't tested it yet, but it might be 
a requirement that both the source and destination be on the same partition 
for that to work correctly.  I believe that the reason this works and that 
some other things did not work is that mv uses the "rename" system call to 
atomically replace the original files.  The more straightforward approaches 
don't change things atomically and for some reason the running programs 
attempt to read the file when it is still in flux.  Using strace to observe 
the installation of zlib via portage (on a Gentoo system) revealed that 
indeed portage was using the rename system call to replace the library (thus 
explaining why it could replace the library without everything freaking out).
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to