Re: [Nagios-devel] PATCH: Fix (make it less likely to happen) race

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] PATCH: Fix (make it less likely to happen) race

Post by Guest »

Martin Knoblauch wrote:
> Hi,
>
> there is apparently a race in the stop/restart functionality of the
> nagios init script.
>
> When doing stop or restart, the "$NagiosRunFile" can disappear between
> the check for existence and the "head" command in the status_nagios
> function. As a result one gets a nasty usage message from "ps".
>
> Observed on RHEL4/x86_64 with Nagios 2.6 and 2.7. The following patch
> seems to scare away the problem. It does not fix the race, but the
> problem does no longer occur.
>
> For me the additional 2 sec delay in stop/restart is acceptable.
>

I rewrote the init script a bit to help ensure this doesn't happen. The
head command is run to get the pid before it can be deleted by a
restart, etc. Patches are now in CVS for the 2.x and 3(HEAD) branches.
Thanks for the note!


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]
Locked