Re: general/2144: apache always detaches for normal operation

1998-08-31 Thread Janos Farkas
The following reply was made to PR general/2144; it has been noted by GNATS.

From: Janos Farkas [EMAIL PROTECTED]
To: Dean Gaudet [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: general/2144: apache always detaches for normal operation
Date: Mon, 31 Aug 1998 17:13:32 +0200

 On 1998-04-27 at 20:09:17, Dean Gaudet wrote:
  1.3 is in feature freeze... but if you want to work this out that's cool.
 
 Ok, I guess I am few months too late, but I just got around to the
 apache updating game now...  I think I managed to do it as cleanly as
 possible; without of course affecting users who don't know about it.
 
 So here's it, the essence of the change is very-very small; just making
 http_main.c detach() not if !one_process, but if !no_detach, and
 creating a new '-n' option to do just that, and for a bit more
 streamlining, making '-X' set one_process AND this new no_detach
 variable.  And of course updating all the getopt calls in there, and
 updating both the manual page, and the html docs to describe briefly
 what '-n' does.
 
 [Just an aside, most programs which can do a no-detach start, usually do
 that on '-f', but it's not available.  A few more programs use -n (the
 Linux klogd/syslogd, and amd IIRC), so I settled for that.]
 
 Janos
 
 Index: htdocs/manual/invoking.html
 ===
 RCS file: /cvs/apache-1.3/htdocs/manual/invoking.html,v
 retrieving revision 1.20
 diff -u -u -r1.20 invoking.html
 --- invoking.html  1998/07/19 21:34:58 1.20
 +++ invoking.html  1998/08/31 14:54:10
 @@ -59,6 +59,10 @@
  daemon does not detach from the terminal or fork any children. Do EMNOT/EM
  use this mode to provide ordinary web service.
  
 +DTCODE-n/CODE
 +DDRun the daemon without detaching from the terminal, but don't stop
 +it from creating child processes.
 +
  DTCODE-v/CODE
  DDPrint the version of httpd and its build date, and then exit.
  
 Index: src/main/http_main.c
 ===
 RCS file: /cvs/apache-1.3/src/main/http_main.c,v
 retrieving revision 1.387
 diff -u -u -r1.387 http_main.c
 --- http_main.c1998/08/13 01:55:06 1.387
 +++ http_main.c1998/08/31 14:54:26
 @@ -306,6 +306,12 @@
  
  static int one_process = 0;
  
 +/* nodetach -- don't detach on startup; has no effect on the further work of
 + * the server.
 + */
 +
 +static int no_detach = 0;
 +
  /* set if timeouts are to be handled by the children and not by the parent.
   * i.e. child_timeouts = !standalone || one_process.
   */
 @@ -954,6 +960,7 @@
  fprintf(stderr,   -f file  : specify an alternate 
ServerConfigFile\n);
  fprintf(stderr,   -C \directive\   : process directive before reading 
config files\n);
  fprintf(stderr,   -c \directive\   : process directive after  reading 
config files\n);
 +fprintf(stderr,   -n   : don't detach from the terminal\n);
  fprintf(stderr,   -v   : show version number\n);
  fprintf(stderr,   -V   : show compile settings\n);
  fprintf(stderr,   -h   : list available configuration 
directives\n);
 @@ -4100,7 +4107,7 @@
  is_graceful = 0;
  ++generation;
  
 -if (!one_process) {
 +if (!no_detach) {
detach();
  }
  else {
 @@ -4349,7 +4356,7 @@
  ap_setup_prelinked_modules();
  
  while ((c = getopt(argc, argv,
 -  D:C:c:Xd:f:vVhlL:St
 +  D:C:c:Xnd:f:vVhlL:St
  #ifdef DEBUG_SIGSTOP
Z:
  #endif
 @@ -4391,6 +4398,9 @@
exit(0);
case 'X':
++one_process;  /* Weird debugging mode. */
 +  /* flow through to no detach */
 +  case 'n':
 +  ++no_detach;
break;
  #ifdef DEBUG_SIGSTOP
case 'Z':
 @@ -5516,7 +5526,7 @@
  
  ap_setup_prelinked_modules();
  
 -while ((c = getopt(argc, argv, D:C:c:Xd:f:vVhlZ:iusSt)) != -1) {
 +while ((c = getopt(argc, argv, D:C:c:Xnd:f:vVhlZ:iusSt)) != -1) {
  char **new;
switch (c) {
case 'c':
 @@ -5577,6 +5587,9 @@
exit(0);
case 'X':
++one_process;  /* Weird debugging mode. */
 +  /* flow through to no detach */
 +  case 'n':
 +  ++no_detach;
break;
case 't':
configtestonly = 1;
 @@ -5707,12 +5720,13 @@
   * but only handle the -L option 
   */
  llp_dir = SHARED_CORE_DIR;
 -while ((c = getopt(argc, argv, D:C:c:Xd:f:vVhlL:SZ:t)) != -1) {
 +while ((c = getopt(argc, argv, D:C:c:Xnd:f:vVhlL:SZ:t)) != -1) {
switch (c) {
case 'D':
case 'C':
case 'c':
case 'X':
 +  case 'n':
case 'd':
case 'f':
case 'v':
 Index: src/support/httpd.8
 ===
 RCS file

Re: general/2144: apache always detaches for normal operation

1998-05-20 Thread brian
[In order for any reply to be added to the PR database, ]
[you need to include [EMAIL PROTECTED] in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]


Synopsis: apache always detaches for normal operation

State-Changed-From-To: open-suspended
State-Changed-By: brian
State-Changed-When: Wed May 20 05:30:23 PDT 1998
State-Changed-Why:
(suspend is the correct state for this)




general/2144: apache always detaches for normal operation

1998-04-28 Thread Janos Farkas

Number: 2144
Category:   general
Synopsis:   apache always detaches for normal operation
Confidential:   no
Severity:   non-critical
Priority:   medium
Responsible:apache
State:  open
Class:  change-request
Submitter-Id:   apache
Arrival-Date:   Mon Apr 27 16:30:00 PDT 1998
Last-Modified:
Originator: [EMAIL PROTECTED]
Organization:
apache
Release:1.3b6
Environment:
irrelevant, very generic
Description:
(Not a real problem, per se, but I guess it fits in this framework.)
Apache currently has no way to start up without detaching for normal
operation.  (-X makes it possible, but in a way that's not supposed to be used 
for
non-debugging purposes).  By providing a command-line switch to not detach
the main process, it would be much easier to watch and govern the running of 
apache with specialized tools.
For the worst example, init comes to mind, or a better example is djb's
svc/supervise from ftp://koobera.math.uic.edu/www/daemontools.html.  They could
be used to provide non-root access (operator/developer group, controlled by 
filesystem level access to a directory) to start/stop/restart/signal apache, 
which seems to be an often wanted feature.
How-To-Repeat:

Fix:
I can't believe it hasn't been already rehashed, but can't find any trace of it
in the FAQ, nor in the bugs database.  I can come up with a patch if this
is a feature which would be accepted if it requires no efforts from your
side. :)  Willing to provide even docs on how to get it to work with 
daemontools.
Audit-Trail:
Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include [EMAIL PROTECTED] in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]





Re: general/2144: apache always detaches for normal operation

1998-04-28 Thread Dean Gaudet
The following reply was made to PR general/2144; it has been noted by GNATS.

From: Dean Gaudet [EMAIL PROTECTED]
To: Janos Farkas [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: general/2144: apache always detaches for normal operation
Date: Mon, 27 Apr 1998 20:09:17 -0700 (PDT)

 1.3 is in feature freeze... but if you want to work this out that's cool.
 If you resubmit the patch after 1.3.0 is released it stands a better
 chance of being incorporated.
 
 Dean