monit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: solaris and kill(pid, 0)


From: Jan-Henrik Haukeland
Subject: Re: solaris and kill(pid, 0)
Date: 23 Oct 2002 12:40:41 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Civil Service)

Christian Hopp <address@hidden> writes:

> On 23 Oct 2002, Jan-Henrik Haukeland wrote:
> 
> > Could this be a classic synchronization problem?
> 
> Yep... I consulted google!
> 
> Linux has a per-thread errno. (-:  So we do not see any trouble there!

There you go.

> I substituted kill(foo)==0 by getpgid(bar)>0.  That seems to work cuz
> it doesn't wake up anything. Tnx to Oliver for the hint.

Yes, that should work, you have to use the same hack as with kill(0)
though in a check for a running process, i.e. but I guess I do not
have to say that :)

  if(getpgid(pid) == 0 || errno == EPERM)
  

> Solaris 7 doesn't have "thread specific errno". Hgrmph!

Good thing Sun is starting to replace Solaris with Linux 


> > [1] Aha, maybe the kill(0) signal on Solaris wakes up the monit daemon
> > in it's sleep phase. This sounds plausible and then you will have a
> > race condition on which thread sets errno. One soulution could be to
> > mask out the 0 signal if possible at all in a signal(0, SIG_IGN) ?
> 
> Don't know, we simply don't use kill anymore. (-:

Thinking twice about it I'm pretty sure this is the reason, especially
if it works now :)


-- 
Jan-Henrik Haukeland




reply via email to

[Prev in Thread] Current Thread [Next in Thread]