Subversion Repositories DevTools

Rev

Rev 7413 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7413 Rev 7423
Line 129... Line 129...
129
$now = $startTime = time();
129
$now = $startTime = time();
130
readConfig();
130
readConfig();
131
Utils::writepid($conf);
131
Utils::writepid($conf);
132
$logger->logmsg("Starting...");
132
$logger->logmsg("Starting...");
133
readStatistics();
133
readStatistics();
134
sighandlers($conf);
134
sighandlers();
135
 
135
 
136
#
136
#
137
#   Main processing loop
137
#   Main processing loop
138
#   Will exit when terminated by parent
138
#   Will exit when terminated by parent
139
#
139
#
Line 276... Line 276...
276
sub refreshS3Info
276
sub refreshS3Info
277
{
277
{
278
    my $rv = 1;
278
    my $rv = 1;
279
    if ( !$linkUp || ($now > ($lastS3Refresh + $conf->{'forces3update'})) )
279
    if ( !$linkUp || ($now > ($lastS3Refresh + $conf->{'forces3update'})) )
280
    {
280
    {
281
        $logger->verbose2("refreshS3Info");
281
        $logger->verbose("refreshS3Info");
282
        $lastS3Refresh = $now;
282
        $lastS3Refresh = $now;
283
 
283
 
284
        #
284
        #
285
        #   Examine the s3 bucket and extract useful information
285
        #   Examine the s3 bucket and extract useful information
286
        #
286
        #
Line 1208... Line 1208...
1208
#-------------------------------------------------------------------------------
1208
#-------------------------------------------------------------------------------
1209
# Function        : sighandlers
1209
# Function        : sighandlers
1210
#
1210
#
1211
# Description     : Install signal handlers
1211
# Description     : Install signal handlers
1212
#
1212
#
1213
# Inputs          : $conf           - System config
1213
# Inputs          : Uses gobals
1214
#
1214
#
1215
# Returns         : Nothing
1215
# Returns         : Nothing
1216
#
1216
#
1217
sub sighandlers
1217
sub sighandlers
1218
{
1218
{
1219
    my $conf = shift;
-
 
1220
    my $logger = $conf->{logger};
-
 
1221
 
-
 
1222
    $SIG{TERM} = sub {
1219
    $SIG{TERM} = sub {
1223
        # On shutdown
1220
        # On shutdown
1224
        $logger->logmsg('Received SIGTERM. Shutting down....' );
1221
        $logger->logmsg('Received SIGTERM. Shutting down....' );
1225
        unlink $conf->{'pidfile'} if (-f $conf->{'pidfile'});
1222
        unlink $conf->{'pidfile'} if (-f $conf->{'pidfile'});
1226
        exit 0;
1223
        exit 0;