From 7e900820fcd2993737f6018f459bf6c8dd20adc6 Mon Sep 17 00:00:00 2001 From: rettenbe Date: Wed, 12 Mar 2008 12:51:07 +0000 Subject: [PATCH] bugfix: kill all left session children if SIGINT git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9708 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-server | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index 4c540d879..e02996932 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -149,6 +149,7 @@ our $client_fai_log_dir = "/var/log/fai"; # queue which stores taskes while max_clients are reached my @tasks = qw(); + %cfg_defaults = ( "general" => { "log-file" => [\$log_file, "/var/run/".$prg.".log"], @@ -410,7 +411,7 @@ sub sig_int_handler { } daemon_log("shutting down gosa-si-server", 1); - exit(0); + system("killall gosa-si-server"); } $SIG{INT} = \&sig_int_handler; @@ -852,7 +853,7 @@ sub send_msg_to_target { print $socket $crypted_msg."\n"; daemon_log("INFO: send ".$header."msg to $address", 5); - daemon_log("message:\n$msg", 8); + daemon_log("DEBUG: message:\n$msg", 9); } @@ -1013,6 +1014,15 @@ sub process_task { } # an error occurred if(( !$msg ) || ( !$msg_hash ) || ( !$module )){ + my $sql_statement = "SELECT * FROM $main::known_clients_tn WHERE (hostname LIKE '".$heap->{'remote_ip'}."%')"; + my $query_res = $known_clients_db->select_dbentry( $sql_statement ); + while( my ($hit_num, $hit) = each %{ $query_res } ) { + my $host_name = $hit->{'hostname'}; + my $host_key = $hit->{'hostkey'}; + my $ping_msg = "
gosa_ping
$server_address $host_name
"; + my $error = &send_msg_to_target($ping_msg, $host_name, $host_key, "gosa_ping"); + &update_jobdb_status_for_send_msgs($ping_msg, $error); + } $error++; } @@ -1850,7 +1860,6 @@ sub run_create_packages_list_db { StderrEvent => "session_run_debug", CloseEvent => "session_run_done", ); - $heap->{task}->{ $task->ID } = $task; } sub parse_package_info { -- 2.30.2