diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 351878bc6199f9107a3297ce2d34c318459df50c..b51bd4ed1e0fa0d1947ee75ae2b095dea0e65804 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
if (not $file =~ /(\S*?).pm$/) {
next;
}
+
+ if( $no_arp > 0 ) {
+ if( $file =~ /ArpHandler.pm/ ) {
+ next;
+ }
+ }
eval { require $file; };
if ($@) {
daemon_log("ERROR: gosa-si-server could not load module $file", 1);
sub client_input {
my ($heap,$input,$wheel) = @_[HEAP, ARG0, ARG1];
+
+ daemon_log("Incoming msg:\n$input\n", 8);
+
######################################
# forward msg to all imported modules
no strict "refs";
my $tmp = &{ $module."::process_incoming_msg" }($input.".".$heap->{remote_ip}."\n");
if (defined $tmp) {
$answer = $tmp;
+ daemon_log("Got answer from module ".$module.": \n".$answer,8);
}
- daemon_log("Got answer from module ".$module.": ".$answer,8);
}
daemon_log("processing of msg finished", 5);
my ($kernel,$heap) = @_[KERNEL, HEAP];
# check gosa job queue for jobs with executable timestamp
-# my ($seconds, $minutes, $hours, $monthday, $month,
-# $year, $weekday, $yearday, $sommertime) = localtime(time);
-# $hours = $hours < 10 ? $hours = "0".$hours : $hours;
-# $minutes = $minutes < 10 ? $minutes = "0".$minutes : $minutes;
-# $seconds = $seconds < 10 ? $seconds = "0".$seconds : $seconds;
-# $month+=1;
-# $month = $month < 10 ? $month = "0".$month : $month;
-# $monthday = $monthday < 10 ? $monthday = "0".$monthday : $monthday;
-# $year+=1900;
-# my $timestamp = "$year$month$monthday$hours$minutes$seconds";
my $timestamp = &get_time();
- my $res = $job_db->select_dbentry( { table=>$job_queue_table_name, status=>'waiting', timestamp=>$timestamp } );
+ my $sql_statement = "SELECT * FROM ".$job_queue_table_name.
+ " WHERE status='waiting' AND timestamp<'$timestamp'";
+
+ my $res = $job_db->select_dbentry( $sql_statement );
while( my ($id, $hit) = each %{$res} ) {
my $macaddress = $hit->{macaddress};
my $job_msg_hash = &transform_msg2hash($hit->{xmlmessage});
my $out_msg_hash = $job_msg_hash;
- my $res_hash = $known_clients_db->select_dbentry( {table=>'known_clients', macaddress=>$macaddress} );
+ my $sql_statement = "SELECT * FROM known_clients WHERE macaddress='$macaddress'";
+ my $res_hash = $known_clients_db->select_dbentry( $sql_statement );
# expect macaddress is unique!!!!!!
my $target = $res_hash->{1}->{hostname};
if (not defined $target) {
&daemon_log("ERROR: no host found for mac address: $job_msg_hash->{mac}[0]", 1);
&daemon_log("xml message: $hit->{xmlmessage}", 5);
- my $update_hash = { table=>$job_queue_table_name,
- update=> [ { status=>['error'], result=>["no host found for mac address"] } ],
- where=> [ { id=>[$jobdb_id] } ],
- };
- my $res = $job_db->update_dbentry($update_hash);
-
+ my $sql_statement = "UPDATE $job_queue_table_name ".
+ "SET status='error', result='no host found for mac address' ".
+ "WHERE id='$jobdb_id'";
+ my $res = $job_db->update_dbentry($sql_statement);
next;
}
my $error = &send_msg_hash2address($out_msg_hash, "$gosa_ip:$gosa_port", $gosa_passwd);
if ($error == 0) {
- my $sql = "UPDATE '$job_queue_table_name' SET status='processing', targettag='$target' WHERE id='$jobdb_id'";
- my $res = $job_db->exec_statement($sql);
+ my $sql_statement = "UPDATE $job_queue_table_name ".
+ "SET status='processing', targettag='$target' ".
+ "WHERE id='$jobdb_id'";
+ my $res = $job_db->update_dbentry($sql_statement);
} else {
- my $update_hash = { table=>$job_queue_table_name,
- update=> [ { status=>'error' } ],
- where=> [ { id=>$jobdb_id } ],
- };
- my $res = $job_db->update_dbentry($update_hash);
+ my $sql_statement = "UPDATE $job_queue_table_name ".
+ "SET status='error' ".
+ "WHERE id='$jobdb_id'";
+ my $res = $job_db->update_dbentry($sql_statement);
}
}
(
Port => $server_port,
ClientInput => \&client_input,
+ Concurrency => 10,
);
daemon_log("start socket for incoming xml messages at port '$server_port' ", 1);
POE::Kernel->run();
exit;
-