2002-04-05 14:46:42

by Ion Badulescu

[permalink] [raw]
Subject: Re: Strange NFS happenings

On Thu, 4 Apr 2002 22:39:26 -0800, Mike Castle <[email protected]> wrote:
> In article <[email protected]>,
> Trond Myklebust <[email protected]> wrote:
>>The internals of shared mmap() do not allow you to overwrite a library
>>that is already in use. Try using 'cp' to copy into libcrypto.so while
>>ntpd is running on the server, and you will automatically get an
>>'ETXTBUSY' in return.
>>The problem is that the NFS protocol does not support leases ('cos of
>>the statelessness requirement), and so the clients have no way of
>>notifying the server that libcrypto should not be overwritten.
>>
>>Solution: use the GNU 'install' program whenever you want to update a
>>library. The latter creates a new file rather than overwriting the old
>>one, and avoids this kind of mess.
>
> Considering that ntpd WAS running on the server when I reinstalled openssl,
> but it did a cp -f, so it should have done an unlink then copied it in.

Except that Trond was a bit wrong about ETXTBUSY: shared libraries don't
get this kind of protection, only executables do. So your cp succeeded
just fine, overwrote the library, then ntpd tried to page some code in
from the library and got garbage.

Never upgrade a shared library using cp, use install as Trond suggested...

Ion

--
It is better to keep your mouth shut and be thought a fool,
than to open it and remove all doubt.

_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs