From: janw Date: Tue, 8 Apr 2008 06:48:37 +0000 (+0000) Subject: Run create_packages_list_db on SIGUSR2. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=172954adfb5d6738189db3f09e92943bf451797c;p=gosa.git Run create_packages_list_db on SIGUSR2. Closes #384 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10262 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index f32876de2..ed79c7349 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -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); }