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

Jo Rhett jrhett at netconsonance.com
Sat Sep 26 04:25:14 EDT 2009


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();

-- 
Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source  
and other randomness




More information about the rt-users mailing list