Show
Ignore:
Timestamp:
05/29/07 22:12:36 (1 year ago)
Author:
kindlund
Message:

Reenabled watchdog.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • honeyclient/branches/exp/kindlund-filesystem/bin/StartAgent.pl

    r396 r407  
    77use Carp (); 
    88 
     9use HoneyClient::Util::Config qw(getVar); 
    910use HoneyClient::Agent; 
    1011use HoneyClient::Util::SOAP qw(getClientHandle); 
     
    1213use MIME::Base64 qw(decode_base64 encode_base64); 
    1314use Storable qw(thaw nfreeze); 
     15use Log::Log4perl qw(:easy); 
     16 
     17# The global logging object. 
     18our $LOG = get_logger(); 
    1419 
    1520our ($stub, $som); 
     
    3742 
    3843    if (!$faultDetected) { 
    39         print "Watchdog fault detected, recovering Agent daemon.\n"
     44        $LOG->error("Watchdog fault detected, recovering Agent daemon.")
    4045        $faultDetected = 1; 
    4146    } 
    4247    # XXX: Reenable this, eventually. 
    43     #Carp::carp __PACKAGE__ . "->_watchdogFaultHandler(): Error occurred during processing.\n" . $errMsg; 
     48    $LOG->error(__PACKAGE__ . "->_watchdogFaultHandler(): Error occurred during processing.\n" . $errMsg); 
     49    Carp::carp __PACKAGE__ . "->_watchdogFaultHandler(): Error occurred during processing.\n" . $errMsg; 
    4450 
    4551 
    4652    # Regardless of the error, destroy the Agent process and reinitialize it. 
    4753    # XXX: Sanity check this, eventually. 
    48     #HoneyClient::Agent->destroy(); 
     54    HoneyClient::Agent->destroy(); 
    4955 
    5056    # Wait for a small amount of time, in order for the killed process to release 
    5157    # its control of the bound TCP port. 
    52     #sleep 5; 
     58    sleep 5; 
    5359 
    54     #$URL = HoneyClient::Agent->init(); 
     60    $URL = HoneyClient::Agent->init(); 
    5561 
    5662    # Restore state information. 
    57     #$som = $stub->updateState(encode_base64(nfreeze($agentState))); 
     63    $som = $stub->updateState(encode_base64(nfreeze($agentState))); 
    5864} 
    5965