Bug 8987 - tmpwatch deletes file while in use
Summary: tmpwatch deletes file while in use
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: tmpwatch
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Preston Brown
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2000-01-30 17:16 UTC by Simon Hill
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2000-02-14 19:20:17 UTC

Attachments (Terms of Use)

Description Simon Hill 2000-01-30 17:16:33 UTC
tmpwatch deleted an iso image in /tmp
WHILE it was mounted at /mnt/cdrom via
loop device.

Comment 1 Jeff Johnson 2000-02-07 22:26:59 UTC
Change the tmpwatch policy (probably by disabling) if you're going to put
unusual things in /tmp. There's no (easy) way that tmpwatch can discover that a
file is in use.

Comment 2 Simon Hill 2000-02-11 17:41:59 UTC
I have to respectfully disagree with this. While in this instance, I was making
an unusual use of /tmp, there are a number problems with not checking whether
the file is open before deleting it.

As more and more commercial software is developed for Linux, /tmp may be used in
ways not expected. Even free software may use /tmp in ways you don't expect.

For example, Meta-HTML (www.metahtml.org) is a web-server which puts its session
database in /tmp by default.  Of course, once tmpwatch deletes it, it continues
to work ... but none of the other utilities designed to access the session
database will work.

While it may in INCONVENIENT to fix this, I doubt that it is difficult - the
code is in lsof.

Comment 3 Preston Brown 2000-02-14 19:20:59 UTC
we have added a flag to use fuser to determine whether a file is open or not for
6.2.  However, this option is turned off by default.

Note You need to log in before you can comment on or make changes to this bug.