monit-general
[Top][All Lists]
Advanced

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

Re: Monit doesn't detach from the tty


From: Rory Toma
Subject: Re: Monit doesn't detach from the tty
Date: 07 Aug 2002 18:20:28 -0700

On Wed, 2002-08-07 at 17:51, Mark Ferlatte wrote:
> On Wed, Aug 07, 2002 at 05:40:39PM -0700, Rory Toma wrote (0.15):
> > 1) why use _exit(0) instead of exit(0)?
> 
> monit registers an atexit() handler in log.c, and calling exit() would
> trigger it, which would be incorrect.  _exit() doesn't run atexit()
> handlers, which is correct in daemonize().

I missed that.

I checked into CVS a fix that makes it properly detach from the tty (at
least it does on my Linux and Solaris 8 box) and also dup2's 0,1 and 2
and closes them off. I suspect the comment in env.c about weird things
happening if you close them is because with no 0,1 or 2 present, future
fd's will happily re-use them otherwise, and yes, weird things can
happen.

Attatched is a patch...



-- 
Rory Toma               address@hidden
VP of Run Level 5       http://www.trs80.net
Digeo Digital           http://www.digeo.com

Attachment: patch
Description: Text document

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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