Failed to obtain lock on file /var/run/ Permission denied

This error is caused by Nagios not having access to the folder where it should save it`s PID file. You can change the path for the PID file (and then also fixing the issue) by editing your nagios.conf (usually /etc/nagios/nagios.conf).

Locate the lock_file setting:


And change it to another path, like for example /tmp.

Start up Nagios again and it should be much happier šŸ™‚

3 thoughts on “Failed to obtain lock on file /var/run/ Permission denied

  1. mkdir /var/run/nagios
    chown nagios:nagios /var/run/nagios


    And report a bug for your distro šŸ™‚

  2. I just faced the similar issue and created nagios.lock file manually, changed permissions and ownership. That worked for me fine.

    location of file:

    touch nagios.lock
    chmod 664 nagios.lock
    chown root:nagiosops nagios.lock