MI <mi.lists.deb...@alma.ch> wrote:

> In Debian Jessie, systemd ignores the TMPTIME variable in /etc/default/rcS 
> and just 
> blindly deletes everything on every reboot.

> A bug has been filed about it:  "#795269 TMPTIME not honored anymore"
> ( https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=795269 )

> But I tried the suggested solution, and the files in /tmp still get deleted 
> at reboot.

> What I currently have which doesn't work:

>    $ egrep -v '^(#|$)' /etc/tmpfiles.d/tmp.conf
>    D /tmp 1777 root root 30d
>    x /tmp/systemd-private-%b-*
>    X /tmp/systemd-private-%b-*/tmp
>    x /var/tmp/systemd-private-%b-*
>    X /var/tmp/systemd-private-%b-*/tmp

> Would someone know what I can do so that only files older than some number of 
> days 
> get deleted?

/tmp is most likely a tmpfs, a filesystem in RAM which will vanish (and
all files and directories in it) as soon as the computer is rebooted.

But /tmp being wiped on (re)boot has been the norm and case for
UNIX-based operating systems since nearly forever. No program or user
should expect its/his files to persist in /tmp across a reboot. That is
what /var/tmp is for, a temporary place which will not be wiped upon
reboot.

I regard /tmp being cleared on (re)boot as a feature, not a bug.

The FHS says that "On most systems, this directory is cleared out at
boot or at shutdown by the local system. The basis for this was
historical precedent and common practice. However, it was not made a
requirement because system administration is not within the scope of the
FSSTND. For this reason people and programs must not assume that any
files or directories in /tmp are preserved between invocations of the
program. The reasoning behind this is for compliance with IEEE standard
P1003.2 (POSIX, part 2)."

IMO: If you have a program that relies on files or directories in /tmp
being persistent, then that program is buggy, not Debian.

Grüße,
Sven.

-- 
Sigmentation fault. Core dumped.

Reply via email to