[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Monit doesn't detach from the tty
From: |
Mark Ferlatte |
Subject: |
Re: Monit doesn't detach from the tty |
Date: |
Wed, 7 Aug 2002 17:51:57 -0700 |
User-agent: |
Mutt/1.4i |
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().
> 2) I noticed that we also keep fd 0, 1 and 2 open. Generally, I've used
> dup2 to copy 0 1 and 2 to and closed them off.
It looks like it tries to do this in env.c:set_sandbox(), but I don't
think it does it correctly: it only opens 0,1 and 2 to /dev/null if they
are closed before set_sandbox() gets called... and it doesn't look like
they ever get closed, so they remain open (pointing at the tty, I'd
imagine). They probably should get closed first, and then reopened
pointing to /dev/null.
Course, this particular bug hasn't bit me yet, so <shrug>I
dunno</shrug>.
M
pgpYIfxPpXclM.pgp
Description: PGP signature
- Monit doesn't detach from the tty, Mark Ferlatte, 2002/08/07
- Re: Monit doesn't detach from the tty, Rory Toma, 2002/08/07
- Re: Monit doesn't detach from the tty,
Mark Ferlatte <=
- Re: Monit doesn't detach from the tty, Rory Toma, 2002/08/07
- postfix, anyone, Rory Toma, 2002/08/07
- Re: postfix, anyone, Igor Homyakov, 2002/08/08
- Re: postfix, anyone, rory, 2002/08/08
- Re: postfix, anyone, Christian Hopp, 2002/08/08
- Re: postfix, anyone, rory, 2002/08/08
- Re: postfix, anyone, Mark Ferlatte, 2002/08/08
- Re: Monit doesn't detach from the tty, Rory Toma, 2002/08/07
Re: Monit doesn't detach from the tty, Jan-Henrik Haukeland, 2002/08/07