If you were running CentOS 7, but you still had /etc/init.d/nagios file, and you had this line in it (somewhere on the top):
Code: Select all
# lock_file=/usr/local/nagios/var/nagios.lock
systemd would use, create a unit file in /var/systemd/generator.late, and use the path to the nagios.lock, listed above. It doesn't matter this line is "commented out".
See more on systemd/init compatibility here:
https://www.turnkeylinux.org/blog/debug ... nit-compat
There are a couple of ways for fixing it.
1. Change the path to match whatever you have in the nagios.cfg, leave the nagios init file, and remove the unit file. We have a guide for people who use ModGearman, and need to downgrade Nagios Core, which explains how to set the proper lock locations.
https://support.nagios.com/kb/article/n ... e-823.html
This method will have some disadvantages, especially if you used the "old" style commands, e.g.
Code: Select all
service nagios stop
service nagios start
The service may be running but in the GUI, it may show as "not running" (or vise versa). The GUI uses:
So, this is not ideal if you are using an init file on CentOS 7. One way around this is to use the "new" style commands:
Code: Select all
systemctl stop nagios
systemctl start nagios
2. The second method would be go create a unit file, and get rid of the nagios init file completely.
Hope this makes sense.