Tuesday 7 February 2017

A quick note on the /var/run directory

You learn something new every day - after manually creating the a directory under /var/run I noticed that the directory did not persist on a reboot.

Application startup script manually create necessary folders upon boot.

Now normally the /run file system is mounted as a tempfs - you can easily verify this with:

fd -H | grep /run

Although on closer inspection /var/run is actually a symbolic link to /run!

So in order for us to ensure that the directory for our service (haproxy in this case) is created with the service startup script.

Or in my case - I simply changed the socket file path to use the parent directory /run instead of /run/haproxy e.g.:

stats socket /run/haproxy_admin.sock mode 660 level admin

sudo service haproxy restart & sudo service haproxy status


0 comments:

Post a Comment