[systemd-devel] [PATCH 1/2] Don't clean /var/lock/subsys or /var/run/user; they're not aged content.

Lennart Poettering lennart at poettering.net
Tue Oct 26 11:04:45 PDT 2010


On Tue, 26.10.10 11:26, Bill Nottingham (notting at redhat.com) wrote:

> 
> Lennart Poettering (lennart at poettering.net) said: 
> > In a number of ways:
> > 
> > - Primarily it is nearly impossible to use /tmp safely to place a communication
> >   socket in: on one hand you need to establish a non-random name, so that
> >   client and server find each other. On the other hand you must choose a
> >   random name to avoid DoS vulnerabilities that some other user might
> >   take away your names in /tmp and all your software doesn't
> >   break. (With major hacks one can work around this, but it's awful and
> >   almost nobody gets it right -- I did it in PA, and I am not proud of it)
> > 
> > - The lifetime of XDG_RUNTIME_DIR is strictly bound to the user
> >   actually being logged in. i.e. pam_systemd removes the dir when you log
> >   out. /tmp doesn't have that.
> 
> ... if this is the case, I'm not sure why it needs periodically cleaned.
> If it's specifically tied to the length of the session, and cleaned up on
> exit, there's no reason to have periodic cleaning of it.

On a long running session cruft might end up in /var/run/users/ so we
might want to delete that from time to time. It's similar to /tmp in
this regard: we clean up /tmp not only on boot but also during runtime
because it might collect files that are just trash over time. 

After all in most cases sessions last probably as long as the entire
runtime of the machine these days, hence the effective difference is
minimal.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list