[rt-users] timeworked.pl requires every extension lib to be added?

Fran Fabrizio fran at cis.uab.edu
Sat Sep 26 08:15:54 EDT 2009


Jo,

Ah, that chunk of lib handling code is snagged from some of the RT code 
- that could be the cause of the issue, I don't have too many added 
plugins in my RT instance so perhaps that's why I am not seeing what you 
are.   I think you may be the first person to have tested it who has a 
lot of added plugins, since this is the first report.  I am sorry it was 
frustrating for you, but thanks for helping test. :-)

I am working on doing this over as an integrated RT extension so you may 
be interested in waiting for that.  By virtue of being an extension, it 
doesn't have to worry about any of this.  I'm only a couple of days away 
from being finished with it.  I do plan to maintain the CLI version as 
well, however.  I will take a look at your patch and see if I can clean 
up the script.

As I said when I first released it, this is my first attempt at doing 
anything with the RT API, so be gentle. :-)

-Fran

Jo Rhett wrote:
> On Sep 25, 2009, at 7:45 PM, Fran Fabrizio wrote:
>> I did not experience that, the version I shared on the list is 
>> exactly as it runs in my environment, it must be something specific 
>> to your RT setup if you are needing to add multiple entries to the 
>> use lib line. Others on the list have also used it successfully 
>> without having that issue.  Are you sure you are putting the root 
>> directory of the RT libs, and not the full path to each and every lib?
>
> My original line pointed only to the root install of RT: 
> /u/rtweb/rt38/lib in this case.
>
>> As far as which modules are required - that's largely a function of 
>> RT modules using other RT modules - it's not me using them directly.  
>> I use only a handful, as you can see from the code.
>
> No, these aren't modules used by RT -- they are plugins I have loaded 
> into my RT instance.   RT finds all the libraries for them just 
> fine.   Why don't you use the same logic?  Or frankly, why do you need 
> to load these extensions at all?   I suspect that you need to ignore 
> the modules specified in Set( @Plugins, .... );   (this is what it is 
> trying to load, and I can't think of why timeworked.pl needs these 
> modules.
>
>> It's pretty standard perl use lib methodology I am using, I am not 
>> doing anything fancy or unusual.  It just needs to be pointed to the 
>> root of wherever you installed your RT libs.
>
>
> Yes, it is.   I'm quite familiar with "use lib" having been using it 
> for, oh, is it 15 years now? ;-)
>
> It seems you might not have understood so let me be very clear:
>
> 1. You are including RT.pm
> 2. Some part of the initialization seems to be including all the 
> library modules.
> 3. You should either disable/force this not to happen, or do the same 
> initialization that occurs such that these modules will be loaded 
> without explicitly listing each one in "use lib".
>
> Below is a patch which works fine for me, and I believe you should 
> probably implement in the published version.  All it does is clear the 
> "Plugins" array after loading the configuration but before calling 
> Init(), which avoids having timeworked.pl load extensions it doesn't 
> need.   On our system it made timeworked.pl visibly faster to the eye.
>
> --- timeworked.pl_orig  2009-09-26 01:22:43.000000000 -0700
> +++ timeworked.pl       2009-09-26 01:23:01.000000000 -0700
> @@ -238,6 +238,9 @@
>  # Load the config file
>  RT::LoadConfig();
>
> +# Override/Ignore any configured plugins
> +RT::Config->Set( 'Plugins' => '' );
> +
>  # Connect to the database and get RT::SystemUser loaded
>  RT::Init();
>


-- 
Fran Fabrizio
Senior Systems Analyst
Department of Computer and Information Sciences
University of Alabama at Birmingham
http://www.cis.uab.edu/
205.934.0653




More information about the rt-users mailing list