[lkml]   [2001]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: the remount problem [2.4.0] kind of solved [patch]

for Short: I had a mail exchange with Vic Abell, the lsof Author, and in the
next Version of lsof the open shared libs will be detected. So my Kernel
Patch is no longer needed:

# ~root/rw
# rm /usr/lib/jabber/jsm/
# ~root/ro
mount: /usr busy
# lsof_4.55A.linux/lsof -a +L1 /usr
jabberd 9657 daemon mem DEL 8,5 0 145429 /usr/lib/jabber/jsm/
jabberd 9658 daemon mem DEL 8,5 0 145429 /usr/lib/jabber/jsm/

Still we need to address the problem of upgraded libs (at least in a Great
Distribution like Debian is :)

> Why in hell are library open for write? But it doesn't seem to be only
> libraries:

They are not open for write. They are open for mmaped read. The Problem with
this is, that as long as the files are open, the filesystem cannot remove
them from disk. This means, that as long as you have files open, even for
read, which are deleted, a remount ro will fail.

The new lsof will find those mmaped files, so you can simply restart the
associated binary.

> At boottime the filesystems are readonly, so any deamon that gets
> startet can only have read and exec permissions on files. Deleting a
> library and replacing it with a new one can't change that.

Deleteing a lib which is open (which will happen if u upgrade a lib*.deb)
will leave a open-but-delted file on the system, which in turn will disable
you to remount the file system read only. In my case i switch from read-only
/usr to read-write user, use apt-get -ufm upgrade and then want to switch
back to read-only /usr. But exactly the later is not possible. It is also
wasting shared memory since freshly started programs will use the new lib,
the old ones will use the old, unlinked libs.

> I think the problem comes from daemons that actually get restarted,
> maybe before the library is updated (so they will load the old/deleted
> one).

Yes, all daemons will get started with the old libs, since a upgrade always
happens after system start :) But not only daemons. Think of Shells, getty,
login, ...

(OO) -- --
( .. ) ecki@{,,}
o--o *plush* 2048/93600EFD eckes@irc +497257930613 BE5-RIPE
(O____O) When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl!
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:13    [W:0.112 / U:1.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site