Page 1 of 1

NCPA PID file location change

Posted: Thu Apr 04, 2024 7:36 am
by shoreypu
Our team is looking into intermittent issues where NCPA services do not start on Linux because the prior PID file still exists after a reboot. The ncpa.cfg is configured to put both the pid files and associated log files, for ncpa_passive & listener, in var/run/ncpa_..., which is putting the the files in /usr/local/ncpa/var/run/. If we update the location, by adding a front /, for example, pidfile = /var/run/ncpa_listener.pid and /var/log/ncpa_listener.log, then restart the services, we noted that the ncpa_listener.log moves to /var/log/, as expected, but the ncpa_listener.pid remains in /usr/local/ncpa/var/run/. Why does the log file move as expected, but the pid file does not? Is there another way or place we need to update to move the pid file?

The reason we are trying to move the pid file is to ensure that it is deleted on reboot.

Thanks in advance.

Re: NCPA PID file location change

Posted: Fri Apr 05, 2024 9:40 am
by jsimon
Hi @shoreypu,

My first thought is that it's possible a permissions issue is preventing the user that ncpa runs as from moving the pid files. I would recommend taking a look at the permissions on the existing pid files that are in the location you are trying to move them out of. You'll want to make sure they match whatever user you have ncpa configured to run as (nagios user by default)

Re: NCPA PID file location change

Posted: Fri Apr 05, 2024 9:43 am
by bbahn
Hello @shoreypu,

It would seem that you are encountering an issue with NCPA 2. Have you set your loglevel to debug and checked your logs to see if any errors are occuring?

Also, NCPA 3.0.2 recently got an upgrade in how it handles its PID file and I suggest that you try upgrading to solve your issue.

Re: NCPA PID file location change

Posted: Tue Apr 09, 2024 4:51 am
by oilumiun12
bbahn wrote: Fri Apr 05, 2024 9:43 am Hello @shoreypu,

It would seem that you are encountering an issue with NCPA 2. Have you set your loglevel to debug and checked your logs to see if any errors are occuring?

Also, NCPA 3.0.2 recently got an upgrade in how it handles its PID file and I suggest that you try upgrading to solve your issue.
i was also having this trouble and after debugging it seems to be fixed. Thank you for sharing so much