[rt-users] Problem with rt-crontool and rt-escalate seg fault

John C. Hennessy jchennessy at hnkts.net
Tue Mar 8 17:03:40 EST 2005


Hello,

I'm having problems with the rt-crontool and rt-escalate perl scripts. 
They always seg fault on RT::Init();

Below is a copy of the script I'm using if anyone has an suggestions I'd 
love to hear them :)

-John


#!/usr/bin/perl
#
# Author: Petter Reinholdtsen
# Date:   2004-08-31
#
# Based on shell version previously on
# <URL:http://wiki.bestpractical.com/index.cgi?ConfigureEscalationExample>
# and
# <URL:http://wiki.bestpractical.com/index.cgi?ConfigureEscalation>
#
# Run from cron as user rt-user, and make sure rt-user have
# permissions ShowTicket and ModifyTicket
# also make sure that rt-user is in the rt group so it can read the 
RT_SiteConfig.pm
# and friends (LER: 2005-02-06)

use strict;
use warnings;

# Location of RT3's libs and scripts
use lib ("/opt/rt3/lib", "/opt/rt3/local/lib");
my $crontool = "/opt/rt3/bin/rt-crontool";

package RT;
use RT::Interface::CLI qw(CleanEnv);

# Clean our the environment
CleanEnv();

# Load the RT configuration
RT::LoadConfig();
print "loaded config\n";

# Initialise RT
RT::Init();
print "Initialized\n";
my $queues = new RT::Queues($RT::SystemUser);
$queues->LimitToEnabled();
print "Escalating tickets\n";
# escalate tickets for all queues
while (my $queue = $queues->Next) {
    my $queuename = $queue->Name;
    system("$crontool --search RT::Search::ActiveTicketsInQueue " .
           "--search-arg \"$queuename\" ".
           "--action RT::Action::EscalatePriority");
}





More information about the rt-users mailing list