Re: configure.in help

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sun, 16 Jul 2000 02:19:48 +0200

The patch I am committing is the one described last, not the old patch.

Connect stdin,stdout,stderr to /dev/null when starting in daemon mode,
unless -d is used in which case stdout/stderr is left alone.

/Henrik

Robert Collins wrote:
>
> Thanks..
>
> In 2.4 you don't need -d to enter daemon mode - it defaults on, and you
> need -N to prevent it..
>
> Can we make the connection to /dev/null a feature of the exec call rather
> than the commandline needed to launch squid? or perhaps introduce another
> switch? I like the current behaviour...
>
> As I read the code the default launch process in 2.4 is (ie cmd line is
> "/usr/local/squid/bin/squid")
>
> parse the config
> fork.
> -Parent returns (0)
> * -child closes fd's
> -forks again
> --Parent waits for return code
> --child exec's squid again, this copy runs without stdin,out or err.
>
> With your patch, the process noted with * will still have stdin /out /err
> open, on windows 9x or NT this will mean a console window open unless it is
> run with a service wrapper. (Not a bad thing.)
> However without the patch it should quite happily just launch, and close the
> console window. - which I think is 'nicer' behaviour.
>
> Rob
>
> ----- Original Message -----
> From: "Henrik Nordstrom" <hno@hem.passagen.se>
> To: "Robert Collins" <robert.collins@itdomain.com.au>
> Cc: <squid-dev@squid-cache.org>
> Sent: Sunday, July 16, 2000 9:58 AM
> Subject: Re: configure.in help
>
> > Robert Collins wrote:
> > >
> > > Well the error status isn't set properly when the stackdump occurs..
> thanks
> > > I'll pass that back to the cygwin group.
> > >
> > > Uhmmm re starting programs with fd 0, 1 & 2 closed - that's the
> behaviour
> > > of squid right before the active child is execvp'd. I'm trying to
> minimise
> > > the platform specific changes in the main code. Should I modify squid to
> > > link those fd's to /dev/null ?
> >
> >
> > Ah.. the daemon mode. Forgot about that as I am not using it during
> > development, and all my production systems have this patched to not
> > close stdin/stdout/stderr..
> >
> >
> http://squid.sourceforge.net/hno/patches/squid-2.2.STABLE4.daemon-mode-stdio
> .patch
> >
> > Why I haven't committed this patch to the main sources is because this
> > is not the best way to do it. In daemon mode stdin should be connected
> > to /dev/null, stdout and stderr should also be connected to /dev/null
> > unless the -d flag is used in which case both should be left alone.
> >
> > Patch is on the way. It will appear in the cygwin code withing a few
> > minutes.
> >
> > /Henrik
> >
Received on Sat Jul 15 2000 - 18:19:40 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:32 MST