From: rettenbe Date: Fri, 29 Aug 2008 09:14:25 +0000 (+0000) Subject: bugfixing problems in finding gosa-si-servers from dns X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=969463c04805d5fd2de0f5b7c0d4c2f5158144d1;p=gosa.git bugfixing problems in finding gosa-si-servers from dns git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12310 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index 767446c77..5a1bc3fe1 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -1144,16 +1144,24 @@ if( defined $server_check ) { my @tmp_servers; if ( !$server_domain) { # Try our DNS Searchlist - for my $domain(get_dns_domains()) { + my @domain_list = &get_dns_domains(); + my $tmp_domains; + my $error_string; + for my $domain (@domain_list) { chomp($domain); - my @tmp_domains= &get_server_addresses($domain); - if(@tmp_domains) { - for my $tmp_server(@tmp_domains) { + ($tmp_domains, $error_string) = &get_server_addresses($domain); + if(@$tmp_domains) { + for my $tmp_server(@$tmp_domains) { push @tmp_servers, $tmp_server; } } } if (0 == @tmp_servers) { + my $log_string = "no gosa-si-server found!"; + $log_string .= "\n\tdetermined domains out of /etc/resolf.conf: ".join(", ", @domain_list); + $log_string .= "\n\tdetermined server addresses in domains: ".join(", ",@$tmp_domains); + daemon_log("ERROR: $log_string", 1); + daemon_log("ERROR: $error_string", 1); daemon_log("ERROR: please specify a gosa-si-server address or a domain in config file", 1); kill 2, $$; } diff --git a/gosa-si/modules/GosaSupportDaemon.pm b/gosa-si/modules/GosaSupportDaemon.pm index c10a0e46f..9d07d0a0c 100644 --- a/gosa-si/modules/GosaSupportDaemon.pm +++ b/gosa-si/modules/GosaSupportDaemon.pm @@ -435,6 +435,7 @@ sub get_dns_domains() { sub get_server_addresses { my $domain= shift; my @result; + my $error_string; my $error = 0; my $res = Net::DNS::Resolver->new; @@ -447,7 +448,7 @@ sub get_server_addresses { } } else { - #warn "query failed: ", $res->errorstring, "\n"; + $error_string = "determination of '_gosa-si._tcp' server in domain '$domain' failed: ".$res->errorstring; $error++; } @@ -466,7 +467,7 @@ sub get_server_addresses { } } - return @result; + return \@result, $error_string; } diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index 759bbacb5..2068b35f0 100755 --- a/gosa-si/tests/client.php +++ b/gosa-si/tests/client.php @@ -136,7 +136,7 @@ for($count = 1; $count <= $zahl; $count++) #$data = "
gosa_opsi_get_product_properties
GOSA GOSA firefox linux-cl-2.intranet.gonicus.de
"; # Set product properties - global - $data = "
gosa_opsi_set_product_properties
GOSA 00:01:6c:9d:b9:fa javavm askbeforeinstfalse
"; + #$data = "
gosa_opsi_set_product_properties
GOSA 00:01:6c:9d:b9:fa javavm askbeforeinstfalse
"; # Set product properties - per host #$data = "
gosa_opsi_set_product_properties
GOSA 00:01:6c:9d:b9:fa linux-cl-2.intranet.gonicus.de firefox askbeforeinst false
"; @@ -149,7 +149,7 @@ for($count = 1; $count <= $zahl; $count++) #$data = "
gosa_opsi_get_client_software
GOSA GOSA linux-cl-2.intranet.gonicus.de
"; # List Opsi clients - #$data = "
gosa_opsi_list_clients
GOSA GOSA
"; + $data = "
gosa_opsi_list_clients
GOSA GOSA
"; # Delete Opsi client #$data = "
gosa_opsi_del_client
GOSA 00:01:6c:9d:b9:fa linux-cl-2.intranet.gonicus.de
";