[fpc-pascal] Methods for autoupdating fpc programs?

Jürgen Hestermann juergen.hestermann at gmx.de
Sun Oct 4 18:02:39 CEST 2015



Am 2015-10-04 um 15:41 schrieb Mark Morgan Lloyd:
> Michael Van Canneyt wrote:
>> On Sun, 4 Oct 2015, Graeme Geldenhuys wrote:
>>
>>> On 2015-10-04 13:16, Mattias Gaertner wrote:
>>>> Replacing a running program by simply copying can result under Linux in
>>>> 'text file busy'.
>>>
>>> Then consider me luckily. :) In my 15 years of using Linux and 4 years
>>> of FreeBSD I have never seen that error.
>>
>> I see it nearly every day, when I recompile a fastcgi process that is still in use by Apache.
>>
>> But I was also surprised to see it. I'm still not sure what the exact cause is, because it works sometimes, and sometimes not.
>
> It generally happens if the OS (almost any OS) decides that constrained resources means that a segment can usefully be removed from memory, and further decides that it's a read-only segment so rather than writing it to swap it will- if it needs it again- reread it from the original binary.
>

But that makes no sense to me. If the OS is designed to potentially remove running programs (or parts of it) from memory it cannot allow overwriting the file on disk in any case. When it does so, it cannot remove parts from memory because it may not be available on disk anymore. So it must disallow the disk change from the beginning, otherwise it may not be able to remove anything.




More information about the fpc-pascal mailing list