Bug#1070482: systemd: tmpfiles.d not cleaning /var/tmp by default
- To: 1070482@bugs.debian.org
- Subject: Bug#1070482: systemd: tmpfiles.d not cleaning /var/tmp by default
- From: Richard Lewis <richard.lewis.debian@googlemail.com>
- Date: Fri, 31 May 2024 00:42:56 +0100
- Message-id: <[🔎] 86sexy6f3z.fsf@simplex.rtf.org.uk>
- Reply-to: Richard Lewis <richard.lewis.debian@googlemail.com>, 1070482@bugs.debian.org
- In-reply-to: <826442cf68a4029b31d85e7cd2af36967a1b6dcc.camel__5832.31633515737$1716854776$gmane$org@debian.org> (Luca Boccassi's message of "Tue, 28 May 2024 00:44:35 +0100")
- References: <159620836885.528.10433000193944261598.reportbug@debiansosreport> <159620836885.528.10433000193944261598.reportbug@debiansosreport> <826442cf68a4029b31d85e7cd2af36967a1b6dcc.camel__5832.31633515737$1716854776$gmane$org@debian.org> <159620836885.528.10433000193944261598.reportbug@debiansosreport>
Luca Boccassi <bluca@debian.org> writes:
> Here's two paragraphs, one for each change, for the release notes:
- More context and explanation would be helpful - suggestions below,
- Based on the discussion on d-devel, the tmpfs change is much less
controversial and so should be lower down.
- how do we describe the previous postition /tmp was: a regular
directory? a partition?
- some obvious questions need answering:
* if i have a file in /tmp (and disable the other change) what
actually happens to that file? is it moved "into" the tmpfs or is it
hidden by the tmpfs?
* if i have /tmp as a 2TB separate disk partition do i just lose that
space? or does tmpfs immediately gobble up all my available RAM?
* what happens to my files if i run out of memory because someone
wrote a 500GB file to /var/tmp?
- you could do more to explain the benefits and rationale here - tmpfs
is (i assume) faster?
- sudo is not how most(?) debian users do things
- tmpfiles.d should be systemd-tmpfiles(1) i think?
- using names like /etc/tmpfiles.d/tmp.conf might clobber existing files?
- highly optimistic about how well people know systemd!
=================================================================
This needs an edit/cut, but:
Debian has made two major changes for new installations to the temporary
directories (/tmp and /var/tmp). Because there is a small risk of data
loss, these changes have not been made for upgrades. You may wish to
adopt the new defaults as explained below.
On new installations, systemd-tmpfiles(1) will now delete files in /tmp
and /var/tmp while the system is running. Previously, files in those
directories were only deleted on reboot, but now files in /tmp will be
deleted after 10 days, and files in /var/tmp after 30 days. [is this
really the defualt it seems very short?] If you adopt this change you
can tell systemd-tmpfiles not to delete individual files by making a
file in /etc/tmpfiles.d with lines such as
x /var/tmp/my precious file.pdf
x /tmp/foo
Please see systemd-tmpfiles(1) for more information. On new
installations, the previous behaviour can be restored by creating a file
tmp.conf in /etc/tmpfiles.d containing 'D /tmp 1777' [are you sure this is the correct syntax???]
In addition, on new installations, the /tmp/ directory is now stored in
memory, using a tmpfs(LINK). This should make applications that use
temporary files faster. You can adopt the new default by running
'systemctl unmask tmp.mount' as root [i assume?]. (If you created /tmp
as a separate partition you may want to reclaim the space using lvm or
sfdisk?).
The new behaviour allocates x% of memory to the tmpfs but you can change
this by [how?]. If you have large files in /tmp and you run out of
memory then [what happens?]. On new installations you can make /tmp a
regular directory by running 'systemctl mask tmp.mount' as root [i
assume?].
These changes have been made to align Debian with other distributions,
and you should adapt any local programs that store data in /tmp or
/var/tmp for long periods to use alternative locations, such as ~/tmp/
or [exclude files from deletion as explained above?]..... [i think there
are more points in the d-devel discussion that need making here]
===================================================================
Reply to: