diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 4ea7bdbabe92a0f3b11276d6df567df426171ef9..91a627c56dd2aaf2f599ef3ced5fd7c152565fc6 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
# 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;
}
# add sqlite_id
$job_msg =~ s/<\/xml>$/<jobdb_id>$jobdb_id<\/jobdb_id><\/xml>/;
- &send_msg_to_target($job_msg, $server_address, $GosaPackages_key, $header);
+ my $func_error = &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);