Tobias DiPasquale on 24 Feb 2004 12:38:04 -0000


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

Re: [PLUG] Apache using deleated files


On Tue, 2004-02-24 at 07:08, LeRoy Cressy wrote:
> does anyone know why Apache is using deleted tmp files without closing 
> them first?

If you open a file and then delete it, but do not close it, you then
have a file that will automatically be removed when you exit the process
(intentionally or unintentionally). This is an easy way to clean up a
domain socket: after both processes have opened the file, one of them
deletes it. When its time to close the domain socket, both processes
just exit normally and don't have to worry about which one deletes the
domain socket. Since the file is already marked as deleted and only now
has a use count of 0, it will actually be removed implicity by the
filesystem.

As for why its using those particular deleted files, you'll have to use
the source for that.

-- 
Tobias DiPasquale, www.cbcg.net
202A 04C4 2CE6 B985 8520  88D6 CD25 1A6C B9B5 1595

Attachment: signature.asc
Description: This is a digitally signed message part