Re: Effect of deleting executables of running programs

From: jlnance
Date: Mon Aug 23 2004 - 08:31:24 EST


On Wed, Aug 18, 2004 at 11:16:46AM -0700, Shriram R wrote:
> a) I always thought that once a job is running, the
> executable is entirely loaded into memory and the
> abcd.out file is no longer needed.
> If so, then why does the a running job crash on
> deleting abcd.out ?

No, programs sections are paged in as needed, so the
parts that are not running may not be in memory.

That said, the Unix way of dealing with files is by
reference counting. This means that you can open a
file and delete it, and it is still kept around on
the disk until you close it (running a program counts
as having its file open). So you are susposed to be
able to delete a program and running instances will not
be affected.

Unfortunatly, as you have discovered, NFS is kinda
sorta almost like a Unix file system, but not really.
You can NOT reliably access deleted files over NFS.
This is the root of what is causing your bus errors.

> b) To what extent can I trust that the rest of the 6-7
> jobs that are running have not been affected by this
> deletion of "abcd.out" ?

They are probably OK.

Thanks,

Jim
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/