Folder disappearing from /var/run upon reboot with Ubuntu 12.04

I'm running php5-fpm on Ubuntu using a UNIX socket at /var/run/php5-fpm/www.conf.sock. During the installation I have created manually the php5-fpm folder inside /var/run/ so that php5-fpm could create its socket in it, which it can. The problem is that whenever I restart my computer the php5-fpm folder disappears from /var/run and php5-fpm is no longer able to create the socket, thus every time I reboot I need to create the /var/run/php5-fpm/ folder again manually. I could put that routine in the /etc/init.d/php5-fpm startup script but am wondering the following:

Are there any reasons why the /var/run/php5-fpm/ folder should be removed upon reboot?

info: I'm running ubuntu 12.04 desktop (I'm planning on using the server version on a hosting but am for now doing some testing with the desktop version on my laptop).


Solution 1:

If you run df -T, you will find a line similar to this:

none         tmpfs     1028284      3888   1024396   1% /var/run

This means that /var/run is a temporary file storage. So, it is not maintained between reboots.

You need to create the folder each time you start your service/daemon if not already created.