lkml.org 
[lkml]   [1996]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: behavior of overwriting running executables?
From: "Marty Leisner" <leisner@sdsp.mc.xerox.com>
> This is has always been an issue with linux kernels.

It's a feature of Linux and most Unix kernels. Not really an issue...

> If I write to a running program, I get "text file busy".
> I think sunos seamlessly moves the executable to an unnamed inode,
> leaving a reference to it while its running, then transparently does
> an unlink when its done.

Note that if an OS were to do that, it would also have to copy the file
or implement some sort of copy-on-write behavior.

In the Debian package tool, we extract each file to <filename>.dpkg-new,
and then re-name the file to <filename> once all files have been extracted.
The running executable remains as a nameless file until the last reference
on it goes away - generally when the last process that is using its pages
dies.

Makefiles that replace running executables can use a similar
cp-then-mv strategy.

Thanks

Bruce Perens


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