Code

Modified Signal Handler for SIGUSR2 - recreate all needed DBs.
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Jun 2008 17:00:14 +0000 (17:00 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Jun 2008 17:00:14 +0000 (17:00 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11342 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-server

index 262d1afd1ec962e081b6a4ed155ffdecd60d5c73..6d2c866d81e8a6128347383392f89760202761a3 100755 (executable)
@@ -1459,7 +1459,7 @@ sub session_start {
        $kernel->yield('create_fai_release_db', $fai_release_tn );
     $kernel->yield('watch_for_next_tasks');
        $kernel->sig(USR1 => "sig_handler");
-       $kernel->sig(USR2 => "create_packages_list_db");
+       $kernel->sig(USR2 => "recreate_packages_db");
        $kernel->delay_set('watch_for_new_jobs', $job_queue_loop_delay);
        $kernel->delay_set('watch_for_done_jobs', $job_queue_loop_delay); 
        $kernel->delay_set('watch_for_new_messages', $messaging_db_loop_delay);
@@ -2002,6 +2002,16 @@ sub change_goto_state {
 }
 
 
+sub run_recreate_packages_db {
+    my ($kernel, $session, $heap) = @_[KERNEL, SESSION, HEAP];
+    my $session_id = $session->ID;
+       &main::daemon_log("$session_id INFO: Recreating FAI Packages DB ('$fai_release_tn', '$fai_server_tn', '$packages_list_tn')", 4);
+       $kernel->yield('create_fai_release_db');
+       $kernel->yield('create_fai_server_db');
+       return;
+}
+
+
 sub run_create_fai_server_db {
     my ($kernel, $session, $heap, $table_name) = @_[KERNEL, SESSION, HEAP, ARG0];
     my $session_id = $session->ID;
@@ -3030,6 +3040,7 @@ POE::Session->create(
         create_packages_list_db => \&run_create_packages_list_db,
         create_fai_server_db => \&run_create_fai_server_db,
         create_fai_release_db => \&run_create_fai_release_db,
+               recreate_packages_db => \&run_recreate_packages_db,
         session_run_result => \&session_run_result,
         session_run_debug => \&session_run_debug,
         session_run_done => \&session_run_done,