From c2e1b69e3b4ef5ee82f21a0345efa5c590efc532 Mon Sep 17 00:00:00 2001 From: rettenbe Date: Wed, 15 Oct 2008 12:53:38 +0000 Subject: [PATCH] * softupdate with wake on lan * handling of outgoing messages with macaddress as target modified git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@12708 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-server | 11 ++++++++++- gosa-si/server/events/gosaTriggered.pm | 7 +++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index f59c48928..c13235932 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -1467,7 +1467,16 @@ sub process_task { } } if( $found_ip_flag == 0) { - daemon_log("$session_id WARNING: no host found in known_clients with mac address '$answer_target'", 3); + daemon_log("$session_id WARNING: no host found in known_clients or foreign_clients with mac address '$answer_target'", 3); + + # Sometimes the client is still booting or does not wake up, in this case reactivate the job (if it exists) with a delay of 30 sec + my $delay_timestamp = &calc_timestamp(&get_time(), "plus", 30); + my $sql = "UPDATE $job_queue_tn Set timestamp='$delay_timestamp', status='waiting' WHERE (macaddress='$answer_target' AND headertag='$answer_header')"; + my $res = $job_db->update_dbentry($sql); + daemon_log("$session_id INFO: '$answer_header'-job will be reactivated at '$delay_timestamp' ". + "cause client '$answer_target' is currently not available", 5); + daemon_log("$session_id $sql", 7); + } # Answer is for one specific host diff --git a/gosa-si/server/events/gosaTriggered.pm b/gosa-si/server/events/gosaTriggered.pm index d49a4a381..ddcd4aaac 100644 --- a/gosa-si/server/events/gosaTriggered.pm +++ b/gosa-si/server/events/gosaTriggered.pm @@ -640,6 +640,8 @@ sub trigger_action_reinstall { my %data = ( 'macAddress' => \@{$msg_hash->{macaddress}} ); my $wake_msg = &build_msg("trigger_wake", "GOSA", "KNOWN_SERVER", \%data); + # invoke trigger wake for this gosa-si-server + &main::server_server_com::trigger_wake($msg, $msg_hash, $session_id); my @out_msg_l = ($wake_msg, $msg); return @out_msg_l; } @@ -653,6 +655,8 @@ sub trigger_action_update { my %data = ( 'macAddress' => \@{$msg_hash->{macaddress}} ); my $wake_msg = &build_msg("trigger_wake", "GOSA", "KNOWN_SERVER", \%data); + # invoke trigger wake for this gosa-si-server + &main::server_server_com::trigger_wake($msg, $msg_hash, $session_id); my @out_msg_l = ($wake_msg, $msg); return @out_msg_l; } @@ -673,6 +677,9 @@ sub trigger_action_instant_update { my %data = ( 'macAddress' => \@{$msg_hash->{macaddress}} ); my $wake_msg = &build_msg("trigger_wake", "GOSA", "KNOWN_SERVER", \%data); + # invoke trigger wake for this gosa-si-server + &main::server_server_com::trigger_wake($msg, $msg_hash, $session_id); + my @out_msg_l = ($wake_msg, $msg); return @out_msg_l; } -- 2.30.2