Bug#942511: systemd: Excludes in tmpfiles.d do not work

Mathias Behrle mbehrle at debian.org
Thu Oct 17 14:19:12 BST 2019


* Michael Biebl: " Re: Bug#942511: systemd: Excludes in tmpfiles.d do not
  work" (Thu, 17 Oct 2019 13:33:50 +0200):

Hi Michael,

thanks for your immediate response.

> Am 17.10.19 um 13:09 schrieb Mathias Behrle:
> > Package: systemd
> > Version: 242-7
> > Severity: important
> > 
> > Dear Maintainers,
> > 
> > since considerable time I encounter the problem, that tmp
> > files/directories created by vim are obviously deleted by systemd-tmpfiles.
> > While searching for the reason I found the following facts:
> > 
> > /usr/lib/tmpfiles.d/tmp.conf contains
> > # Clear tmp directories separately, to make them easier to
> > override D /tmp 1777 root root -
> > 
> > This line is introduced by
> > https://salsa.debian.org/systemd-team/systemd/blob/experimental/debian/patches/debian/Bring-tmpfiles.d-tmp.conf-in-line-with-Debian-defaul.patch
> > and replaces
> > q /tmp 1777 root root 10d
> > 
> > So good so far, now to the reason of this bug report:
> > The current behavior on my system is, that regardless of any excludes
> > the tmp directory is cleaned radically, verified by running
> > # env SYSTEMD_LOG_LEVEL=debug systemd-tmpfiles --remove
> > 
> > So I was not able to prevent the deletion of any files by defining excludes
> > like X /tmp/v*
> > x /tmp/v*
> > 
> > Also the predefined excludes in /usr/lib/tmpfiles.d/tmp.conf do not
> > work, i.e. those files are cleaned up when existing. So I think that
> > there is definitely a bug in systemd-tmpfiles.  
> 
> 
> Maybe this is a misunderstanding how x/X is supposed to work.
> "D /tmp 1777 root root -" is supposed to clean up /tmp during boot
> unconditionally. It is *not* using age based cleaning.

Yes, may be.

First: is 
# env SYSTEMD_LOG_LEVEL=debug systemd-tmpfiles --remove
the correct way to test the daily cleanup job?

*If* it is, then something is going wrong *or* is misconfigured, because /tmp
is then not only cleaned up at boot, but with the daily cleanup job.

> This Debian specific change was made as this has always been the
> behaviour in Debian.
> 
> The documentation for the x/X parameter says:
> >        x
> >            Ignore a path during cleaning. Use this type to exclude paths
> > from clean-up as controlled with the Age parameter  
> 
> 
> So x/X having no effect on "D /tmp 1777 root root -" is expected, I'd
> say and they work as documented.

If that is expected behavior what is then the purpose of those lines following

# Exclude namespace mountpoints created with PrivateTmp=yes
x /tmp/systemd-private-%b-*
X /tmp/systemd-private-%b-*/tmp
x /var/tmp/systemd-private-%b-*
X /var/tmp/systemd-private-%b-*/tmp

# Remove top-level private temporary directories on each boot
R! /tmp/systemd-private-*
R! /var/tmp/systemd-private-*

?

Is this simply cruft?

> If you need files to survive a reboot, you should not place them in
> /tmp; /var/tmp seems more appropriate in that case.

I am not talking about files surviving a reboot. I am expecting a clean /tmp on
reeboot, too. The files of which I am speaking are cleaned up during the
regular run of my workstation (typically running without interruption).



-- 

    Mathias Behrle
    PGP/GnuPG key availabable from any keyserver, ID: 0xD6D09BE48405BBF6
    AC29 7E5C 46B9 D0B6 1C71  7681 D6D0 9BE4 8405 BBF6
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 867 bytes
Desc: Digitale Signatur von OpenPGP
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20191017/fbc45b3d/attachment-0001.sig>


More information about the Pkg-systemd-maintainers mailing list