Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 4 down vote accepted

/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/

share|improve this answer
If it's tmpfs, it should get erased every time you turn off power, no? – m33lky Dec 21 '11 at 1:23
Yes, that's how /var/run gets cleaned every time to answer my own question. – m33lky Dec 21 '11 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 '11 at 19:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.