Loading ...
Sorry, an error occurred while loading the content.
 

RE: [mp2] Also problems with reloading modules after upgrade

Expand Messages
  • Vincent Moneymaker
    ... That s the problem I am seeing
    Message 1 of 6 , Jan 5, 2005
      Thomas den Braber wrote:

      >The main module reloads without problems, most of the modules that are used
      >from the main module (with use) do not reload automatically.

      That's the problem I am seeing
    • Thomas den Braber
      Finally I have some more info on this issue. I installed my modperl handler in a virtual host directive and now I see the Apache::Reload debug messages. I
      Message 2 of 6 , Jan 24, 2005
        Finally I have some more info on this issue. I installed my modperl handler
        in a virtual host directive and now I see the Apache::Reload debug messages.
        I found out that there is a difference between reloading in 199_16 and the
        version above 199_16:

        I changed the menu2.pm file.

        Log from 199_16:




        > Onderwerp: [mp2] Also problems with reloading modules after upgrade
        >
        > I upgraded from 199_16 to 199_mod_perl-2.0.0-RC2-Xmas and found out that
        > Apache::Reload does not work the way it worked before.
        > I traced it back to the 199_17 version.
        > So in 199_16 everything worked fine, after 199_17 it did not.
        > I used the PerlSetVar ReloadDebug On in the apache.conf but nothing is
        > written to the error log.
        >
        > All my modules have their own namespace. The main module reloads without
        > problems, most of the modules that are used from the main module (with
        > use)
        > do not reload automatically. When I also change the main module the
        > included
        > modules have problems with losing variable references from the main
        > module.
        >
        > The main modules is configures as the PerlResponseHandler all other
        > modules
        > are called from within this 'main' module with 'use'. All modules are also
        > preloaded in a startup.pl file.
        >
        > I run with Apache 2.0.52, libreq2-2.04 on a windows 2000 server
        > (development
        > machine)
        >
        > Thomas den Braber
        > Delos Software Solutions
        >
      • Thomas den Braber
        Sorry, something was missing: Log from 199_16: Apache::Reload: Checking mtime of Menu2.pm Subroutine Main redefined at /srv/sitegen2/lib/Menu2.pm line 33.
        Message 3 of 6 , Jan 24, 2005
          Sorry, something was missing:

          Log from 199_16:

          Apache::Reload: Checking mtime of Menu2.pm
          Subroutine Main redefined at /srv/sitegen2/lib/Menu2.pm line 33.
          Subroutine menuJavaScript redefined at /srv/sitegen2/lib/Menu2.pm line 238.
          Subroutine reread_conf redefined at /srv/sitegen2/lib/Menu2.pm line 349.
          Subroutine editbar redefined at /srv/sitegen2/lib/Menu2.pm line 368.
          Subroutine setParseHref redefined at /srv/sitegen2/lib/Menu2.pm line 450.
          Apache::Reload: process 3488 reloading Menu2.pm

          Log from 1999_20

          Apache::Reload: Checking mtime of Menu2.pm
          Apache::Reload: process 2756 reloading Menu2 from Menu2.pm

          I hope this can help to locate the problem.

          Regards,

          Thomas den Braber


          > -----Oorspronkelijk bericht-----
          > Van: Thomas den Braber [mailto:thomas@...]
          > Verzonden: maandag 24 januari 2005 10:47
          > Aan: 'Thomas den Braber'; modperl@...
          > Onderwerp: RE: [mp2] Also problems with reloading modules after upgrade
          >
          >
          >
          > Finally I have some more info on this issue. I installed my modperl
          > handler
          > in a virtual host directive and now I see the Apache::Reload debug
          > messages.
          > I found out that there is a difference between reloading in 199_16 and the
          > version above 199_16:
          >
          > I changed the menu2.pm file.
          >
          > Log from 199_16:
          >
          >
          >
          >
          > > Onderwerp: [mp2] Also problems with reloading modules after upgrade
          > >
          > > I upgraded from 199_16 to 199_mod_perl-2.0.0-RC2-Xmas and found out that
          > > Apache::Reload does not work the way it worked before.
          > > I traced it back to the 199_17 version.
          > > So in 199_16 everything worked fine, after 199_17 it did not.
          > > I used the PerlSetVar ReloadDebug On in the apache.conf but nothing is
          > > written to the error log.
          > >
          > > All my modules have their own namespace. The main module reloads without
          > > problems, most of the modules that are used from the main module (with
          > > use)
          > > do not reload automatically. When I also change the main module the
          > > included
          > > modules have problems with losing variable references from the main
          > > module.
          > >
          > > The main modules is configures as the PerlResponseHandler all other
          > > modules
          > > are called from within this 'main' module with 'use'. All modules are
          > also
          > > preloaded in a startup.pl file.
          > >
          > > I run with Apache 2.0.52, libreq2-2.04 on a windows 2000 server
          > > (development
          > > machine)
          > >
          > > Thomas den Braber
          > > Delos Software Solutions
          > >
          >
        • Philippe M. Chiasson
          ... Could you possibly post the content of menu2.pm as well as at least one of the modules it uses and doesn t seem to reload right ? ... Philippe M.
          Message 4 of 6 , Jan 24, 2005
            > I hope this can help to locate the problem.
            >
            > Regards,
            >
            > Thomas den Braber
            >
            >>-----Oorspronkelijk bericht-----
            >>Van: Thomas den Braber [mailto:thomas@...]
            >>Verzonden: maandag 24 januari 2005 10:47
            >>Aan: 'Thomas den Braber'; modperl@...
            >>Onderwerp: RE: [mp2] Also problems with reloading modules after upgrade
            >>
            >>Finally I have some more info on this issue. I installed my modperl
            >>handler
            >>in a virtual host directive and now I see the Apache::Reload debug
            >>messages.
            >>I found out that there is a difference between reloading in 199_16 and the
            >>version above 199_16:
            >>
            >>I changed the menu2.pm file.

            Could you possibly post the content of menu2.pm as well as at least one of
            the modules it 'uses' and doesn't seem to reload right ?

            >> [...]

            --------------------------------------------------------------------------------
            Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
            http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
          • Thomas den Braber
            Philippe, The apache config looks like this (stripped version) # main location for dynamic content PerlRequire /srv/config/httpd/modperl/sitegen2.start
            Message 5 of 6 , Jan 25, 2005
              Philippe,

              The apache config looks like this (stripped version)

              # main location for dynamic content
              PerlRequire "/srv/config/httpd/modperl/sitegen2.start"
              PerlSetVar custom_error "/public/autherror.htm"
              <Location /start>
              AuthName "deloswww"
              PerlSetVar Logout "/start"
              PerlSetVar Login "/loginform"
              PerlSetVar site deloswww
              PerlAuthenHandler siteAuth
              AuthType sitecookie
              Require valid-user
              AllowOverride None
              SetHandler perl-script
              PerlResponseHandler siteMain
              PerlInitHandler Apache::Reload
              </Location>

              sitegen2.start looks like this (stripped version)

              #!/usr/bin/perl
              use strict;

              use lib qw( /srv/sitegen2/lib ); # Edit to match your installation
              directory.

              # apache modules
              print "Starting Modperl\t\t";
              use Apache2 ();
              use ModPerl::Const qw( EXIT );
              use ModPerl::Util (); # for CORE::GLOBAL::exit

              use Apache::RequestRec ();
              use Apache::RequestIO ();
              use Apache::RequestUtil ();
              use Apache::SubRequest ();

              use Apache::ServerUtil ();
              use Apache::Connection ();
              use Apache::Log ();
              use Apache::Util ();
              use Apache::Access ();

              use APR::Table ();
              use Apache::Request ();
              use Apache::Upload ();
              use ModPerl::Registry ();

              use Apache::Const -compile => ':common';
              use APR::Const -compile => ':common';

              use Apache::Reload ();

              # site modules
              use site.......
              use site.......
              ........

              print "[ OK ]\n";

              siteMain.pm looks like this (stripped version)

              #!/usr/bin/perl

              package siteMain;

              # benchmarking modules
              use Time::HiRes;
              use Benchmark ':hireswallclock';

              use strict;
              use lib "./";
              use vars qw ( %c %prefs);

              # apache modperl modules
              use Apache::RequestRec ();
              use Apache::Response ();
              use Apache::SubRequest ();
              use Apache::RequestUtil ();
              use Apache::Request;
              use Apache::Cookie;
              use Apache::Upload;
              use Apache::Log;
              use Apache::Const qw(:common);
              use Apache::URI ();
              use Template;
              use Template::Constants qw( :debug );

              # site modules
              use siteDebug;
              use siteUtil;
              use siteAdmin;
              use siteEdit;
              use siteDB;
              use siteContent;
              use siteRights;
              use siteHulpEdit;
              use siteFiles;
              use Menu2;
              use siteCSS;
              use siteSubmit;
              use textEdit; # sitegen text edit routines
              use tieUri; # dynamic generate newuri including parsings
              use siteConfig;
              use siteCache;
              use siteSql;
              use siteExplorer;
              use siteProxy;
              use fBrowse;
              use siteDocuments;

              use Data::Dumper; # testing and debugging only
              use Carp; # testing and debugging only
              use swsearch;

              our %shared_prefs;
              our %shared_config;
              our %shared_alg;
              our $template;

              *c = \%siteConfig::c; # Alias to %c in siteConfig.pm

              sub handler {

              my $r = shift;

              my $output;
              $r->content_type('text/html');
              $c{site}=$r->dir_config('site')
              $c{r} = $r;

              &readconfig( "/srv/sitegen2/config/$c{site}.conf" );
              $c{config}=$shared_config{$c{site}};
              $c{prefs}=$shared_prefs{$c{site}};

              # read preferences per site
              &readprefs ( "/srv/sitegen2/config/$c{site}.prefs" );

              # connect to database
              $c{dbh} = &siteDB::connectDB;

              ....

              # print main menu
              if ($printmenu){

              $output = &Menu2::Main();
              $r->print ($output);
              }

              # cleanup
              &cleanup;
              return Apache::OK; # We must return a status to mod_perl
              }
              ....

              Menu2.pm looks like this (stripped version )

              #!/usr/bin/perl

              package Menu2;

              use lib qw{ ./ };
              use siteUtil;
              use siteSql;
              use menuNav;
              use DBI;
              use vars qw( %c );
              use strict;
              use Data::Dumper; # testing en debugging only

              use siteDebug;
              use siteDB;
              use siteContent;
              use quickLinks;
              use siteFiles;
              use sitePlugins;

              my $cvsrevision='$Revision: 1.23 $';
              my $vdate='$Date: 2005/01/12 13:41:06 $';
              my ($version)=($cvsrevision=~/:\s(.+)\s/);
              $vdate =~ s#(.*\s(\d+)/(\d+)/(\d+).+)#$4-$3-$2#;

              *c = \%siteConfig::c; # Alias to %c in siteConfig.pm

              sub Main {

              my $depth;
              my %t;
              my $output;
              # make macros inactive
              $t{macro1_active} = 0;
              $t{macro2_active} = 0;

              # get site preferenses
              #$prefs = &sitePrefs();

              my $menu = new menuNav();
              ......
              Return (\$output)
              }
              .....

              -----Oorspronkelijk bericht-----
              Van: Philippe M. Chiasson [mailto:gozer@...]
              Verzonden: maandag 24 januari 2005 23:51
              Aan: Thomas den Braber
              CC: modperl@...
              Onderwerp: Re: [mp2] Also problems with reloading modules after upgrade

              > I hope this can help to locate the problem.
              >
              > Regards,
              >
              > Thomas den Braber
              >
              >>-----Oorspronkelijk bericht-----
              >>Van: Thomas den Braber [mailto:thomas@...]
              >>Verzonden: maandag 24 januari 2005 10:47
              >>Aan: 'Thomas den Braber'; modperl@...
              >>Onderwerp: RE: [mp2] Also problems with reloading modules after upgrade
              >>
              >>Finally I have some more info on this issue. I installed my modperl
              >>handler
              >>in a virtual host directive and now I see the Apache::Reload debug
              >>messages.
              >>I found out that there is a difference between reloading in 199_16 and the
              >>version above 199_16:
              >>
              >>I changed the menu2.pm file.

              Could you possibly post the content of menu2.pm as well as at least one of
              the modules it 'uses' and doesn't seem to reload right ?

              >> [...]

              ----------------------------------------------------------------------------
              ----
              Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID :
              88C3A5A5
              http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107
              88C3A5A5
            Your message has been successfully submitted and would be delivered to recipients shortly.