[systemd-devel] tmpfiles versus tmpwatch

Lennart Poettering lennart at poettering.net
Wed Apr 29 02:33:18 PDT 2015


On Wed, 29.04.15 15:10, Roger Qiu (roger.qiu at polycademy.com) wrote:

> Hello all,
> 
> I'm planning to use tmpwatch's `fuser` feature.
> 
> But I'd prefer to run this simple service using systemd's tmpfiles.
> Does systemd tmpfiles support running `fuser` so that way it won't delete
> any files that have an open file descriptor?

Nope, we do not support this, and it's unlikely we ever will. fuser is
relatively expensive, since it iterates manually through all
subdirectories of /proc to find open files. If the kernel had a better
interface for this, that makes this less expensive, we might consider
supporting that, but the iterating through /proc is simply too bad.

In almost all cases the atime checks we do should be fully sufficient
though. Do you have a case where they aren't?

(Note that we do compare all unix sockets we find with /proc/net/unix
though, which is relatively efficient still. Also, as unix sockets
which are actively used do not get their atime bumped this is kinda a
necessity to cover them nicely.)

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list