RT->LoadConfig not loading correct config data in perl

Hello,

I have a running request tracker (4.2.8) setup on a debian 8 (jessie) machine.

Config files are

/usr/share/request-tracker4/etc/RT_Config.pm

and

/etc/request-tracker4/RT_SiteConfig.pm

Working via Web front end and command line tool rt is fine.

My intention is to play a little bit automation/scripting.

I am wondering why the following perl script (file run.pl):

use RT;

RT->LoadConfig;
RT->Init;

perl -I /usr/share/request-tracker4/lib run.pl  

ends with the error:

DBI connect('dbname=rt4;host=localhost','rt_user',...) failed ...

as I have Set($DatabaseUser , 'rtuser'); in RT_SiteConfig.pm.

Can someone please give me a hint?

Best Regards,

Thomas

Hello again,

 ls -al /usr/share/request-tracker4/lib

showed me that owner and group where set to root.

Executing my script with a sudo is working now. I will now figure out an adequate right management.

Best regards,

Thomas