Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.