PATCH: Fix (make it less likely to happen) race in nagios init script

Ethan Galstad nagios at nagios.org
Mon Apr 9 20:17:22 CEST 2007


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: nagios at nagios.org
Website: http://www.nagios.org

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV




More information about the Developers mailing list