httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Bannert <>
Subject Re: Deamon tools
Date Mon, 13 May 2002 22:37:23 GMT
> > > 	if (setsid() fails)
> > > 		always log error
> > > 		exit(1) unless no_detach.
> > 
> > should that be
> >         exit(1) if no_detach
> > ? or do I have the logic backward?
> We should exit if setsid() fails and we don't want to detach (i.e.
> no_detach). If we don't exit at that point we will end up killing processes in
> the wrong pgrp later. So I think Aaron's right.

Now that I think about it a little more, we should probably always
exit if setsid() fails. It might be useful to change the error message
if no_detach is set ("setsid() failed probably because you aren't
running under a process management tool like daemontools" vs "setsid()
failed, unable to create new session"). Then we just do the fork fork()
if !no_detach. Confused yet?


View raw message