From 481cff0026ee3f48ae783df4e6ea628c0cc15815 Mon Sep 17 00:00:00 2001 From: rettenbe Date: Mon, 11 Feb 2008 14:15:35 +0000 Subject: [PATCH] changed config files git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8826 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/client/events/corefunctions.pm | 6 +-- gosa-si/gosa-si-bus | 8 +-- gosa-si/gosa-si-client | 20 ++++---- gosa-si/gosa-si-server | 67 +++++++++++--------------- gosa-si/modules/ArpHandler.pm | 3 -- gosa-si/modules/GosaPackages.pm | 39 +++++---------- gosa-si/modules/SIPackages.pm | 35 ++++++-------- gosa-si/server.conf | 42 ++++++++-------- 8 files changed, 93 insertions(+), 127 deletions(-) diff --git a/gosa-si/client/events/corefunctions.pm b/gosa-si/client/events/corefunctions.pm index d68f98160..b52677f4a 100644 --- a/gosa-si/client/events/corefunctions.pm +++ b/gosa-si/client/events/corefunctions.pm @@ -16,14 +16,12 @@ my ($ldap_enabled, $ldap_config, $pam_config, $nss_config, $fai_logpath); my %cfg_defaults = ( - "general" => { - "fai_logpath" => [\$fai_logpath, "/var/log/fai/fai.log"], - }, "client" => { "ldap" => [\$ldap_enabled, 1], "ldap_config" => [\$ldap_config, "/etc/ldap/ldap.conf"], "pam_config" => [\$pam_config, "/etc/pam_ldap.conf"], "nss_config" => [\$nss_config, "/etc/libnss_ldap.conf"], + "fai_logpath" => [\$fai_logpath, "/var/log/fai/fai.log"], }, ); @@ -449,7 +447,7 @@ sub detect_hardware { &write_to_file('goto-hardware-detection-stop', $fai_logpath); - return &main::send_msg_hash2address( + return &main::send_msg_hash_to_target( &main::create_xml_hash("detected_hardware", $main::client_address, $main::server_address, $result), $main::server_address, $main::server_key, diff --git a/gosa-si/gosa-si-bus b/gosa-si/gosa-si-bus index 3b5aa2a0d..f3a9b47d0 100755 --- a/gosa-si/gosa-si-bus +++ b/gosa-si/gosa-si-bus @@ -47,14 +47,14 @@ $foreground = 0 ; "general" => { "log_file" => [\$log_file, "/var/run/".$0.".log"], "pid_file" => [\$pid_file, "/var/run/".$0.".pid"], - "bus_known_server_file_name" => [\$bus_known_server_file_name, "/var/lib/gosa-si/gosa-si-bus_known_server.db"], - "bus_known_clients_file_name" => [\$bus_known_clients_file_name, "/var/lib/gosa-si/gosa-si-bus_known_clients.db"], }, -"GOsa-si-bus" => { +"bus" => { "key" => [\$bus_key, "secret-bus-password"], "ip" => [\$bus_ip, "0.0.0.0"], "port" => [\$bus_port, "20080"], - }, + "bus_known_server_file_name" => [\$bus_known_server_file_name, "/var/lib/gosa-si/gosa-si-bus_known_server.db"], + "bus_known_clients_file_name" => [\$bus_known_clients_file_name, "/var/lib/gosa-si/gosa-si-bus_known_clients.db"], + }, ); #=== FUNCTIONS = functions ===================================================== diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index c4b36fe63..b4d3a2e9f 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -64,21 +64,21 @@ our $REGISTERED_FLAG = 1; "fai_logpath" => [\$fai_logpath, "/var/log/fai/fai.log"], }, "client" => - {"client_port" => [\$client_port, "20083"], - "client_ip" => [\$client_ip, "0.0.0.0"], - "client_mac_address" => [\$client_mac_address, "00:00:00:00:00:00"], + {"port" => [\$client_port, "20083"], + "ip" => [\$client_ip, "0.0.0.0"], + "mac_address" => [\$client_mac_address, "00:00:00:00:00:00"], + "server_domain" => [\$server_domain, ""], "ldap" => [\$ldap_enabled, 1], "ldap_config" => [\$ldap_config, "/etc/ldap/ldap.conf"], "pam_config" => [\$pam_config, "/etc/pam_ldap.conf"], "nss_config" => [\$nss_config, "/etc/libnss_ldap.conf"], }, -"server" => - {"server_ip" => [\$server_ip, "127.0.0.1"], - "server_port" => [\$server_port, "20081"], - "server_key" => [\$server_key, ""], - "server_timeout" => [\$server_timeout, 10], - "server_domain" => [\$server_domain, ""], - "server_key_lifetime" => [\$server_key_lifetime, 600], +"server" => { + "ip" => [\$server_ip, "127.0.0.1"], + "port" => [\$server_port, "20081"], + "key" => [\$server_key, ""], + "timeout" => [\$server_timeout, 10], + "key_lifetime" => [\$server_key_lifetime, 600], }, ); diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index 39fe6f815..7d66fb2ef 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -47,21 +47,18 @@ use lib "/usr/lib/gosa-si/modules"; my (%cfg_defaults, $foreground, $verbose, $ping_timeout); my ($bus, $msg_to_bus, $bus_cipher); -my ($server, $server_mac_address, $server_events); +my ($server, $server_mac_address); my ($gosa_server, $job_queue_timeout, $job_queue_table_name, $job_queue_file_name,$job_queue_loop_delay); my ($known_modules, $known_clients_file_name, $known_server_file_name); -my ($max_clients); my ($pid_file, $procid, $pid, $log_file); -my (%free_child, %busy_child, $child_max, $child_min, %child_alive_time, $child_timeout); -my ($arp_activ, $arp_fifo, $arp_fifo_path); +my ($arp_activ, $arp_fifo); my ($xml); # variables declared in config file are always set to 'our' our (%cfg_defaults, $log_file, $pid_file, - $bus_activ, $bus_key, $bus_ip, $bus_port, - $server_activ, $server_ip, $server_port, $SIPackages_key, $max_clients, - $arp_activ, $arp_fifo_path, - $gosa_activ, $GosaPackages_key, $gosa_ip, $gosa_port, $gosa_timeout, + $server_ip, $server_port, $SIPackages_key, + $arp_activ, + $GosaPackages_key, $gosa_ip, $gosa_port, $gosa_timeout, ); # additional variable which should be globaly accessable @@ -97,43 +94,28 @@ our $known_server_db; # holds all registrated clients our $known_clients_db; -%cfg_defaults = -("general" => - {"log_file" => [\$log_file, "/var/run/".$0.".log"], +%cfg_defaults = ( +"general" => { + "log_file" => [\$log_file, "/var/run/".$0.".log"], "pid_file" => [\$pid_file, "/var/run/".$0.".pid"], - "child_max" => [\$child_max, 10], - "child_min" => [\$child_min, 3], - "child_timeout" => [\$child_timeout, 180], - "job_queue_timeout" => [\$job_queue_timeout, undef], - "job_queue_file_name" => [\$job_queue_file_name, '/var/lib/gosa-si/gosa-si-server_jobs.db'], - "job_queue_loop_delay" => [\$job_queue_loop_delay, 3], + }, +"server" => { +# "ip" => [\$server_ip, "0.0.0.0"], + "port" => [\$server_port, "20081"], "known_clients_file_name" => [\$known_clients_file_name, '/var/lib/gosa-si/gosa-si-server_known_clients.db' ], "known_server_file_name" => [\$known_server_file_name, '/var/lib/gosa-si/gosa-si-server_known_server.db'], - }, -"bus" => - {"bus_activ" => [\$bus_activ, "on"], - "bus_passwd" => [\$bus_key, ""], - "bus_ip" => [\$bus_ip, "0.0.0.0"], - "bus_port" => [\$bus_port, "20080"], }, -"server" => - {"server_activ" => [\$server_activ, "on"], - "server_ip" => [\$server_ip, "0.0.0.0"], - "server_port" => [\$server_port, "20081"], - "SIPackages_key" => [\$SIPackages_key, "none"], - "max_clients" => [\$max_clients, 100], - }, -"arp" => - {"arp_activ" => [\$arp_activ, "on"], - "arp_fifo_path" => [\$arp_fifo_path, "/var/run/gosa-si/arp-notify"], +"GOsaPackages" => { + "ip" => [\$gosa_ip, "0.0.0.0"], + "port" => [\$gosa_port, "20082"], + "job_queue_file_name" => [\$job_queue_file_name, '/var/lib/gosa-si/gosa-si-server_jobs.db'], + "job_queue_loop_delay" => [\$job_queue_loop_delay, 3], + "key" => [\$GosaPackages_key, "none"], }, -"gosa" => - {"gosa_activ" => [\$gosa_activ, "on"], - "gosa_ip" => [\$gosa_ip, "0.0.0.0"], - "gosa_port" => [\$gosa_port, "20082"], - "GosaPackages_key" => [\$GosaPackages_key, "none"], +"SIPackages" => { + "key" => [\$SIPackages_key, "none"], }, - ); +); #=== FUNCTION ================================================================ @@ -524,6 +506,11 @@ sub input_from_unknown_host { while( my ($mod, $info) = each(%act_modules)) { # check a key exists for this module + + +print STDERR "SIPackages_key:$SIPackages_key\n"; + + my $module_key = ${$mod."_key"}; if( ! $module_key ) { daemon_log("ERROR: no key specified in config file for $mod", 1); @@ -988,7 +975,7 @@ sub client_input { sub trigger_db_loop { # my ($kernel) = $_[KERNEL]; my ($kernel) = @_ ; - $kernel->delay_set('watch_for_new_jobs',3); + $kernel->delay_set('watch_for_new_jobs', $job_queue_loop_delay); } diff --git a/gosa-si/modules/ArpHandler.pm b/gosa-si/modules/ArpHandler.pm index 44a74978b..edce85751 100644 --- a/gosa-si/modules/ArpHandler.pm +++ b/gosa-si/modules/ArpHandler.pm @@ -89,9 +89,6 @@ sub read_configfile { sub get_module_info { my @info = (undef, undef, - undef, - undef, - "socket", ); &read_configfile(); diff --git a/gosa-si/modules/GosaPackages.pm b/gosa-si/modules/GosaPackages.pm index d23b658e3..22bf48d7b 100644 --- a/gosa-si/modules/GosaPackages.pm +++ b/gosa-si/modules/GosaPackages.pm @@ -19,36 +19,25 @@ use lib "/usr/lib/gosa-si/server/events"; BEGIN{} END{} -my ($server_activ, $server_ip, $server_mac_address, $server_port, $server_passwd, $max_clients, $server_event_dir); -my ($bus_activ, $bus_passwd, $bus_ip, $bus_port); -my ($gosa_activ, $gosa_ip, $gosa_mac_address, $gosa_port, $gosa_passwd, $network_interface); +my ($server_ip, $server_mac_address, $server_port, $server_passwd, $max_clients); +my ($gosa_ip, $gosa_mac_address, $gosa_port, $gosa_passwd, $network_interface); my ($job_queue_timeout, $job_queue_file_name); my $gosa_server; my $event_hash; -my %cfg_defaults = -("general" => - {"job_queue_file_name" => [\$job_queue_file_name, '/var/lib/gosa-si/jobs.db'], - }, -"server" => - {"server_activ" => [\$server_activ, "on"], - "server_ip" => [\$server_ip, "0.0.0.0"], - "server_port" => [\$server_port, "20081"], - "server_passwd" => [\$server_passwd, ""], +my %cfg_defaults = ( +"server" => { + "ip" => [\$server_ip, "0.0.0.0"], + "port" => [\$server_port, "20081"], + "key" => [\$server_passwd, ""], "max_clients" => [\$max_clients, 100], }, -"bus" => - {"bus_activ" => [\$bus_activ, "on"], - "bus_passwd" => [\$bus_passwd, ""], - "bus_ip" => [\$bus_ip, "0.0.0.0"], - "bus_port" => [\$bus_port, "20080"], - }, -"gosa" => - {"gosa_activ" => [\$gosa_activ, "on"], - "gosa_ip" => [\$gosa_ip, "0.0.0.0"], - "gosa_port" => [\$gosa_port, "20082"], - "gosa_passwd" => [\$gosa_passwd, "none"], +"GOsaPackages" => { + "ip" => [\$gosa_ip, "0.0.0.0"], + "port" => [\$gosa_port, "20082"], + "key" => [\$gosa_passwd, "none"], + "job_queue_file_name" => [\$job_queue_file_name, '/var/lib/gosa-si/jobs.db'], }, ); @@ -62,7 +51,6 @@ $gosa_mac_address= &get_mac($network_interface); # complete addresses my $server_address = "$server_ip:$server_port"; -my $bus_address = "$bus_ip:$bus_port"; my $gosa_address = "$gosa_ip:$gosa_port"; # create general settings for this module @@ -78,9 +66,6 @@ my $xml = new XML::Simple(); sub get_module_info { my @info = ($gosa_address, $gosa_passwd, - $gosa_server, - $gosa_activ, - "socket", ); return \@info; } diff --git a/gosa-si/modules/SIPackages.pm b/gosa-si/modules/SIPackages.pm index 1eff3a641..65be05af8 100644 --- a/gosa-si/modules/SIPackages.pm +++ b/gosa-si/modules/SIPackages.pm @@ -21,8 +21,7 @@ use Net::DNS; BEGIN{} END {} -my ($known_clients_file_name); -my ($server_activ, $server_ip, $server_mac_address, $server_port, $SIPackages_key, $max_clients, $ldap_uri, $ldap_base, $ldap_admin_dn, $ldap_admin_password, $server_interface); +my ($server_ip, $server_mac_address, $server_port, $SIPackages_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; @@ -30,25 +29,25 @@ my $no_bus; my (@ldap_cfg, @pam_cfg, @nss_cfg, $goto_admin, $goto_secret); -my %cfg_defaults = -( -"server" => - {"server_activ" => [\$server_activ, "on"], - "server_ip" => [\$server_ip, "0.0.0.0"], - "server_mac_address" => [\$server_mac_address, "00:00:00:00:00"], - "server_port" => [\$server_port, "20081"], - "SIPackages_key" => [\$SIPackages_key, ""], - "max_clients" => [\$max_clients, 100], +my %cfg_defaults = ( +"bus" => { + "activ" => [\$bus_activ, "on"], + "key" => [\$bus_key, ""], + "ip" => [\$bus_ip, ""], + "port" => [\$bus_port, "20080"], + }, +"server" => { + "ip" => [\$server_ip, "0.0.0.0"], + "mac_address" => [\$server_mac_address, "00:00:00:00:00"], + "port" => [\$server_port, "20081"], "ldap_uri" => [\$ldap_uri, ""], "ldap_base" => [\$ldap_base, ""], "ldap_admin_dn" => [\$ldap_admin_dn, ""], "ldap_admin_password" => [\$ldap_admin_password, ""], + "max_clients" => [\$max_clients, 100], }, -"bus" => - {"bus_activ" => [\$bus_activ, "on"], - "bus_passwd" => [\$bus_key, ""], - "bus_ip" => [\$bus_ip, ""], - "bus_port" => [\$bus_port, "20080"], +"SIPackages" => { + "key" => [\$SIPackages_key, ""], }, ); @@ -97,15 +96,11 @@ my $res = $main::known_server_db->add_dbentry( {table=>'known_server', sub get_module_info { my @info = ($server_address, $SIPackages_key, - $server, - $server_activ, - "socket", ); return \@info; } - sub do_wake { my $host = shift; my $ipaddr = shift || '255.255.255.255'; diff --git a/gosa-si/server.conf b/gosa-si/server.conf index 5ae3e923d..601fcf2c0 100644 --- a/gosa-si/server.conf +++ b/gosa-si/server.conf @@ -1,29 +1,33 @@ [general] -log_file = /var/log/gosa-si-server.log +log_file = /var/run/gosa-si-server.log pid_file = /var/run/gosa-si-server.pid [bus] -bus_activ = on -bus_passwd = secret-bus-password -bus_ip = 10.89.1.31 -bus_port = 20080 +activ = on +key = secret-bus-password +ip = 127.0.0.1 +port = 20080 [server] -server_activ = on -server_port = 20081 -SIPackages_key = secret-server-password -max_clients = 5 -server_event_dir = /usr/lib/gosa-si/server/events -ldap_uri = ldap://10.89.1.30 -ldap_base = o=Landeshauptstadt München,c=de -ldap_admin_dn = cn=ldapadmin,o=Landeshauptstadt München,c=de +port = 20081 +known_clients_file_name = /var/lib/gosa-si/gosa-si-server_known_clients.db +known_server_file_name = /var/lib/gosa-si/gosa-si-server_known_server.db +max_clients = 100 +ldap_uri = ldap://127.0.0.1 +ldap_base = +ldap_admin_dn = ldap_admin_password = tester -[arp] -arp_activ = on -arp_interface = all +[SIPackages] +key = secret-server-password -[gosa] -gosa_activ = on -GosaPackages_key = secret-gosa-password +[ArpHandler] +activ = on +interface = all + +[GOsaPackages] +activ = on +key = secret-gosa-password +job_queue_file_name = /var/lib/gosa-si/gosa-si-server_jobs.db +job_queue_loop_delay = 3 -- 2.30.2