Page 1 of 1

Re: [Nagios-devel] Race condition w/nagios.cmd

Posted: Sun Jan 25, 2004 3:09 pm
by Guest
Thanks -

I'll apply the patch to the 1-x branch tonight. Nagios 2.0 leaves
the command file around and tries to reuse it when it restarts.

On 23 Jan 2004 at 15:16, Jason Martin wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> There is a race condition regarding the external command fifo when
> Nagios is shutting down. This is especially evident when using nsca in
> inetd mode. The problem is that the reading end of the fifo closes
> prior to the fifo file being removed. This means that on a busy system
> many nsca processes will attempt to open the fifo in between the
> closing of the pipe and the removal of the fifo. Those nsca processes
> will forever be blocked on the open() of that fifo until they are
> manually killed.
>
> The fix to this is to unlink the fifo file prior to closing the
> reading end of the pipe. I've attached a patch to utils.c (from
> nagios-1.1) that reverses the order of the close and unlink to effect
> this.
>
> Also, is there a particular reason the nagios.cmd file is removed /
> recreated at launch? I'd think it would prevent some problems to have
> it check if an equivalent fifo (ie already has the necessary privs /
> name / properties) already exists, plus remove an annoying problem of
> failing to launch because that file exists from a previous instance.
>
> Thanks,
> - -Jason Martin


Ethan Galstad,
Nagios Developer
---
Email: [email protected]
Website: http://www.nagios.org






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]