From e6c99f763420a667117bb9385c647ec5962ad769 Mon Sep 17 00:00:00 2001 From: rettenbe Date: Mon, 19 May 2008 12:33:11 +0000 Subject: [PATCH] * moved SIPackages to ClientPackages * each package modul has its own event directory * modified installation routines git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10950 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/debian/gosa-si-server.dirs | 4 ++- gosa-si/debian/gosa-si-server.install | 15 ++++++----- gosa-si/gosa-si-server-nobus | 12 ++++----- .../{SIPackages.pm => ClientPackages.pm} | 26 +++++++++---------- gosa-si/modules/GosaPackages.pm | 6 ++--- gosa-si/modules/ServerPackages.pm | 6 ++--- gosa-si/server.conf | 4 +-- gosa-si/server/events/gosaTriggered.pm | 2 +- gosa-si/server/events/siTriggered.pm | 2 +- 9 files changed, 40 insertions(+), 37 deletions(-) rename gosa-si/modules/{SIPackages.pm => ClientPackages.pm} (97%) diff --git a/gosa-si/debian/gosa-si-server.dirs b/gosa-si/debian/gosa-si-server.dirs index bae080a08..4a72dceb9 100644 --- a/gosa-si/debian/gosa-si-server.dirs +++ b/gosa-si/debian/gosa-si-server.dirs @@ -1,5 +1,7 @@ usr/sbin usr/lib/gosa-si/modules -usr/lib/gosa-si/server/events +usr/lib/gosa-si/server/GosaPackages +usr/lib/gosa-si/server/ServerPackages +usr/lib/gosa-si/server/ClientPackages etc/gosa-si /var/log/fai diff --git a/gosa-si/debian/gosa-si-server.install b/gosa-si/debian/gosa-si-server.install index 843f0d7cb..1dd8d8661 100644 --- a/gosa-si/debian/gosa-si-server.install +++ b/gosa-si/debian/gosa-si-server.install @@ -2,14 +2,15 @@ gosa-si-server usr/sbin gosa-si-bus usr/sbin server.conf etc/gosa-si bus.conf etc/gosa-si -modules/SIPackages.pm usr/lib/gosa-si/modules +modules/ClientPackages.pm usr/lib/gosa-si/modules modules/GosaPackages.pm usr/lib/gosa-si/modules modules/ArpHandler.pm usr/lib/gosa-si/modules modules/oui.txt usr/lib/gosa-si/modules modules/ServerPackages.pm usr/lib/gosa-si/modules -server/events/gosaTriggered.pm usr/lib/gosa-si/server/events -server/events/siTriggered.pm usr/lib/gosa-si/server/events -server/events/clMessages.pm usr/lib/gosa-si/server/events -server/events/databases.pm usr/lib/gosa-si/server/events -server/events/krb5.pm usr/lib/gosa-si/server/events -server/events/logHandling.pm usr/lib/gosa-si/server/events +server/events/gosaTriggered.pm usr/lib/gosa-si/server/GosaPackages +server/events/siTriggered.pm usr/lib/gosa-si/server/ClientPackages +server/events/clMessages.pm usr/lib/gosa-si/server/ClientPackages +server/events/databases.pm usr/lib/gosa-si/server/ClientPackages +server/events/krb5.pm usr/lib/gosa-si/server/GosaPackages +server/events/logHandling.pm usr/lib/gosa-si/server/ClientPackages +server/events/server_server_com.pm usr/lib/gosa-si/server/ServerPackages diff --git a/gosa-si/gosa-si-server-nobus b/gosa-si/gosa-si-server-nobus index b48fe22a3..25a091cb8 100755 --- a/gosa-si/gosa-si-server-nobus +++ b/gosa-si/gosa-si-server-nobus @@ -82,7 +82,7 @@ my $repo_path; my %repo_dirs=(); # variables declared in config file are always set to 'our' our (%cfg_defaults, $log_file, $pid_file, - $server_ip, $server_port, $SIPackages_key, + $server_ip, $server_port, $ClientPackages_key, $arp_activ, $gosa_unit_tag, $GosaPackages_key, $gosa_ip, $gosa_port, $gosa_timeout, $foreign_server_string, $server_domain, $foreign_server_key @@ -233,10 +233,10 @@ my $max_children = 2; "messaging-db-loop-delay" => [\$messaging_db_loop_delay, 3], "key" => [\$GosaPackages_key, "none"], }, -"SIPackages" => { - "key" => [\$SIPackages_key, "none"], +"ClientPackages" => { + "key" => [\$ClientPackages_key, "none"], }, -"foreign-server"=> { +"ServerPackages"=> { "address" => [\$foreign_server_string, ""], "domain" => [\$server_domain, ""], "key" => [\$foreign_server_key, "none"], @@ -613,7 +613,7 @@ sub input_from_known_server { else { $msg = $tmp_msg; $msg_hash = $tmp_msg_hash; - $module = "SIPackages"; + $module = "ClientPackages"; last; } } @@ -650,7 +650,7 @@ sub input_from_known_client { next; } else { - $module = "SIPackages"; + $module = "ClientPackages"; last; } } diff --git a/gosa-si/modules/SIPackages.pm b/gosa-si/modules/ClientPackages.pm similarity index 97% rename from gosa-si/modules/SIPackages.pm rename to gosa-si/modules/ClientPackages.pm index 5e6fdeebb..1924f5a1e 100644 --- a/gosa-si/modules/SIPackages.pm +++ b/gosa-si/modules/ClientPackages.pm @@ -1,4 +1,4 @@ -package SIPackages; +package ClientPackages; use Exporter; @ISA = ("Exporter"); @@ -16,13 +16,13 @@ use Net::LDAP; use Socket; use Net::hostent; -my $event_dir = "/usr/lib/gosa-si/server/events"; -use lib "/usr/lib/gosa-si/server/events"; +my $event_dir = "/usr/lib/gosa-si/server/ClientPackages"; +use lib "/usr/lib/gosa-si/server/ClientPackages"; BEGIN{} END {} -my ($server_ip, $server_port, $SIPackages_key, $max_clients, $ldap_uri, $ldap_base, $ldap_admin_dn, $ldap_admin_password, $server_interface); +my ($server_ip, $server_port, $ClientPackages_key, $max_clients, $ldap_uri, $ldap_base, $ldap_admin_dn, $ldap_admin_password, $server_interface); my ($bus_activ, $bus_key, $bus_ip, $bus_port); my $server; my $network_interface; @@ -47,8 +47,8 @@ my %cfg_defaults = ( "ldap-admin-password" => [\$ldap_admin_password, ""], "max-clients" => [\$max_clients, 100], }, -"SIPackages" => { - "key" => [\$SIPackages_key, ""], +"ClientPackages" => { + "key" => [\$ClientPackages_key, ""], }, ); @@ -68,11 +68,11 @@ $main::server_mac_address= &get_mac($network_interface); my ($error, $result, $event_hash) = &import_events($event_dir); if ($error == 0) { foreach my $log_line (@$result) { - &main::daemon_log("0 INFO: SIPackages - $log_line", 5); + &main::daemon_log("0 DEBUG: ClientPackages - $log_line", 7); } } else { foreach my $log_line (@$result) { - &main::daemon_log("0 ERROR: SIPackages - $log_line", 1); + &main::daemon_log("0 ERROR: ClientPackages - $log_line", 1); } } @@ -177,7 +177,7 @@ my $res = $main::known_server_db->add_dbentry( {table=>'known_server', primkey=>['hostname'], hostname=>$server_address, status=>'myself', - hostkey=>$SIPackages_key, + hostkey=>$ClientPackages_key, timestamp=>&get_time, } ); @@ -188,7 +188,7 @@ my $res = $main::known_server_db->add_dbentry( {table=>'known_server', sub get_module_info { my @info = ($server_address, - $SIPackages_key, + $ClientPackages_key, ); return \@info; } @@ -389,7 +389,7 @@ sub register_at_bus { # $event_hash->{$event_name} = $event_module; # } # my $events_string = join( ", ", @{$events_l}); -# &main::daemon_log("S DEBUG: SIPackages imported events $events_string", 8); +# &main::daemon_log("S DEBUG: ClientPackages imported events $events_string", 8); # } #} @@ -416,7 +416,7 @@ sub process_incoming_msg { # skip PREFIX $header =~ s/^CLMSG_//; - &main::daemon_log("$session_id DEBUG: SIPackages: msg to process: $header", 7); + &main::daemon_log("$session_id DEBUG: ClientPackages: msg to process: $header", 7); if( 0 == length @target_l){ &main::daemon_log("$session_id ERROR: no target specified for msg $header", 1); @@ -471,7 +471,7 @@ sub process_incoming_msg { if( not defined $out_msg_l[0] ) { @out_msg_l = (); } elsif( $out_msg_l[0] eq 'nohandler') { - &main::daemon_log("$session_id ERROR: SIPackages: no event handler or core function defined for '$header'", 1); + &main::daemon_log("$session_id ERROR: ClientPackages: no event handler or core function defined for '$header'", 1); @out_msg_l = (); } elsif ($out_msg_l[0] eq 'knownclienterror') { &main::daemon_log("$session_id ERROR: no or more than 1 hits are found at known_clients_db with sql query: '$sql_events'", 1); diff --git a/gosa-si/modules/GosaPackages.pm b/gosa-si/modules/GosaPackages.pm index 56f0d6178..8976fa113 100644 --- a/gosa-si/modules/GosaPackages.pm +++ b/gosa-si/modules/GosaPackages.pm @@ -14,8 +14,8 @@ use Data::Dumper; use GOSA::DBsqlite; use MIME::Base64; -my $event_dir = "/usr/lib/gosa-si/server/events"; -use lib "/usr/lib/gosa-si/server/events"; +my $event_dir = "/usr/lib/gosa-si/server/GosaPackages"; +use lib "/usr/lib/gosa-si/server/GosaPackages"; BEGIN{} END{} @@ -61,7 +61,7 @@ my $xml = new XML::Simple(); my ($error, $result, $event_hash) = &import_events($event_dir); if ($error == 0) { foreach my $log_line (@$result) { - &main::daemon_log("0 INFO: GosaPackages - $log_line", 5); + &main::daemon_log("0 DEBUG: GosaPackages - $log_line", 7); } } else { foreach my $log_line (@$result) { diff --git a/gosa-si/modules/ServerPackages.pm b/gosa-si/modules/ServerPackages.pm index 4a4ddf643..9e45163ab 100644 --- a/gosa-si/modules/ServerPackages.pm +++ b/gosa-si/modules/ServerPackages.pm @@ -17,8 +17,8 @@ use GOSA::GosaSupportDaemon; #use Socket; #use Net::hostent; -my $event_dir = "/usr/lib/gosa-si/server/events"; -use lib "/usr/lib/gosa-si/server/events"; +my $event_dir = "/usr/lib/gosa-si/server/ServerPackages"; +use lib "/usr/lib/gosa-si/server/ServerPackages"; BEGIN{} END {} @@ -30,7 +30,7 @@ END {} my ($error, $result, $event_hash) = &import_events($event_dir); if ($error == 0) { foreach my $log_line (@$result) { - &main::daemon_log("0 INFO: ServerPackages - $log_line", 5); + &main::daemon_log("0 DEBUG: ServerPackages - $log_line", 7); } } else { foreach my $log_line (@$result) { diff --git a/gosa-si/server.conf b/gosa-si/server.conf index 00a54a2f5..f3b608d71 100644 --- a/gosa-si/server.conf +++ b/gosa-si/server.conf @@ -13,7 +13,7 @@ ldap-base = dc=your,dc=domain ldap-admin-dn = cn=ldapadmin,dc=your,dc=domain ldap-admin-password = tester -[SIPackages] +[ClientPackages] key = secret-server-password [ArpHandler] @@ -23,5 +23,5 @@ enabled = false enabled = true key = secret-gosa-password -[foreign-server] +[ServerPackages] key = secret-foreign-key diff --git a/gosa-si/server/events/gosaTriggered.pm b/gosa-si/server/events/gosaTriggered.pm index 7e3676974..0c0a1cf4e 100644 --- a/gosa-si/server/events/gosaTriggered.pm +++ b/gosa-si/server/events/gosaTriggered.pm @@ -483,7 +483,7 @@ sub trigger_reload_ldap_config { my $res = $main::job_db->exec_statement($sql_statement); } - my $out_msg = &SIPackages::new_ldap_config($target, $session_id); + my $out_msg = &ClientPackages::new_ldap_config($target, $session_id); my @out_msg_l = ( $out_msg ); return @out_msg_l; diff --git a/gosa-si/server/events/siTriggered.pm b/gosa-si/server/events/siTriggered.pm index 18a2a5eb0..544e2e6ab 100644 --- a/gosa-si/server/events/siTriggered.pm +++ b/gosa-si/server/events/siTriggered.pm @@ -70,7 +70,7 @@ sub reload_ldap_config { my $header = @{$msg_hash->{header}}[0]; my $target = @{$msg_hash->{$header}}[0]; - my $out_msg = &SIPackages::new_ldap_config($target, $session_id); + my $out_msg = &ClientPackages::new_ldap_config($target, $session_id); my @out_msg_l = ( $out_msg ); return @out_msg_l; } -- 2.30.2