On 2014-02-05 at 09:08 -0700, Yves Dorfsman wrote:
> There is a new trend that I find slightly alarming: applications deleting 
> their temp files as soon as they are open.

This is not new, it's very old behaviour (at least multiple decades) and
what you might be seeing is traditional Unix behaviour spreading to new
tools, but I'm not sure your cited examples are examples of such a
change.

> I understand the objective, they want to leave the environment clean even in 
> the case of a crash, a digital "Leave No Trace" of sort. But I think this is 
> wrong.

A file with no references in the filesystem tree will be auto-deleted by
the kernel once the last process with an open fd exits.  So this is also
a case of making sure that when a program exits, it's not risking
filling filesystems afterwards.

Well-behaved long-running programs don't hold open unlinked files for
any length of time.

> It is wrong because it makes diagnosticating both application and filesystem 
> problems difficult.If you have a hunch that an applications is having 
> filesystem space issue,

Then I ask the filesystem how full it is, with "df", which is a quick
metadata query; I'll probably use "df -hi" to get human-readable figures
and inode usage too (though -h is not completely portable).  If df says
the filesystems are not full, then I move onto another line of enquiry
without impacting a running system by hitting a large chunk of the
filesystem tree.  If df says a filesystem is full, then I might use du
and lsof to trace down where the consumption is (with some short-cut
mental heuristics for common cases, such as syslog and /var and crappy
log-rotation programs).

du is an expensive "hit the filesystem and walk it, finding what's
linked" tool, it's not a "how full is the filesystem" tool.

>            The convention was that if you write a file in /tmp, it can be 
> deleted without adverse effect on your apps, therefore leaving files in /tmp 
> after a crash was never really an issue.

I believe this is still the case.

The only change in behaviour I know of is that several years ago some
media players started using unlinked files for buffering content, as a
"security" measure to keep things out of disk cache where users might
copy data out.  A decent knowledge of /proc might make this less
protective than such peddlers hope for.

Can you provide specific examples of applications using unlinked files
in a way which you feel is erroneous, without it being a sign of an
application bug?

-Phil
_______________________________________________
Tech mailing list
[email protected]
https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech
This list provided by the League of Professional System Administrators
 http://lopsa.org/

Reply via email to