summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ea73685)
raw | patch | inline | side by side (parent: ea73685)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 3 Jun 2008 15:16:20 +0000 (15:16 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 3 Jun 2008 15:16:20 +0000 (15:16 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11180 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server | patch | blob | history | |
gosa-si/tests/client.php | patch | blob | history |
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 14918ba322fa4033516072eccf19424d3555e585..c3d08010164bb723fc71938d107e0d0a91ff5e2b 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
our $global_kernel;
my ($foreground, $ping_timeout);
-my ($bus_activ, $bus, $msg_to_bus, $bus_cipher);
my ($server);
my ($gosa_server, $job_queue_timeout, $job_queue_loop_delay);
my ($messaging_db_loop_delay);
# additional variable which should be globaly accessable
our $server_address;
our $server_mac_address;
-our $bus_address;
our $gosa_address;
-our $no_bus;
our $no_arp;
our $verbose;
our $forground;
# specifies the timeout seconds while checking the online status of a registrating client
$ping_timeout = 5;
-$no_bus = 0;
-$bus_activ = "true";
$no_arp = 0;
my $packages_list_under_construction = "/tmp/packages_list_creation_in_progress";
my @packages_list_statements;
"plainname DEFAULT 'none'",
);
-# holds all other gosa-sd as well as the gosa-sd-bus
+# holds all other gosa-si-server
our $known_server_db;
our $known_server_tn = "known_server";
my $known_server_file_name;
"log-file" => [\$log_file, "/var/run/".$prg.".log"],
"pid-file" => [\$pid_file, "/var/run/".$prg.".pid"],
},
-"bus" => {
- "activ" => [\$bus_activ, "true"],
- },
"server" => {
"port" => [\$server_port, "20081"],
"known-clients" => [\$known_clients_file_name, '/var/lib/gosa-si/clients.db' ],
-c <file> : config file
-f : foreground, process will not be forked to background
-v : be verbose (multiple to increase verbosity)
- -no-bus : starts $prg without connection to bus
-no-arp : starts $prg without connection to arp module
EOF
# msg is from a new client or gosa
($msg, $msg_hash, $module) = &input_from_unknown_host($next_msg, $session_id);
- # msg is from a gosa-si-server or gosa-si-bus
+ # msg is from a gosa-si-server
if(( !$msg ) || ( !$msg_hash ) || ( !$module )){
($msg, $msg_hash, $module) = &input_from_known_server($next_msg, $heap->{'remote_ip'}, $session_id);
}
}
if( $found_ip_flag == 0) {
daemon_log("$session_id WARNING: no host found in known_clients with mac address '$answer_target'", 3);
- if( $bus_activ eq "true" ) {
- daemon_log("$session_id INFO: try to forward msg '$answer_header' to bus '$bus_address'", 5);
- my $sql_statement = "SELECT * FROM known_server WHERE hostname='$bus_address'";
- my $query_res = $known_server_db->select_dbentry( $sql_statement );
- while( my ($hit_num, $hit) = each %{ $query_res } ) {
- my $bus_address = $hit->{hostname};
- my $bus_key = $hit->{hostkey};
- my $error = &send_msg_to_target($answer, $bus_address, $bus_key, $answer_header, $session_id);
- &update_jobdb_status_for_send_msgs($answer, $error);
- last;
- }
- }
-
}
# answer is for one specific host
# get encrypt_key
my $encrypt_key = &get_encrypt_key($answer_target);
if( not defined $encrypt_key ) {
- # unknown target, forward msg to bus
+ # unknown target
daemon_log("$session_id WARNING: unknown target '$answer_target'", 3);
- if( $bus_activ eq "true" ) {
- daemon_log("$session_id INFO: try to forward msg '$answer_header' to bus '$bus_address'", 5);
- my $sql_statement = "SELECT * FROM known_server WHERE hostname='$bus_address'";
- my $query_res = $known_server_db->select_dbentry( $sql_statement );
- my $res_length = keys( %{$query_res} );
- if( $res_length == 0 ){
- daemon_log("$session_id WARNING: send '$answer_header' to '$bus_address' failed, ".
- "no bus found in known_server", 3);
- }
- else {
- while( my ($hit_num, $hit) = each %{ $query_res } ) {
- my $bus_key = $hit->{hostkey};
- my $error = &send_msg_to_target($answer, $bus_address, $bus_key, $answer_header,$session_id );
- &update_jobdb_status_for_send_msgs($answer, $error);
- }
- }
- }
next;
}
my $error = &send_msg_to_target($answer, $answer_target, $encrypt_key, $answer_header,$session_id);
# fetch key to encrypt msg propperly for usr/host
my $sql = "SELECT * FROM $known_clients_tn WHERE (hostname='$receiver_host')";
&daemon_log("0 DEBUG: $sql", 7);
- my $res = $known_clients_db->select_dbentry($sql);
+ my $res = $known_clients_db->exec_statement($sql);
# host is already down
if (not ref(@$res[0]) eq "ARRAY") { next; }
"c|config=s" => \$cfg_file,
"f|foreground" => \$foreground,
"v|verbose+" => \$verbose,
- "no-bus+" => \$no_bus,
"no-arp+" => \$no_arp,
);
daemon_log("status: $server_status", 1);
daemon_log($server_status_hash->{$server_status}.": $server_revision", 1);
-if ($no_bus > 0) {
- $bus_activ = "false"
-}
-
# connect to incoming_db
unlink($incoming_file_name);
$incoming_db = GOSA::DBsqlite->new($incoming_file_name);
index 96a42a2fb39b07a2ff50a1af165c752d502006fb..06275cd75722d557caf66bae87d5d4e8828bf178 100755 (executable)
--- a/gosa-si/tests/client.php
+++ b/gosa-si/tests/client.php
for($count = 1; $count <= $zahl; $count++)
{
- #$sock = new Socket_Client("127.0.0.1","20081",TRUE,5);
- #$sock->setEncryptionKey("secret-gosa-password");
- $sock = new Socket_Client("10.89.1.30","20081",TRUE,5);
+ $sock = new Socket_Client("127.0.0.1","20081",TRUE,5);
$sock->setEncryptionKey("secret-gosa-password");
+ #$sock = new Socket_Client("10.89.1.30","20081",TRUE,5);
+ #$sock->setEncryptionKey("secret-gosa-password");
if($sock->connected()){
#$data = "<xml> <header>gosa_count_fai_release</header><source>GOSA</source> <target>GOSA</target></xml>";
# jobdb clear
- #$data = "<xml> <header>gosa_clear_jobdb</header> <source>GOSA</source> <target>GOSA</target></xml>";
+ $data = "<xml> <header>gosa_clear_jobdb</header> <source>GOSA</source> <target>GOSA</target></xml>";
# set gosa-si-client to 'activated'
#$data = "<xml> <header>job_set_activated_for_installation</header> <target>10.89.1.31:20083</target> <source>GOSA</source> <macaddress>00:01:6c:9d:b9:fa</macaddress><timestamp>22220101000000</timestamp></xml>";
#$data = "<xml> <header>job_trigger_action_wake</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> <timestamp>19700101000000</timestamp></xml>";
#$data = "<xml> <header>gosa_trigger_action_faireboot</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> </xml>";
#$data = "<xml> <header>gosa_trigger_action_reboot</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> </xml>";
- $data = "<xml> <header>gosa_trigger_action_halt</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> </xml>";
+ #$data = "<xml> <header>gosa_trigger_action_halt</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> </xml>";
#$data = "<xml> <header>job_trigger_action_reinstall</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <macaddress>00:01:6c:9d:b9:fa</macaddress> <timestamp>19700101000000</timestamp> </xml>";
#$data = "<xml> <header>job_trigger_action_instant_update</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> <timestamp>19700101000000</timestamp> </xml>";
#$data = "<xml> <header>gosa_new_ping</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> </xml>";