LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint
User Name
Password
Linux Mint This forum is for the discussion of Linux Mint.

Notices


Reply
  Search this Thread
Old 10-29-2019, 03:14 PM   #1
shachter
Member
 
Registered: Jul 2007
Posts: 101

Rep: Reputation: 2
How Do I Suppress The Removal Of Files in /tmp ?


Esteemed Colleagues:

I created a file in /tmp and was surprised to find it gone after I rebooted, as I see nothing in /usr/lib/tmpfiles.d or in /usr/lib/systemd/system or in /etc/init or in /etc/rc?.d that removes files from /tmp. The /tmp directory is part of the root filesystem and is not memory-based. I want files in /tmp to survive a reboot and therefore want to suppress their removal; where are they being removed? The relevant line from /etc/os-release is VERSION="19.1 (Tessa)". Thank you in advance for any and all replies. jay at m5 dot chicago dot il dot us
 
Old 10-29-2019, 03:48 PM   #2
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,463
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
How Do I Suppress The Removal Of Files in /tmp ?

See here: https://refspecs.linuxfoundation.org...s/ch03s18.html

In short, don't put stuff you want to keep in there.

With that said, you're looking for this:
https://www.freedesktop.org/software...ean.timer.html
 
1 members found this post helpful.
Old 10-29-2019, 11:58 PM   #3
shachter
Member
 
Registered: Jul 2007
Posts: 101

Original Poster
Rep: Reputation: 2
Yes, but as I wrote in my original posting:

"I see nothing in /usr/lib/tmpfiles.d ...
that removes files from /tmp"

The relevant line from /usr/lib/tmpfiles.d/tmp.conf is:

D /tmp 1777 root root -

The hyphen at the end of the line means that no
automatic deletion is done. I do not recall editing
this file (and I would not, I would copy it into
/etc/tmpfiles.d and edit the copy), so therefore
that is what you will find in every LinuxMint 19.1
system. My original question stands: What is causing
the files in /tmp to not survive a reboot on a
LinuxMint 19.1 system? Thank you in advance for
any and all replies.
 
Old 10-31-2019, 02:23 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
/tmp is (usually) a part of RAM mounted into the filesystem. It's volatile. It goes "poof" when you switch the machine off.
You could change that, but if you need to ask, better don't, and simply put your stuff elsewhere.
How about creating a directory "~/tmp" (in your $HOME) that conatins the sort of stuff you want to put in it?
 
Old 11-01-2019, 07:22 PM   #5
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,463
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
Quote:
Originally Posted by shachter View Post
The /tmp directory is part of the root filesystem and is not memory-based.
Are you 100% sure of this?

Please post the output of df
 
Old 11-01-2019, 07:26 PM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
yeah check your fstab and see if it is your /tmp is put to RAM.

tmpfs /tmp

btw /tmp is short for temporary. get the hint?

Last edited by BW-userx; 11-01-2019 at 07:28 PM.
 
Old 11-01-2019, 09:56 PM   #7
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,177

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
You might find this discussion interesting; https://serverfault.com/questions/37...cleared/377349
It is a bit old, but answers your question for most distros on how /tmp is cleared. You may find the last post is the way to go.

Last edited by uteck; 11-01-2019 at 09:58 PM. Reason: add snark
 
Old 11-02-2019, 01:10 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by BW-userx View Post
yeah check your fstab and see if it is your /tmp is put to RAM.
/tmp is not usually in /etc/fstab.

the output of
Code:
mount
should shed some light.
 
Old 11-02-2019, 09:52 AM   #9
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,177

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
If /etc/fstab is not showing much, and mount is showing too much then try;
df -h
 
Old 11-02-2019, 10:44 AM   #10
djk44883
Member
 
Registered: Aug 2008
Location: Ohio
Distribution: debian
Posts: 141

Rep: Reputation: 29
On systems with SSDs I explicitly mount /tmp to ramfs - it doesn't just get done "automatically". I'm running Debian

I recall reading /tmp (normally) gets wiped between reboots - /var/tmp is remains until a process or user deletes it.
 
Old 11-03-2019, 08:34 PM   #11
shachter
Member
 
Registered: Jul 2007
Posts: 101

Original Poster
Rep: Reputation: 2
Gentlemen:

As I mentioned in the original posting (and as noted by
rkelsen): "The /tmp directory is part of the root
filesystem and is not memory-based". Thus:

$ df /tmp
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/landru-mint 15481840 13016744 1678664 89% /
$

On LinuxMint 19.1, /tmp is not a separate mountpoint.

(Incidentally, /etc/init is almost completely gone in
LinuxMint 19.1; on my system it contains only
anacron.conf and lightdm.conf. This is to be expected,
as LinuxMint 19.1 runs systemd, not upstart:

$ ls -l /sbin/init
lrwxrwxrwx 1 root root 20 Jun 26 19:39 /sbin/init -> /lib/systemd/systemd
$
)

Files that I create in /tmp on a LinuxMint 19.1 system
do not survive a reboot. Where is this done?

Thank you in advance for any and all replies.

jay at m5 dot chicago dot il dot us
 
Old 11-04-2019, 08:32 AM   #12
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,177

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
The /tmp files are cleared differently by different distros, take a look at this link for the various ways: https://serverfault.com/questions/37...cleared/377349
 
Old 11-04-2019, 10:16 AM   #13
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Agree, I've installed a few distros and seen in there fstab where they have actually added /tmp to tmpfs

(no i am not going to go back and install every distro I've ever tried to find it, )
 
Old 11-05-2019, 06:08 PM   #14
djk44883
Member
 
Registered: Aug 2008
Location: Ohio
Distribution: debian
Posts: 141

Rep: Reputation: 29
Quote:
Originally Posted by uteck View Post
The /tmp files are cleared differently by different distros, take a look at this link for the various ways: https://serverfault.com/questions/37...cleared/377349

The article points out distros handle it differently, but many of the responses are dated 2012,15,17... ie) debian uses systemd , -

/etc/default/rcS

this is from an init system.
 
Old 11-05-2019, 06:12 PM   #15
djk44883
Member
 
Registered: Aug 2008
Location: Ohio
Distribution: debian
Posts: 141

Rep: Reputation: 29
Quote:
Originally Posted by BW-userx View Post
Agree, I've installed a few distros and seen in there fstab where they have actually added /tmp to tmpfs

(no i am not going to go back and install every distro I've ever tried to find it, )
Code:
tmpfs /tmp tmpfs defaults,noatime,nosuid,nodev,mode=1777,size=256M 0 0
I've added this myself on a specific system. Does an installation actually just arbitrarily consume RAM for /temp storage? Did it give you any options or choices? or do you just loose the RAM no matter what? ...regardless how little/much you have or drive partitioning schemes.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] ? about "marking for removal" or "marking for complete removal" in synaptic pkg mgr Gregg Bell Linux - Newbie 5 03-06-2014 07:27 AM
Synaptic: "removal" vs. "complete removal" newbiesforever Linux - Software 2 08-24-2008 08:31 PM
removal of /tmp/.X0-lock nifflerX Linux - Security 2 04-09-2004 11:04 AM
Numerous scb_*.tmp files in /tmp dburk Programming 3 08-18-2003 04:28 PM
Newbie question - /tmp /var/tmp Mr happy Linux - Security 3 01-27-2003 01:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint

All times are GMT -5. The time now is 05:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration