I've noticed that empty directories get deleted from /var/run/
on reboot. I'm wondering if that's something Ubuntu does or something that I have installed.
1 Answer
/var/run
is a symlink on /run
and that's just a tmpfs
mount created on boot. Everything in it is stored in RAM and dies at reboot.
So things are already slightly different. I can't see anything about tmpfs
being set up to autoclean other than on reboots though and I've just run through this:
sudo mkdir /run/pie
sudo touch /run/pie/pies
sudo rm /run/pie/pies
ls # /run/pie/ still exists, empty
So it might be just you - or it might be a cleanup daemon. I've had a quick search through /etc
but can't find anything. You might have more luck: sudo grep -R 'tmpfs' /etc/
-
If it's tmpfs, it should get erased every time you turn off power, no?– m33lkyDec 21, 2011 at 1:23
-
Yes, that's how
/var/run
gets cleaned every time to answer my own question.– m33lkyDec 21, 2011 at 18:18 -
I actually answered that in the second sentence :P Edit: I see the confusion. I'm operating under the assumption you're seeing things disappear on a live system without restarting. If you're just rebooting and noticing things are gone, then yes, that's just the nature of tmpfs.– Oli ♦Dec 21, 2011 at 19:01