summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a971570)
raw | patch | inline | side by side (parent: a971570)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 10 Nov 2008 16:21:24 +0000 (16:21 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 10 Nov 2008 16:21:24 +0000 (16:21 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@12990 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server | patch | blob | history | |
gosa-si/server/events/gosaTriggered.pm | patch | blob | history |
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 84de9b7330930296a7f250706784bea817939e41..3424cd828a03a8bdf14a5437d832ecffc58b8d70 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
sub update_jobdb_status_for_send_msgs {
my ($session_id, $answer, $error) = @_;
+ &daemon_log("$session_id DEBUG: try to update job status", 7);
if( $answer =~ /<jobdb_id>(\d+)<\/jobdb_id>/ ) {
my $jobdb_id = $1;
$answer =~ /<header>(.*)<\/header>/;
||($job_header eq "trigger_action_halt")
) {
my $sql_statement = "UPDATE $job_queue_tn SET status='done' WHERE id=$jobdb_id";
+ &daemon_log("$session_id DEBUG: $sql_statement", 7);
my $res = $job_db->update_dbentry($sql_statement);
# reactivate jobs, jobs need to deliver their message
} elsif (($job_header eq "trigger_action_activate")
||($job_header eq "trigger_action_update")
||($job_header eq "trigger_action_reinstall")
+ ||($job_header eq "trigger_activate_new")
) {
&reactivate_job_with_delay($session_id, $job_target, $job_header, 30 );
"SET status='error', result='can not deliver msg, please consult log file' ".
"WHERE id=$jobdb_id";
my $res = $job_db->update_dbentry($sql_statement);
- &daemon_log("D \n$sql_statement\n$answer", 1);
-
+ &daemon_log("$session_id DEBUG: $sql_statement", 7);
}
# sending msg was successful
||($job_header eq "trigger_action_halt")
||($job_header eq "trigger_action_reboot")
||($job_header eq "trigger_action_wake")
+ ||($job_header eq "trigger_wake")
) {
my $sql_statement = "UPDATE $job_queue_tn ".
"SET status='done' ".
"WHERE id=$jobdb_id AND status='processed'";
my $res = $job_db->update_dbentry($sql_statement);
- }
+ &daemon_log("$session_id DEBUG: $sql_statement", 7);
+ } else {
+ &daemon_log("$session_id WARNING: sending message succeed but cannot update job status.", 3);
+ }
}
+ } else {
+ &daemon_log("$session_id ERROR: cannot update job status, msg has no jobdb_id-tag: $answer", 1);
}
}
my $host_key = $hit->{'hostkey'};
my $ping_msg = "<xml> <header>gosa_ping</header> <source>$server_address</source> <target>$host_name</target></xml>";
my $error = &send_msg_to_target($ping_msg, $host_name, $host_key, "gosa_ping", $session_id);
- &update_jobdb_status_for_send_msgs($ping_msg, $error);
+ &update_jobdb_status_for_send_msgs($session_id, $ping_msg, $error);
}
$error++;
}
my $host_name = $hit->{hostname};
my $host_key = $hit->{hostkey};
my $error = &send_msg_to_target($answer, $host_name, $host_key, $answer_header, $session_id);
- &update_jobdb_status_for_send_msgs($answer, $error);
+ &update_jobdb_status_for_send_msgs($session_id, $answer, $error);
}
}
my $host_key = $hit->{hostkey};
$answer =~ s/<target>\S+<\/target>/<target>$host_name<\/target>/g;
my $error = &send_msg_to_target($answer, $host_name, $host_key, $answer_header, $session_id);
- &update_jobdb_status_for_send_msgs($answer, $error);
+ &update_jobdb_status_for_send_msgs($session_id, $answer, $error);
}
}
my $header;
if( defined $1 ) { $header = $1; }
my $error = &send_msg_to_target($answer, $server_address, $GosaPackages_key, $header, $session_id);
- &update_jobdb_status_for_send_msgs($answer, $error);
+ &update_jobdb_status_for_send_msgs($session_id, $answer, $error);
}
# Target of msg is a mac address
$answer =~ s/$answer_target/$host_name/g;
daemon_log("$session_id INFO: found host '$host_name', associated to '$answer_target'", 5);
my $error = &send_msg_to_target($answer, $host_name, $host_key, $answer_header, $session_id);
- &update_jobdb_status_for_send_msgs($answer, $error);
+ &update_jobdb_status_for_send_msgs($session_id, $answer, $error);
$found_ip_flag++ ;
}
if ($found_ip_flag == 0) {
if (defined $reg_server_key) {
$answer =~ s/$answer_target/$host_name/g;
my $error = &send_msg_to_target($answer, $reg_server, $reg_server_key, $answer_header, $session_id);
- &update_jobdb_status_for_send_msgs($answer, $error);
+ &update_jobdb_status_for_send_msgs($session_id, $answer, $error);
$found_ip_flag++ ;
}
}
next;
}
my $error = &send_msg_to_target($answer, $answer_target, $encrypt_key, $answer_header,$session_id);
- &update_jobdb_status_for_send_msgs($answer, $error);
+ &update_jobdb_status_for_send_msgs($session_id,$answer, $error);
}
}
}
index abd9448075cd1006eb4d712720a03ff3de5268bd..978e0ce8d56e3c56d07e4e5dcc16920ee3d6ad5c 100644 (file)
foreach (@{$msg_hash->{macaddress}}) {
&add_content2xml_hash($out_hash, 'macaddress', $_);
}
+ if( defined $jobdb_id) {
+ &add_content2xml_hash($out_hash, 'jobdb_id', $jobdb_id);
+ }
+
my $out_msg = &create_xml_string($out_hash);
# invoke trigger wake for this gosa-si-server