Skip to content

For some reason, /tmp is being cleaned from time to time.

EDIT 3: Solution

It turns out the files in /tmp were deleted by gsd-housekeepin which is a process ran by Gnome when you change the Privacy settings on gnome-control-center, turning off the option that periodically deletes the files from /tmp solves my issue.

EDIT: Please don't downvote this if you think I think /tmp is just another storage folder as ~/.

Since a couple of weeks, after the last update of Gnome (3.26.2, that is) was introduced on my system, I noticed that the content of /tmp disappears, for instance, a couple of minutes ago I downloaded a video with youtube-dl and split it with ffmpeg. After coming from the bathroom both files were gone.

I noticed this especially with Emacs running as a daemon, from time to time magit will fail to perform a commit because it couldn't find the file socket, forcing me to restart emacs daemon.

I still have a huge amount of space in my SSD and my HDD (I really don't know in which device /tmp is mounted), any ideas what could this be?

EDIT2: Output of fatrace

I do ls a couple of times to /tmp/emacs1000 and 15~ minutes later something called gsd-housekeepin goes in and mess with /tmp, one hour later I found out about the nonexistence of the mentioned folder, which supports my theory that gsd-housekeepin is the culprit of my problem.

17:02:03.689322 zsh(5268): O /tmp
17:02:03.689382 zsh(5268): RC /tmp
17:02:04.188665 ls(5740): O /tmp/emacs1000
17:02:04.188665 ls(5740): R /tmp/emacs1000
17:02:04.188721 ls(5740): C /tmp/emacs1000
17:06:47.330129 ls(5823): RCO /tmp/emacs1000
17:07:06.540735 nautilus(5857): O /tmp/flatpak-seccomp-BBH09Y (deleted)
17:07:06.540882 nautilus(5857): W /tmp/flatpak-seccomp-BBH09Y (deleted)
17:07:06.540882 nautilus(5857): W /tmp/flatpak-seccomp-BBH09Y (deleted)
17:07:06.574195 bwrap(5872): R /tmp/flatpak-seccomp-BBH09Y (deleted)
17:07:08.294462 nautilus(5857): O /tmp/gnome-desktop-thumbnailer-HW209Y/gnome-desktop-thumbnailer.png
17:07:08.294609 nautilus(5857): RC /tmp/gnome-desktop-thumbnailer-HW209Y/gnome-desktop-thumbnailer.png (deleted)
17:07:08.294691 nautilus(5857): CW /tmp/flatpak-seccomp-BBH09Y (deleted)
17:07:08.294691 nautilus(5857): CW /tmp/flatpak-seccomp-BBH09Y (deleted)
17:07:22.252302 systemd(1): RCO /tmp/systemd-private-4e9ad0b7c811424f9e4e6d608cf9a5cc-systemd-hostnamed.service-gZ9ZeU (deleted)
17:07:22.252302 systemd(1): RCO /tmp/systemd-private-4e9ad0b7c811424f9e4e6d608cf9a5cc-systemd-hostnamed.service-gZ9ZeU/tmp (deleted)
17:14:54.822068 gsd-housekeepin(1596): O /tmp
17:14:54.822428 gsd-housekeepin(1596): R /tmp
17:14:54.822576 gsd-housekeepin(1596): R /tmp
17:14:54.824185 gsd-housekeepin(1596): R /tmp
17:14:54.825122 gsd-housekeepin(1596): O /tmp/hsperfdata_i2p
17:14:54.825122 gsd-housekeepin(1596): O /tmp/jna-101312875
17:14:54.825122 gsd-housekeepin(1596): O /tmp/hsperfdata_jorge
17:14:54.825122 gsd-housekeepin(1596): O /tmp/.Test-unix
17:14:54.825122 gsd-housekeepin(1596): O /tmp/.font-unix
17:14:54.825122 gsd-housekeepin(1596): O /tmp/.XIM-unix
17:14:54.825122 gsd-housekeepin(1596): O /tmp/.ICE-unix
17:14:54.825122 gsd-housekeepin(1596): O /tmp/babel-1164Pzz
17:14:54.825424 gsd-housekeepin(1596): O /tmp/UMS-jorge
17:14:54.831647 gsd-housekeepin(1596): R /tmp/jna-101312875
17:14:54.831647 gsd-housekeepin(1596): R /tmp/hsperfdata_i2p
17:14:54.831647 gsd-housekeepin(1596): R /tmp/hsperfdata_jorge
17:14:54.831793 gsd-housekeepin(1596): R /tmp/hsperfdata_jorge
17:14:54.831793 gsd-housekeepin(1596): R /tmp/hsperfdata_i2p
17:14:54.833650 gsd-housekeepin(1596): R /tmp/.Test-unix
17:14:54.833650 gsd-housekeepin(1596): R /tmp/.Test-unix
17:14:54.833748 gsd-housekeepin(1596): R /tmp/.font-unix
17:14:54.835771 gsd-housekeepin(1596): R /tmp/.XIM-unix
17:14:54.835771 gsd-housekeepin(1596): R /tmp/.XIM-unix
17:14:54.835863 gsd-housekeepin(1596): R /tmp/.ICE-unix
17:14:54.835863 gsd-housekeepin(1596): R /tmp/UMS-jorge
17:14:54.835922 gsd-housekeepin(1596): O /tmp/yaourt-tmp-jorge
17:14:54.835922 gsd-housekeepin(1596): O /tmp/.esd-1000
17:14:54.835922 gsd-housekeepin(1596): O /tmp/emacs1000
17:14:54.836083 gsd-housekeepin(1596): C /tmp
17:14:54.836131 gsd-housekeepin(1596): R /tmp/babel-1164Pzz
17:14:54.836564 gsd-housekeepin(1596): C /tmp/jna-101312875
17:14:54.838510 gsd-housekeepin(1596): C /tmp/.Test-unix
17:14:54.838559 gsd-housekeepin(1596): C /tmp/.font-unix
17:14:54.838590 gsd-housekeepin(1596): C /tmp/.XIM-unix
17:14:54.838752 gsd-housekeepin(1596): R /tmp/yaourt-tmp-jorge
17:14:54.838752 gsd-housekeepin(1596): R /tmp/emacs1000
17:14:54.838856 gsd-housekeepin(1596): R /tmp/emacs1000
17:14:54.840498 gsd-housekeepin(1596): R /tmp/.esd-1000
17:14:54.840567 gsd-housekeepin(1596): R /tmp/.esd-1000
17:14:54.849084 gsd-housekeepin(1596): C /tmp/babel-1164Pzz
17:14:54.850940 gsd-housekeepin(1596): C /tmp/hsperfdata_jorge
17:14:54.851143 gsd-housekeepin(1596): C /tmp/hsperfdata_i2p
17:14:54.851203 gsd-housekeepin(1596): C /tmp/.ICE-unix
17:14:54.851284 gsd-housekeepin(1596): C /tmp/UMS-jorge
17:14:54.851477 gsd-housekeepin(1596): C /tmp/yaourt-tmp-jorge (deleted)
17:14:54.858799 gsd-housekeepin(1596): C /tmp/emacs1000
17:14:54.858914 gsd-housekeepin(1596): C /tmp/.esd-1000
18:14:54.823216 gsd-housekeepin(1596): O /tmp
18:14:54.823430 gsd-housekeepin(1596): R /tmp
18:14:54.823544 gsd-housekeepin(1596): R /tmp
18:14:54.823618 gsd-housekeepin(1596): R /tmp
18:14:54.824448 gsd-housekeepin(1596): O /tmp/.esd-1000
18:14:54.824586 gsd-housekeepin(1596): O /tmp/emacs1000
18:14:54.824705 gsd-housekeepin(1596): O /tmp/UMS-jorge
18:14:54.824752 gsd-housekeepin(1596): O /tmp/hsperfdata_i2p
18:14:54.824752 gsd-housekeepin(1596): O /tmp/hsperfdata_jorge
18:14:54.824923 gsd-housekeepin(1596): O /tmp/.font-unix
18:14:54.824970 gsd-housekeepin(1596): O /tmp/.ICE-unix
18:14:54.825008 gsd-housekeepin(1596): O /tmp/.Test-unix
18:14:54.825008 gsd-housekeepin(1596): C /tmp
18:14:54.825008 gsd-housekeepin(1596): O /tmp/.XIM-unix
18:14:54.825100 gsd-housekeepin(1596): R /tmp/.esd-1000
18:14:54.825251 gsd-housekeepin(1596): R /tmp/emacs1000
18:14:54.825334 gsd-housekeepin(1596): R /tmp/UMS-jorge
18:14:54.825334 gsd-housekeepin(1596): R /tmp/hsperfdata_i2p
18:14:54.825402 gsd-housekeepin(1596): R /tmp/hsperfdata_i2p
18:14:54.825402 gsd-housekeepin(1596): R /tmp/hsperfdata_jorge
18:14:54.825464 gsd-housekeepin(1596): R /tmp/.font-unix
18:14:54.825464 gsd-housekeepin(1596): R /tmp/.ICE-unix
18:14:54.825527 gsd-housekeepin(1596): R /tmp/.Test-unix
18:14:54.825527 gsd-housekeepin(1596): R /tmp/.XIM-unix
18:14:54.825527 gsd-housekeepin(1596): C /tmp/.esd-1000
18:14:54.827944 gsd-housekeepin(1596): C /tmp/emacs1000
18:14:54.829924 gsd-housekeepin(1596): C /tmp/UMS-jorge
18:14:54.832092 gsd-housekeepin(1596): C /tmp/hsperfdata_jorge
18:14:54.834025 gsd-housekeepin(1596): C /tmp/.font-unix
18:14:54.834165 gsd-housekeepin(1596): C /tmp/.Test-unix
18:14:54.834228 gsd-housekeepin(1596): C /tmp/.XIM-unix
18:14:54.834273 gsd-housekeepin(1596): C /tmp/hsperfdata_i2p
18:14:54.834346 gsd-housekeepin(1596): C /tmp/.ICE-unix
19:13:13.835614 zsh(5268): O /tmp
19:13:13.835694 zsh(5268): RC /tmp

Edited 27 Nov 2017. We only hold this version.

1 points16 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
1 · 100% up
Kind
Text
ID
7fjdbf

Author

56
posts
146
comments
11
media
View profile

16 comments

There is a scrubbing process. Check it with sudo systemctl status systemd-tmpfiles-clean.timer

6 points

Nothing suspicious :(

jorge@sanson-gnu ~                                                                                   [20:39:19] 
> $ sudo systemctl status systemd-tmpfiles-clean.timer                                                         
[sudo] password for jorge: 
● systemd-tmpfiles-clean.timer - Daily Cleanup of Temporary Directories
   Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-clean.timer; static; vendor preset: disabled)
   Active: active (waiting) since Thu 2017-11-23 18:33:35 CST; 2 days ago
  Trigger: Sun 2017-11-26 15:35:16 CST; 18h left
     Docs: man:tmpfiles.d(5)
           man:systemd-tmpfiles(8)

nov 23 18:33:35 sanson-gnu systemd[1]: Started Daily Cleanup of Temporary Directories.
-6 points

Well, yes there is. That timer triggers a clean of all dirs mounted via tmpfiles, which includes /tmp. You may be able to exclude /tmp from the cleaning via a /etc/tmpfiles.d/*.conf file

4 points

Start gnome-control-center and look at the "Privacy" panel. Is the "Purge Trash & Temporary Files" setting enabled? This is what I believe gsd-housekeeping implements.

4 points

I would try to research this with a tool named fatrace that's in the AUR. It's a simple program that waits for processes doing file accesses and prints that to the terminal. You could combine it with grep, then just keep a terminal with it running and wait:

sudo fatrace | grep ' /tmp'

(that space character in front of the /tmp is intentional)

EDIT:

It has a parameter -c = --current-mount that's interesting. You would use it like this:

$ cd /tmp
$ sudo fatrace -c

EDIT2:

I just tested stuff here, and I think the tool might not be good for this problem. It doesn't really print anything if files get unlinked. There was a message about the rm process doing something when I tried rm -r *, but that was just by a side-effect, I guess, because the process had a deleted folder open at some point.

3 points

I will try to use it with the Emacs' server file that lives in /tmp and see what I got.

Thanks for the suggestion!

1 points

Unless configured otherwise /tmp is a tmpfs in Arch. That means it resides in the machine's RAM. The default configuration will use up to half of the total RAM. So with 8GB RAM /tmp can use up to 4GB.
As such it's expected to be emptied on a reboot. It shouldn't usually happen at runtime, as far as I know. But I may well be unaware of some scrubbing process or a mechanism freeing space for new files.

2 points

As such it's expected to be emptied on a reboot.

I know.

But I may well be unaware of some scrubbing process or a mechanism freeing space for new files.

That's two of us. However, I have not the configuration system-wide since long time ago, or enable anything that jerks around with /tmp so this situation is puzzling for me.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.