Code

Run create_packages_list_db on SIGUSR2.
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 8 Apr 2008 06:48:37 +0000 (06:48 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 8 Apr 2008 06:48:37 +0000 (06:48 +0000)
Closes #384

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10262 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-server

index f32876de249626da6504a833e860ad5998bb644e..ed79c73495ab842306bae855ca8ef905f2b0dfb4 100755 (executable)
@@ -968,6 +968,7 @@ sub _start {
        $kernel->yield('create_fai_server_db', $fai_server_tn );
        $kernel->yield('create_fai_release_db', $fai_release_tn );
        $kernel->sig(USR1 => "sig_handler");
+       $kernel->sig(USR2 => "create_packages_list_db");
 }
 
 sub sig_handler {
@@ -1904,10 +1905,15 @@ sub create_sources_list {
 sub create_packages_list_db {
     my ($ldap_handle, $sources_file) = @_ ;
 
-    if (not defined $ldap_handle) { 
-        daemon_log("0 ERROR: no ldap_handle available to create_packages_list_db", 1);
-        return;
-    }
+       if (not defined $ldap_handle) { 
+               $ldap_handle= &get_ldap_handle();
+
+               if (not defined $ldap_handle) {
+                       daemon_log("0 ERROR: no ldap_handle available to create_packages_list_db", 1);
+                       return;
+               }
+       }
+
     if (not defined $sources_file) { 
         $sources_file = &create_sources_list($ldap_handle);
     }