AW: Nagios 2.0b4 restart issue

Thibault Genessay tgenessay at aliadis.fr
Tue Nov 29 11:52:51 CET 2005


Andreas Ericsson wrote:

> No it's not. Multiple instances has absolutely nothing to do with what 
> the shell returns when asked to run a program. In this case, it does
>
>     result = execve(argv[0], argv, envp);
>     /* execve() only returns on errors, so hint what went wrong */
>     exit (-errno);
>
> and since ENOENT == 2 this results in a return code of -127 on all 
> architectures that implement the two-complement bit pattern.
>
Andreas, I'm getting away from the initial topic, but I've tryed the 
following code:
#include <errno.h>
int main(int argc, char* argv[])
{
  int dontcare = execv(argv[1], argv);
  printf("Returning -(%d) to the shell\n", errno);
  exit(-errno);
}
Then I called it with something stupid (e.g. ./a.out does-not-exist) and 
echoed the $?, which happens to be 254. Seems to be something like 
signed/unsigned issue.
Anyway this program returns 254 on my x86 box so the 127 value mentioned 
in this thread might come from somewhere else.

As for Radkon's problem, I remember having had to kill -9 Nagios' 
processes from time to time when checking/debuging the configuration and 
NEB and playing too intensively with the [re]start/stop script -- but 
this did not yield 127 errors.
Radkon, does the problem appear *only* when you restart nagios with the 
init script ? Never when start/stop is used nor when launched from the 
shell ?

-- 
Thibault GENESSAY
ALIADIS
www.aliadis.fr
Tel.  0870 723 724
Fax   04 72 13 90 40 



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click




More information about the Developers mailing list