Code

gosa-si-server ver. 2.0 (unstable)
[gosa.git] / gosa-si / gosa-si-bus
index a56a38e1a2f9a46763ab00bc46aa29040cb0fffd..90de439b50d246c3803699098d2af58fbf346489 100755 (executable)
@@ -136,9 +136,8 @@ sub check_cmdline_param () {
     my $err_counter = 0;
     if( not defined( $cfg_file)) {
         my $cwd = getcwd;
-        my $name = "/etc/gosa/gosa-si-bus.conf";
+        my $name = "/etc/gosa-si/bus.conf";
         $cfg_file = File::Spec->catfile( $cwd, $name );
-        print STDERR "no conf file specified\n   try to use default: $cfg_file\n";
     }
     if( $err_counter > 0 ) {
         &usage( "", 1 );
@@ -436,8 +435,8 @@ sub process_incoming_msg {
     $crypted_msg = $1;
     my $host = sprintf("%s.%s.%s.%s", $2, $3, $4, $5);
 
-    daemon_log("msg from host:\n\t$host", 1);
-    daemon_log("crypted_msg:\n\t$crypted_msg", 7);
+    daemon_log("msg from host: $host", 1);
+    daemon_log("crypted_msg: $crypted_msg", 7);
 
     my @valid_keys;
     my @daemon_keys = keys %$known_daemons;
@@ -448,7 +447,7 @@ sub process_incoming_msg {
     }
 
     my $l = @valid_keys;
-    daemon_log("number of valid daemons: $l\n", 7);
+    daemon_log("number of valid daemons: $l", 7);
 
     my ($msg, $msg_hash);
     my $msg_flag = 0;    
@@ -456,7 +455,7 @@ sub process_incoming_msg {
     # collect addresses from possible incoming clients
     foreach my $host_key (@valid_keys) {
         eval{
-            daemon_log( "daemon: $host_key\n", 7);
+            daemon_log( "daemon: $host_key", 7);
             my $key_passwd = $known_daemons->{$host_key}->{passwd};
             daemon_log("daemon_passwd: $key_passwd\n", 7);
             my $key_cipher = &create_ciphering($key_passwd);
@@ -481,9 +480,9 @@ sub process_incoming_msg {
     my $header = &get_content_from_xml_hash($msg_hash, "header");
     my $target = &get_content_from_xml_hash($msg_hash, "target");
 
-    daemon_log("header from msg:\n\t$header", 1);
-    daemon_log("msg to process:\n\t$msg", 5);
-    daemon_log("msg is for: \n\t$target", 7);
+    daemon_log("header from msg: $header", 1);
+    daemon_log("msg to process: $msg", 5);
+    daemon_log("msg is for: $target", 7);
 
     if($target eq $bus_address) {
         # msg is for bus
@@ -541,7 +540,7 @@ sub process_incoming_msg {
         }
     }
 
-    &print_known_daemons_hash();
+    #&print_known_daemons_hash();
     return;
 }
 
@@ -663,7 +662,7 @@ sub create_xml_hash {
 sub create_xml_string {
     my ($xml_hash) = @_ ;
     my $xml_string = $xml->XMLout($xml_hash, RootName => 'xml');
-    $xml_string =~ s/[\n]+//g;
+    #$xml_string =~ s/[\n]+//g;
     return $xml_string;
 }
 
@@ -1102,7 +1101,8 @@ $SIG{CHLD} = 'IGNORE';
 
 # restart daemon log file
 if(-e $log_file ) { unlink $log_file }
-daemon_log("$0 started!");
+daemon_log(" ", 1);
+daemon_log("$0 started!", 1);
 
 # Just fork, if we"re not in foreground mode
 if( ! $foreground ) { $pid = fork(); }
@@ -1137,6 +1137,7 @@ my $rbits = my $wbits = my $ebits = "";
 
 # open the bus socket
 if($bus_activ eq "on") {
+    daemon_log(" ", 1);
     $bus = IO::Socket::INET->new(LocalPort => $bus_port,
             Type => SOCK_STREAM,
             Reuse => 1,
@@ -1144,7 +1145,7 @@ if($bus_activ eq "on") {
             ) or die "kann kein TCP-Server an Port $bus_port sein: $@\n";
     vec($rbits, fileno $bus, 1) = 1;
     vec($wbits, fileno $bus, 1) = 1;
-    print "start bus at $bus_ip:$bus_port\n";        
+    daemon_log ("start bus at $bus_ip:$bus_port", 1);        
 }
 
 # add bus to known_daemons