Re: Reloading Modules Problem [mod_perl2]

[prev] [thread] [next] [Date index for 2005/01/05]

From: Vincent Moneymaker
Subject: Re: Reloading Modules Problem [mod_perl2]
Date: 04:28 on 05 Jan 2005
Stas Bekman wrote:

>But you also indicated that all versions before 1.99_17 did work w/o the 
>package declaration, so that would be mean a behavior change.

First the results.  I applied Philippe's patch, but no Reload messages 
showed up in the error log when changes were made to the Menus.pm module or 
other modules in the same 'Melior' namespace Menus.pm is in.  Likewise, when 
changes were made to the Abracadabra.pm module (which is in the Apache 
namespace) nothing showed up in the error log.  However changes made to the 
Abracadabra.pm module did show up on the webpages that were being served -- 
in contrast to changes made in the Menus.pm module which did not show up in 
the webpages being served..

Second, the mod_perl download version I was using was mod_perl-2.0.0-RC1 (I 
had segmentation faults with the XMas version so I used this version).

Third, I made a slight change from last time when we discussed this problem 
by plugging the Menus.pm module into the Melior namespace.  I do not think 
this is causing the problem however because the Menus.pm module is in the 
Melior directory under /opt/prod/apache just as the Abracadabra.pm module is 
in the Apache directory under /opt/prod/apache.  So both modules have their 
respective namespaces declared and are located in their correct directories 
-- but only changes made to the Abracadabra.pm module are showing up.

Finally, the changes I made in the Menus.pm module after Apache had started 
up were made in the enclosed stripped down version of the module and the 
changes made to this version did not show up at all.

Here is the relevant info that was requested:

1.  Here are the entries from the httpd.conf file

LoadModule perl_module modules/mod_perl.so
LoadModule php4_module        modules/libphp4.so

PerlRequire "/opt/prod/apache/programs/startup.pl"
PerlInitHandler Apache::Reload

2.  Here is the stripped down version of the startup.pl file

#!/usr/local/bin/perl -wT
use strict;

BEGIN {
  use Apache2 ();
  use lib "/opt/prod/apache";
  use lib "/opt/prod/apache/nfs";
  use lib "/opt/prod/apache/test-mck/mck-cgi";
  use CGI::Carp qw(carpout);
  open(LOG, ">>/opt/prod/apache/logs/error_log") or die "Unable to append to 
/opt/prod/apache/logs/error_log: $! [See the 'startup.pl' program - 1]\n";
  carpout(*LOG);
}
# enable if the mod_perl 1.0 compatibility is needed
use Apache::compat ();
use ModPerl::Util (); #for CORE::GLOBAL::exit
use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::RequestUtil ();
use Apache::Server ();
use Apache::ServerUtil ();
use Apache::Connection ();
use Apache::Log ();
use Apache::Reload ();
use APR::Table ();
use APR::URI ();

use ModPerl::RegistryLoader ();
use Apache::Abracadabra ();
use Melior::Menus ();

1;


3.  Here is the stripped down version of the Menus.pm module.  In this 
version, changes that are made to it after Apache has started up still don't 
show up in the webpages that are being served.

package Melior::Menus;

use strict;
use locale;
use POSIX 'locale_h';
setlocale(LC_CTYPE, "iso_8859_1");

sub menumain {
  my ($r,$my,$id) = @_;
  $$my{USERAGENT} = $r->headers_in->get('User-Agent') || '';
  my (@field,$name);
  print "ab<BR>";
  return 1;
}

sub onepagemain {
  my ($r,$my) = @_;
  $$my{USERAGENT} = $r->headers_in->get('User-Agent') || '';
  print "b<BR>";
  return 1;
}

sub menutop {
  my ($r,$my) = @_;
  $$my{USERAGENT} = $r->headers_in->get('User-Agent') || '';
  print "c<BR>";
  return 1;

}

sub menublank {
  my ($r,$my,$id) = @_;
  $id ||= 0;
  print "d<BR>";
  return 1;
}

sub menuleft {
  my ($r,$my,$hocuspocus,$id) = @_;
  $$my{USERAGENT} = $r->headers_in->get('User-Agent') || '';
  print "e<BR>";
  return 1;
}


sub deliveries {
  my ($my,$id) = @_;
  print "f<BR>";
}

sub menusave {
  my ($my) = @_;
  print "g<BR>";
}

sub user_agency {
  my ($r,$my) = @_;
  print "h<BR>";
}

sub altogether {
  my ($my) = @_;
  print "i<BR>";

}

sub layering {
  my ($my,$id) = @_;
  print "j<BR>";
}

sub content_handler {
  my ($r,$my,$id) = @_;
  print "k<BR>";
  return;
}

1;


(message missing)

Reloading Modules Problem [mod_perl2]
Vincent Moneymaker 22:04 on 28 Dec 2004

Re: Reloading Modules Problem [mod_perl2]
Stas Bekman 22:31 on 28 Dec 2004

Re: Reloading Modules Problem [mod_perl2]
Stas Bekman 22:53 on 28 Dec 2004

Re: Reloading Modules Problem [mod_perl2]
Vincent Moneymaker 03:03 on 29 Dec 2004

Re: Reloading Modules Problem [mod_perl2]
Stas Bekman 17:13 on 29 Dec 2004

Re: Reloading Modules Problem [mod_perl2]
Philippe M. Chiasson 18:57 on 04 Jan 2005

Re: Reloading Modules Problem [mod_perl2]
Vincent Moneymaker 04:28 on 05 Jan 2005

Re: Reloading Modules Problem [mod_perl2]
Philippe M. Chiasson 08:17 on 05 Jan 2005

Re: Reloading Modules Problem [mod_perl2]
Vincent Moneymaker 19:54 on 04 Jan 2005

Re: Reloading Modules Problem [mod_perl2]
Stas Bekman 20:10 on 04 Jan 2005

Generated at 12:15 on 16 Jan 2005 by mariachi v0.52