Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 399839

Summary: app-admin/tmpwatch reports "Cannot stat file" with --fuser on sufficiently loaded system
Product: Gentoo Linux Reporter: Doug Warner <doug>
Component: New packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED TEST-REQUEST    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Doug Warner 2012-01-23 14:17:12 UTC
When running tmpwatch with --fuser on a sufficiently loaded system, it's common to get errors like this on stderr:

# tmpwatch --mtime --fuser --quiet  504 /usr/portage/distfiles
Cannot stat file /proc/10661/fd/542: No such file or directory
Cannot stat file /proc/10661/fd/549: No such file or directory
Cannot stat file /proc/10661/fd/587: No such file or directory
Cannot stat file /proc/10661/fd/593: No such file or directory

We can't send stderr to /dev/null since this would mask legitimate errors from tmpwatch.  The best solution would be to ignore this race condition in tmpwatch.
Comment 1 Christian Faulhammer (RETIRED) gentoo-dev 2012-02-05 13:29:57 UTC
Which version of tmpwatch is this?
Comment 2 Doug Warner 2012-02-06 02:27:07 UTC
$ equery l tmpwatch
 * Searching for tmpwatch ...
[IP-] [  ] app-admin/tmpwatch-2.10.1:0


FWIW, I've seen this problem for quite some time but only recently realized it was due to fuser.
Comment 3 Christian Faulhammer (RETIRED) gentoo-dev 2012-02-06 20:21:52 UTC
(In reply to comment #2)
> $ equery l tmpwatch
>  * Searching for tmpwatch ...
> [IP-] [  ] app-admin/tmpwatch-2.10.1:0


 Please try 2.10.3.
Comment 4 Michael Watters 2012-02-17 15:33:53 UTC
Upgrading to 2.10.3 doesn't seem to help.  There is still a race condition caused by tmpwatch trying to look at processes that no longer exist.

For example, tmpwatch produces errors like this:

Cannot stat file /proc/4892/fd/51: No such file or directory
Cannot stat file /proc/8860/fd/7: No such file or directory
Cannot stat file /proc/5474/fd/7: No such file or directory

This can be reproduced by running 

tmpwatch --mtime --fuser --quiet  504 /usr/portage/distfiles
Comment 5 Pacho Ramos gentoo-dev 2016-05-28 09:35:14 UTC
Try with 2.11-r1