Re: [Nagios-devel] event_handler pipe fd inheritation

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] event_handler pipe fd inheritation

Post by Guest »

Bastian Friedrich wrote:
> Hi,
>
> we are using a mechanism in our event_handlers that shall try to restart
> broken local services; eventually, normal init scripts (/etc/init.d/...) are
> started, which in turn start arbitrary daemons (say, mysql).
>
> nagios creates a pipe to its event_handlers (and possibly other executables)
> in base/util.c for parent/child communication. The file descriptor to this
> pipe is (currently) not given the FD_CLOEXEC. This results in this fd being
> inherited by the event_handler (started by "popen()"), and, in our case, by
> the daemon (say, mysql). (The pipe is, e.g., visible in /proc//fd).
> As our daemons do not tend to close arbitrary fd's, this fd is never closed
> from the event_handler. As nagios waits for the file to be closed to continue
> its work, this results in a "denial of service" for the time that the daemon
> runs.
>
> The pipe fd should be set the FD_CLOEXEC flag; it is then not inherited by the
> event_handler.
>
> Patch attached.
>
> Best regards
> Bastian

Thanks for the patch Bastian. Took a while to close it, but its in CVS now.





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