You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jamie Krasnoo <te...@planetphat.com> on 2000/12/21 00:20:57 UTC

slight mod_perl problem

Ok, it seems that my startup.pl is being run twice on server start.

Startup init running
startup.pl - loading templates into memory
--- Loaded template file user_reg.tmpl
Startup init running
startup.pl - loading templates into memory
--- Loaded template file user_reg.tmpl
[Wed Dec 20 15:18:21 2000] [notice] Apache/1.3.14 (Unix) mod_perl/1.24_01\
configured -- resuming normal operations

Anyone have an explanation as to why this is happening, I have no hair
left due to trying to figure this one out.


Thanks for your help,

Jamie



RE: slight mod_perl problem

Posted by Douglas Wilson <do...@racesearch.com>.
Would this be the reason?
http://perl.apache.org/guide/config.html#Apache_Restarts_Twice_On_Start

> -----Original Message-----
> From: Jamie Krasnoo [mailto:tekton@planetphat.com]
> Sent: Wednesday, December 20, 2000 3:21 PM
> To: modperl@apache.org
> Subject: slight mod_perl problem
>
>
> Ok, it seems that my startup.pl is being run twice on server start.
>
> Startup init running
> startup.pl - loading templates into memory
> --- Loaded template file user_reg.tmpl
> Startup init running
> startup.pl - loading templates into memory
> --- Loaded template file user_reg.tmpl
> [Wed Dec 20 15:18:21 2000] [notice] Apache/1.3.14 (Unix) mod_perl/1.24_01\
> configured -- resuming normal operations
>
> Anyone have an explanation as to why this is happening, I have no hair
> left due to trying to figure this one out.
>
>
> Thanks for your help,
>
> Jamie
>
>
>


Re: slight mod_perl problem

Posted by Darren Duncan <da...@DarrenDuncan.net>.
On Wed, 20 Dec 2000, Jamie Krasnoo wrote:
> Ok, it seems that my startup.pl is being run twice on server start.

Since configuration scripts can include other scripts, you probably have
more than one other script that includes startup.pl, or more than one
script that includes something that includes startup.pl, or other such.
This is a commonly encountered situation in programming.

What you need to do is scan your other relevant config files to look for
multiple includes of another file and remove one.  Or, if this isn't
feasible, then there may be some conditional that you can use to check if
you already ran a script, and then not do it again.

Of course, there could be a different reason that this is happening...

// Darren Duncan




Re: slight mod_perl problem

Posted by Vivek Khera <kh...@kciLink.com>.
>>>>> "DM" == Doug MacEachern <do...@covalent.net> writes:

DM> On Thu, 21 Dec 2000, Vivek Khera wrote:
>> I just tested it also, and the startup script is run exactly once.

DM> could be he has PerlFreshRestart On, in which case it would be
DM> called twice.

I have it on as well, and it was only called once.  I'm running
mod_perl as a DSO, though.  Perhaps that's the difference?

Re: slight mod_perl problem

Posted by Doug MacEachern <do...@covalent.net>.
On Thu, 21 Dec 2000, Vivek Khera wrote:

> >>>>> "SB" == Stas Bekman <st...@stason.org> writes:
> 
> >> startup.pl does not get repeated on a restart. However it will when
> >> started with ./apachectl start. I have never encountered this with Apache
> >> 1.3.12 or 13.
> 
> SB> I've just tested it -- it's not.
> 
> I just tested it also, and the startup script is run exactly once.

could be he has PerlFreshRestart On, in which case it would be called
twice.


Re: slight mod_perl problem

Posted by Vivek Khera <kh...@kciLink.com>.
>>>>> "SB" == Stas Bekman <st...@stason.org> writes:

>> startup.pl does not get repeated on a restart. However it will when
>> started with ./apachectl start. I have never encountered this with Apache
>> 1.3.12 or 13.

SB> I've just tested it -- it's not.

I just tested it also, and the startup script is run exactly once.

This is on: Apache/1.3.14 (Unix) mod_perl/1.24_02-dev

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera@kciLink.com       Rockville, MD       +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/

Re: slight mod_perl problem

Posted by Stas Bekman <st...@stason.org>.
> startup.pl does not get repeated on a restart. However it will when
> started with ./apachectl start. I have never encountered this with Apache
> 1.3.12 or 13.

I've just tested it -- it's not.

The I<startup.pl> file and similar loaded via C<PerlModule> or
C<PerlRequire> are compiled only once. Because once the module is
compiled it enters the special C<%INC> hash. When Apache
restarts--Perl checks whether the module or script in question is
already registered in C<%INC> and won't try to compile it again.

> 
> Jamie
> 
> 
> On Thu, 21 Dec 2000, Stas Bekman wrote:
> 
> > On Wed, 20 Dec 2000, Jamie Krasnoo wrote:
> > 
> > > Ok, it seems that my startup.pl is being run twice on server start.
> > > 
> > > Startup init running
> > > startup.pl - loading templates into memory
> > > --- Loaded template file user_reg.tmpl
> > > Startup init running
> > > startup.pl - loading templates into memory
> > > --- Loaded template file user_reg.tmpl
> > > [Wed Dec 20 15:18:21 2000] [notice] Apache/1.3.14 (Unix) mod_perl/1.24_01\
> > > configured -- resuming normal operations
> > > 
> > > Anyone have an explanation as to why this is happening, I have no hair
> > > left due to trying to figure this one out.
> > 
> > See
> > http://perl.apache.org/guide/config.html#Apache_Restarts_Twice_On_Start
> > 
> > Apache restarts twice indeed, but it shouldn't rerun the startup.pl since
> > it's already require()d and in %INC. 
> > 
> > > 
> > > 
> > > Thanks for your help,
> > > 
> > > Jamie
> > > 
> > > 
> > > 
> > 
> > 
> > 
> > _____________________________________________________________________
> > Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
> > http://stason.org/       mod_perl Guide  http://perl.apache.org/guide 
> > mailto:stas@stason.org   http://apachetoday.com http://logilune.com/
> > http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  
> > 
> > 
> 
> 



_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide 
mailto:stas@stason.org   http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  



Re: slight mod_perl problem

Posted by Jamie Krasnoo <te...@planetphat.com>.
startup.pl does not get repeated on a restart. However it will when
started with ./apachectl start. I have never encountered this with Apache
1.3.12 or 13.

Jamie


On Thu, 21 Dec 2000, Stas Bekman wrote:

> On Wed, 20 Dec 2000, Jamie Krasnoo wrote:
> 
> > Ok, it seems that my startup.pl is being run twice on server start.
> > 
> > Startup init running
> > startup.pl - loading templates into memory
> > --- Loaded template file user_reg.tmpl
> > Startup init running
> > startup.pl - loading templates into memory
> > --- Loaded template file user_reg.tmpl
> > [Wed Dec 20 15:18:21 2000] [notice] Apache/1.3.14 (Unix) mod_perl/1.24_01\
> > configured -- resuming normal operations
> > 
> > Anyone have an explanation as to why this is happening, I have no hair
> > left due to trying to figure this one out.
> 
> See
> http://perl.apache.org/guide/config.html#Apache_Restarts_Twice_On_Start
> 
> Apache restarts twice indeed, but it shouldn't rerun the startup.pl since
> it's already require()d and in %INC. 
> 
> > 
> > 
> > Thanks for your help,
> > 
> > Jamie
> > 
> > 
> > 
> 
> 
> 
> _____________________________________________________________________
> Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
> http://stason.org/       mod_perl Guide  http://perl.apache.org/guide 
> mailto:stas@stason.org   http://apachetoday.com http://logilune.com/
> http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  
> 
> 


Re: slight mod_perl problem

Posted by Stas Bekman <st...@stason.org>.
On Wed, 20 Dec 2000, Jamie Krasnoo wrote:

> Ok, it seems that my startup.pl is being run twice on server start.
> 
> Startup init running
> startup.pl - loading templates into memory
> --- Loaded template file user_reg.tmpl
> Startup init running
> startup.pl - loading templates into memory
> --- Loaded template file user_reg.tmpl
> [Wed Dec 20 15:18:21 2000] [notice] Apache/1.3.14 (Unix) mod_perl/1.24_01\
> configured -- resuming normal operations
> 
> Anyone have an explanation as to why this is happening, I have no hair
> left due to trying to figure this one out.

See
http://perl.apache.org/guide/config.html#Apache_Restarts_Twice_On_Start

Apache restarts twice indeed, but it shouldn't rerun the startup.pl since
it's already require()d and in %INC. 

> 
> 
> Thanks for your help,
> 
> Jamie
> 
> 
> 



_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide 
mailto:stas@stason.org   http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/