Bug 674194

Summary: tmpfiles removes files it shouldn't, breaking X and other applications
Product: [Fedora] Fedora Reporter: Miloslav Trmač <mitr>
Component: systemdAssignee: Lennart Poettering <lpoetter>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: kanelxake, lpoetter, metherid, mmaslano, mschmidt, notting, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-16 22:51:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 617261    

Description Miloslav Trmač 2011-01-31 22:57:57 UTC
Description of problem:
systemd introduces "systemd-tmpfiles", which implements automatic removal of temporary files.  This new implementations reintroduces various bugs that have been fixed in tmpwatch over the years:

* tmpfiles removes sockets if their [acm]time is not recent - but
  connect() on an AF_UNIX socket does not update any of these times.  Thus,
  tmpfiles will eventually remove e.g. /tmp/.X11-unix/X0, breaking X.  (#114969)

* Some files are accessed only through mmap(), which does not update their
  times either.  Thus, tmpfiles will break Java management tools. (#527425)

Version-Release number of selected component (if applicable):
Git as of Jan 31, by code inspection

Comment 1 Paolo Bonzini 2011-02-01 16:21:22 UTC
*** Bug 669079 has been marked as a duplicate of this bug. ***

Comment 2 Lennart Poettering 2011-02-16 22:34:12 UTC
systemd-tmpfiles in v18 now ensures that AF_UNIX sockets are actually dead before deleting them (By parsing /proc/net/unix. That's ugly but we do our best to make this efficient and sort everything we read from there into a hash table so that later on our checks for further unix sockets are cheap).

systemd-tmpfiles in v18 now also supports globs in exclusion lists for the automatic cleanup. This allows those Java tools to simply drop a file into /etc/tmpfiles.d/ which contains "x /tmp/hsperfdata_*" with the effect that these files will not be cleaned up regardless of their [amc]time. This is a much nicer solution than hardcoding package-specific paths in the system clean-up scripts.

I will now file a bug against Java to include a tmpfiles file like this.

Comment 3 Lennart Poettering 2011-02-16 22:51:46 UTC
File that bug now:

https://bugzilla.redhat.com/show_bug.cgi?id=678161

I guess this means this bug can be closed now.

Thanks a lot btw for pointing these issues out! Much appreciated.

Comment 4 Lennart Poettering 2011-02-16 22:52:01 UTC
s/File/Filed/