Multiple Nagios proccesses running.

Chris Wilson chris at aidworld.org
Fri Jul 29 11:06:43 CEST 2005


Hi Andreas,

> * C++ style comments aren't portable enough.

OK, that's easily fixed.

> * It isn't in "Ethan style" (nothing but Ethan's code is, but patches 
> just aren't accepted unless they are).

Apart from "no spaces anywhere", what is Ethan's style? :-) Is the
attached patch better?

> * I don't understand where you're reading the pid from the lockfile. All 
> I see are two calls to getpid(2). If this is actually true, the patch 
> will fix absolutely nothing.

Just above, in the code that's already there, the pid file is read:

        if((val=read(lockfile,buf,(size_t)10))<0){
	...
        if(val>0){
                if((val=sscanf(buf,"%d",&pidno))<1){

However, it does nothing with the pidno. That's what I'm using.

> This isn't portable. On some systems it will return -1 and set errno to 
> EINVAL. This is particularly true for systems that follow the pre-2001 
> POSIX.1 standard. This behaviour is actually also POSIX-compatible. The 
> result you're seeing on your system when testing this is an extension to 
> the standard.

OK, but we can handle an EINVAL error sensibly. I've changed the patch
to not exit if the kill command returns EINVAL.

Or we could only enable the patch on machines where it works. You said
before there was no portable POSIX way of testing for a process'
existence, so I guess we have to look for a non-portable way :-(

> Then the bug is in either the Linux kernel, the GNU libc library or the 
> compiler with the kernel being the most likely. What filesystem are you 
> using?

Just standard ext3. Linux dev.aidworld.org 2.6.10-1.771_FC2smp. I guess
I am not the only Linux user to see this problem.

Cheers, Chris.
-- 
(aidworld) chris wilson | chief engineer (chris at aidworld.org)



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list