Subversion Repositories DevTools

Rev

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

Rev 7406 Rev 7423
Line 121... Line 121...
121
$now = $startTime = time();
121
$now = $startTime = time();
122
readConfig();
122
readConfig();
123
Utils::writepid($conf);
123
Utils::writepid($conf);
124
$logger->logmsg("Starting...");
124
$logger->logmsg("Starting...");
125
readStatistics();
125
readStatistics();
126
sighandlers($conf);
126
sighandlers();
127
 
127
 
128
#
128
#
129
#   Main processing loop
129
#   Main processing loop
130
#   Will exit when terminated by parent
130
#   Will exit when terminated by parent
131
#
131
#
Line 725... Line 725...
725
#-------------------------------------------------------------------------------
725
#-------------------------------------------------------------------------------
726
# Function        : sighandlers
726
# Function        : sighandlers
727
#
727
#
728
# Description     : Install signal handlers
728
# Description     : Install signal handlers
729
#
729
#
730
# Inputs          : $conf           - System config
730
# Inputs          : None
731
#
731
#
732
# Returns         : Nothing
732
# Returns         : Nothing
733
#
733
#
734
sub sighandlers
734
sub sighandlers
735
{
735
{
736
    my $conf = shift;
-
 
737
    my $logger = $conf->{logger};
-
 
738
 
-
 
739
    $SIG{TERM} = sub {
736
    $SIG{TERM} = sub {
740
        # On shutdown
737
        # On shutdown
741
        $logger->logmsg('Received SIGTERM. Shutting down....' );
738
        $logger->logmsg('Received SIGTERM. Shutting down....' );
742
        unlink $conf->{'pidfile'} if (-f $conf->{'pidfile'});
739
        unlink $conf->{'pidfile'} if (-f $conf->{'pidfile'});
743
        exit 0;
740
        exit 0;