Code

* softupdate with wake on lan
authorrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 15 Oct 2008 12:53:38 +0000 (12:53 +0000)
committerrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 15 Oct 2008 12:53:38 +0000 (12:53 +0000)
* 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
gosa-si/server/events/gosaTriggered.pm

index f59c489280b8515cac73471398d74f870a88ccaf..c132359320f67beb5d86ae56a4de9f37466f4226 100755 (executable)
@@ -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   
index d49a4a381ebcb5404d9b4529026e0bbeb73d3aac..ddcd4aaacb649e99784232ad1fc265c152517893 100644 (file)
@@ -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;
 }