# /var/run Permissions Problem

## Anquietas

Hello,

A have a wierd problem... 

I think it's related to /var/run, or /run (in Gentoo systems)

I have problems with 2 services: clamav and named. Both are writing files in /var/run/... or at least they are trying...

The first problem is if I reboot the system, I think /run gets remounted or something like this, and it DOES NOT recreate the "clamav" directory in /var/run .

And the config files of ClamAv use the "/var/run/clamav/*.pid" path to deposit their PID files.

Obviously, the pid files cannot be written due to the fact that "clamav" directory is missing.

The second problem is that BIND Named also uses /var/run/named/*.pid to deposit it's PID files, but in this case, the "named" folder IS recreated in /var/run after reboot, but with wrong permissions (rwxr-x--- with owner root and group named).

I have to manually chmod to RWXRWX--- to enable the WRITE permission for group named, in order for the nameserver daemon to be able to WRITE into that folder.

And of course, recreating the 'clamav' folder manually, and setting permissions manually on 'named' folder after each reboot, and restarting services manually is, of course, out of the question.

I think the problem is somewhere in the recreation of elements in /var/run (or /run) directory.

Please advice !

----------

## Hu

Those directories are meant to be ephemeral.  The init script for the relevant daemon should be creating the directory if the daemon does not do so on its own.

----------

