Re: Reboots -- everything's a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 6/2/05, Bryan J. Smith <b.j.smith@xxxxxxxx> <thebs413@xxxxxxxxxxxxx> wrote:
> From: Rodrigo Barbosa <rodrigob@xxxxxxxxxxxxxxx>
> > Actually, there is another neat trick for rpm based systems.
> > You see, rpm, prior to removing anything, will rename that to ${NAME}.OLD.
> > So, libc.so.6 becomes libc.so.6.OLD, and then removed.
> > As we all know, if that library is currently open by any running process,
> > it won't be imediately removed (even tho you can't see it with a 'ls').
> > The trick is pretty simple: lsof | grep OLD
> > That, of course, only aplies if you are doing everything using RPM
> > (yum, redhat-update, apt-get).
> 
> That's because open file handles work in inode number, not filename.
> So you can rename things out-of-the-way for existing file handles,
> while creating a new file that will be opened for any new ones.
> 
You can also remove them, and the kernel won't reclaim the files
blocks until all filehandles to that inode are closed.  RPM mainly
does this to provide some saftey net in the case of power outages and
unforseen kernel panics/hangs (they happen) that might occur during an
upgrade.  No guarantees here, just some bread crumbs (read rpm does
not provide ACID concerning the upgrade of your system [or its
rollbacks if you use that feature]).
 
Cheers...james

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux