Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #169913

Re: How to prevent /tmp files from being deleted at reboot

From Sven Hartge <sven@svenhartge.de>
Newsgroups linux.debian.user
Subject Re: How to prevent /tmp files from being deleted at reboot
Date 2016-07-09 19:40 +0200
Message-ID <rT4op-5Za-3@gated-at.bofh.it> (permalink)
References <rT2cW-4IP-3@gated-at.bofh.it>
Organization Newsfeed am Wurmloch

Show all headers | View raw


MI <mi.lists.debian@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.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to prevent /tmp files from being deleted at reboot MI <mi.lists.debian@alma.ch> - 2016-07-09 17:20 +0200
  Re: How to prevent /tmp files from being deleted at reboot Sven Hartge <sven@svenhartge.de> - 2016-07-09 19:40 +0200
    Re: How to prevent /tmp files from being deleted at reboot MI <mi.lists.debian@alma.ch> - 2016-07-09 23:20 +0200
      Re: How to prevent /tmp files from being deleted at reboot Linux-Fan <Ma_Sys.ma@web.de> - 2016-07-10 15:40 +0200
        Re: How to prevent /tmp files from being deleted at reboot Wilko Fokken <wfokken@web.de> - 2016-08-07 21:00 +0200
  Re: How to prevent /tmp files from being deleted at reboot Jörg-Volker Peetz <jvpeetz@web.de> - 2016-07-10 17:20 +0200
    Re: How to prevent /tmp files from being deleted at reboot MI <mi.lists.debian@alma.ch> - 2016-07-10 23:10 +0200
      Re: How to prevent /tmp files from being deleted at reboot "D. R. Evans" <doc.evans@gmail.com> - 2016-07-11 16:00 +0200
        Re: How to prevent /tmp files from being deleted at reboot MI <mi.lists.debian@alma.ch> - 2016-07-11 17:50 +0200
          Re: How to prevent /tmp files from being deleted at reboot "D. R. Evans" <doc.evans@gmail.com> - 2016-07-11 18:10 +0200
            Re: How to prevent /tmp files from being deleted at reboot MI <mi.lists.debian@alma.ch> - 2016-07-16 15:00 +0200
              Re: How to prevent /tmp files from being deleted at reboot "D. R. Evans" <doc.evans@gmail.com> - 2016-07-16 15:10 +0200
                Re: How to prevent /tmp files from being deleted at reboot Michael Biebl <biebl@debian.org> - 2016-07-16 15:30 +0200
                Re: How to prevent /tmp files from being deleted at reboot "D. R. Evans" <doc.evans@gmail.com> - 2016-07-16 17:10 +0200
                Re: How to prevent /tmp files from being deleted at reboot Michael Biebl <biebl@debian.org> - 2016-07-16 17:30 +0200
                How to prevent /tmp files from being deleted at reboot Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> - 2016-08-05 09:30 +0200
                Re: How to prevent /tmp files from being deleted at reboot Michael Biebl <biebl@debian.org> - 2016-08-05 21:40 +0200
                Re: Re: How to prevent /tmp files from being deleted at reboot Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> - 2016-08-06 16:10 +0200
              Re: How to prevent /tmp files from being deleted at reboot Michael Biebl <biebl@debian.org> - 2016-07-16 15:30 +0200
  Re: How to prevent /tmp files from being deleted at reboot Michael Biebl <biebl@debian.org> - 2016-07-11 12:40 +0200
    Re: How to prevent /tmp files from being deleted at reboot MI <mi.lists.debian@alma.ch> - 2016-07-11 15:30 +0200
      Re: How to prevent /tmp files from being deleted at reboot Michael Biebl <biebl@debian.org> - 2016-07-12 17:40 +0200
      Re: How to prevent /tmp files from being deleted at reboot Michael Biebl <biebl@debian.org> - 2016-07-12 17:40 +0200
        Re: How to prevent /tmp files from being deleted at reboot MI <mi.lists.debian@alma.ch> - 2016-07-16 16:10 +0200
          Re: How to prevent /tmp files from being deleted at reboot Michael Biebl <biebl@debian.org> - 2016-07-16 16:20 +0200
            Re: How to prevent /tmp files from being deleted at reboot MI <mi.lists.debian@alma.ch> - 2016-07-16 16:30 +0200
              Re: How to prevent /tmp files from being deleted at reboot Mark Fletcher <mark27q1@gmail.com> - 2016-07-16 16:40 +0200
                Re: How to prevent /tmp files from being deleted at reboot Michael Biebl <biebl@debian.org> - 2016-07-16 16:50 +0200
                Re: How to prevent /tmp files from being deleted at reboot MI <mi.lists.debian@alma.ch> - 2016-07-16 17:20 +0200
                How to prevent /tmp files from being deleted at reboot Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> - 2016-08-05 09:30 +0200
        Re: How to prevent /tmp files from being deleted at reboot Josh Triplett <josh@joshtriplett.org> - 2016-07-28 09:10 +0200

csiph-web