Configuration loading twice - how to cope?

2002-01-10 Thread William R Ward


The Apache server processes its config file twice when starting up,
and our code doesn't react well to that.  On the first pass,
everything initializes hunky-dorily (if that's a word), but on the
second pass lots of stuff that is assumed to be loaded in memory
doesn't work.

This has been working just fine under our old setup, using Apache
httpd version 1.3.14, mod_perl 1.24_01, and Perl 5.00503.  But we're
trying to upgrade to 1.3.22, 1.26, and 5.6.2 respectively, and now
we have lots of problems.

What I think I need to do is add some logic to test which pass we are
currently running, and act according to that.  Or are there any known
bugs in Apache, mod_perl, or Perl that might be causing the trouble?

--Bill.

-- 
William R Ward[EMAIL PROTECTED]  http://www.wards.net/~bill/
-
 If you're not part of the solution, you're part of the precipitate.



Re: Configuration loading twice - how to cope?

2002-01-10 Thread Geoffrey Young

William R Ward wrote:
 
 The Apache server processes its config file twice when starting up,
 and our code doesn't react well to that.  On the first pass,
 everything initializes hunky-dorily (if that's a word), but on the
 second pass lots of stuff that is assumed to be loaded in memory
 doesn't work.
 
 This has been working just fine under our old setup, using Apache
 httpd version 1.3.14, mod_perl 1.24_01, and Perl 5.00503.  But we're
 trying to upgrade to 1.3.22, 1.26, and 5.6.2 respectively, and now
 we have lots of problems.

hrm.  the problem might not be the double-loading of httpd.conf then -
that's been around since, well, before most of us (I tracked that down
to apache 0.9 once through list archives)

more likely is this:
  http://marc.theaimsgroup.com/?l=apache-modperlm=100510779912574w=2

and the other reports in the archives that describe the same thing.

 
 What I think I need to do is add some logic to test which pass we are
 currently running, and act according to that.  Or are there any known
 bugs in Apache, mod_perl, or Perl that might be causing the trouble?

there is $Apache::Server::Starting, which is true only when the server
is starting, which may be helpful to you.

you may also want to consider putting your code in a
PerlRestartHandler, which runs on restarts.  since the second reading
of httpd.conf is technically a restart for mod_perl, a
PerlRestartHandler runs when you issue apachectl start or apachectl
restart.

HTH

--Geoff



Re: Configuration loading twice - how to cope?

2002-01-10 Thread Hans Poo

El Mié 09 Ene 2002 18:16, William R Ward escribió:
 The Apache server processes its config file twice when starting up,
 and our code doesn't react well to that.  On the first pass,
 everything initializes hunky-dorily (if that's a word), but on the
 second pass lots of stuff that is assumed to be loaded in memory
 doesn't work.

 This has been working just fine under our old setup, using Apache
 httpd version 1.3.14, mod_perl 1.24_01, and Perl 5.00503.  But we're
 trying to upgrade to 1.3.22, 1.26, and 5.6.2 respectively, and now
 we have lots of problems.

 What I think I need to do is add some logic to test which pass we are
 currently running, and act according to that.  Or are there any known
 bugs in Apache, mod_perl, or Perl that might be causing the trouble?

 --Bill.

I am not sure if i saw it in the eagle book, but as i remember apache make a 
fake checking start first after the real start of the server. This may be 
what you are seeing.

Hans Poo



Re: Configuration loading twice - how to cope?

2002-01-10 Thread Perrin Harkins

 hrm.  the problem might not be the double-loading of httpd.conf then -
 that's been around since, well, before most of us (I tracked that down
 to apache 0.9 once through list archives)

 more likely is this:
   http://marc.theaimsgroup.com/?l=apache-modperlm=100510779912574w=2

 and the other reports in the archives that describe the same thing.

And my suggestion for dealing with that in the short term is to change your
PerlModule directives to use Module; inside startup.pl or Perl sections.

- Perrin




Re: Configuration loading twice - how to cope?

2002-01-10 Thread William R Ward

Geoffrey Young [EMAIL PROTECTED] writes:
 William R Ward wrote:
  
  The Apache server processes its config file twice when starting up,
  and our code doesn't react well to that.  On the first pass,
  everything initializes hunky-dorily (if that's a word), but on the
  second pass lots of stuff that is assumed to be loaded in memory
  doesn't work.
  
  This has been working just fine under our old setup, using Apache
  httpd version 1.3.14, mod_perl 1.24_01, and Perl 5.00503.  But we're
  trying to upgrade to 1.3.22, 1.26, and 5.6.2 respectively, and now
  we have lots of problems.
 
 hrm.  the problem might not be the double-loading of httpd.conf then -
 that's been around since, well, before most of us (I tracked that down
 to apache 0.9 once through list archives)
 
 more likely is this:
   http://marc.theaimsgroup.com/?l=apache-modperlm=100510779912574w=2
 
 and the other reports in the archives that describe the same thing.

Thanks for the tip, but I looked at that article and it doesn't appear
to offer a solution, just more questions.  It says the problem is
fixed in version 1.26, but I still see the problem even with that
version.

  What I think I need to do is add some logic to test which pass we are
  currently running, and act according to that.  Or are there any known
  bugs in Apache, mod_perl, or Perl that might be causing the trouble?
 
 there is $Apache::Server::Starting, which is true only when the server
 is starting, which may be helpful to you.
 
 you may also want to consider putting your code in a
 PerlRestartHandler, which runs on restarts.  since the second reading
 of httpd.conf is technically a restart for mod_perl, a
 PerlRestartHandler runs when you issue apachectl start or apachectl
 restart.

I'll try these.  Thanks.

--Bill.

-- 
William R Ward[EMAIL PROTECTED]  http://www.wards.net/~bill/
-
 If you're not part of the solution, you're part of the precipitate.