diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 10a6d118545fd228de44eec18beb9d5e20fd220b..91a627c56dd2aaf2f599ef3ced5fd7c152565fc6 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
"activ" => [\$bus_activ, "true"],
},
"server" => {
-# "ip" => [\$server_ip, "0.0.0.0"],
+# "ip" => [\$server_ip, "0.0.0.0"],
"port" => [\$server_port, "20081"],
"known-clients" => [\$known_clients_file_name, '/var/lib/gosa-si/clients.db' ],
"known-servers" => [\$known_server_file_name, '/var/lib/gosa-si/servers.db'],
while( my ($hit_num, $hit) = each %{ $query_res } ) {
my $host_name = $hit->{hostname};
if( not $host_name =~ /^$remote_ip:\d*$/) {
- next;
+ next;
}
my $host_key = $hit->{hostkey};
&daemon_log("SIPackages: known_client host_name: $host_name", 7);
}
if( (!$msg) || (!$msg_hash) || (!$module)) {
- daemon_log("Incoming message is not from a unknown host", 5);
+ daemon_log("Incoming message is not from an unknown host", 5);
}
return ($msg, $msg_hash, $module);
# opensocket
my $socket = &open_socket($address);
if( !$socket ) {
- daemon_log("cannot send ".$header."msg to $address , host not reachable", 1);
+ daemon_log("ERROR: cannot send ".$header."msg to $address , host not reachable", 1);
$error++;
}
# send xml msg
print $socket $crypted_msg."\n";
- daemon_log("send ".$header."msg to $address", 1);
+ daemon_log("INFO: send ".$header."msg to $address", 5);
daemon_log("message:\n$msg", 8);
}
}
}
}
-
- return;
+ return $error;
}
my $host_name = $hit->{hostname};
my $host_key = $hit->{hostkey};
$answer =~ s/$answer_target/$host_name/g;
- daemon_log("found host '$host_name', assoziated to '$answer_target'", 3);
+ daemon_log("found host '$host_name', associated to '$answer_target'", 3);
&send_msg_to_target($answer, $host_name, $host_key, $answer_header);
$found_ip_flag++ ;
}
# add sqlite_id
$job_msg =~ s/<\/xml>$/<jobdb_id>$jobdb_id<\/jobdb_id><\/xml>/;
+ my $func_error = &send_msg_to_target($job_msg, $server_address, $GosaPackages_key, $header);
-print STDERR "=======================================================\n$job_msg\n";
-
- &send_msg_to_target($job_msg, $server_address, $GosaPackages_key, $header);
-
-# my $error = 1;
-# if ($error == 0) {
-# my $sql_statement = "UPDATE $job_queue_table_name ".
-# "SET status='done', targettag='$target' ".
+# if ( $func_error ) {
+#print STDERR "========================================\n";
+#print STDERR "func_error: $func_error\n";
+#
+# my $sql_statement = "UPDATE $job_queue_table_name ".
+# "SET status='error', targettag='$target' ".
# "WHERE id='$jobdb_id'";
-# my $res = $job_db->update_dbentry($sql_statement);
-# } else {
-# my $sql_statement = "UPDATE $job_queue_table_name ".
-# "SET status='error' ".
+#print STDERR "sql: $sql_statement\n";
+# my $res = $job_db->update_dbentry($sql_statement);
+#print STDERR "res: ".Dumper($res);
+#
+# } else {
+#print STDERR "========================================\n";
+#print STDERR "func_error: $func_error\n";
+#
+# my $sql_statement = "UPDATE $job_queue_table_name ".
+# "SET status='done', targettag='$target' ".
# "WHERE id='$jobdb_id'";
-# my $res = $job_db->update_dbentry($sql_statement);
-# }
- }
+#print STDERR "sql: $sql_statement\n";
+# my $res = $job_db->update_dbentry($sql_statement);
+#print STDERR "res: ".Dumper($res);
+# }
+ }
$kernel->delay_set('watch_for_new_jobs',3);
}
#unlink('/tmp/gosa_si_lock*');
# connect to gosa-si job queue
-my @job_col_names = ("id INTEGER", "timestamp", "status", "result", "headertag", "targettag", "xmlmessage", "macaddress");
+my @job_col_names = ("id INTEGER", "timestamp", "status", "result", "progress", "headertag", "targettag", "xmlmessage", "macaddress");
$job_db = GOSA::DBsqlite->new($job_queue_file_name);
$job_db->create_table('jobs', \@job_col_names);