From: janw Date: Mon, 31 Mar 2008 15:21:50 +0000 (+0000) Subject: Changed lock file name. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4eeb0d22bb703e4dbbe4bd34349e5e8d8fc816c5;p=gosa.git Changed lock file name. Removed lock files when starting server. Increased sleep time when waiting for lock. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10095 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index 507c833c7..893ccfb36 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -2124,38 +2124,40 @@ if ($no_bus > 0) { $bus_activ = "false" } - - -# delete old DBsqlite lock files -#unlink('/tmp/gosa_si_lock*'); - # connect to gosa-si job queue +unlink($job_queue_file_name.".si.lock"); $job_db = GOSA::DBsqlite->new($job_queue_file_name); $job_db->create_table($job_queue_tn, \@job_queue_col_names); # connect to known_clients_db +unlink($known_clients_file_name.".si.lock"); $known_clients_db = GOSA::DBsqlite->new($known_clients_file_name); $known_clients_db->create_table($known_clients_tn, \@known_clients_col_names); # connect to known_server_db +unlink($known_server_file_name.".si.lock"); $known_server_db = GOSA::DBsqlite->new($known_server_file_name); $known_server_db->create_table($known_server_tn, \@known_server_col_names); # connect to login_usr_db +unlink($login_users_file_name.".si.lock"); $login_users_db = GOSA::DBsqlite->new($login_users_file_name); $login_users_db->create_table($login_users_tn, \@login_users_col_names); # connect to fai_server_db and fai_release_db +unlink($fai_server_file_name.".si.lock"); $fai_server_db = GOSA::DBsqlite->new($fai_server_file_name); $fai_server_db->create_table($fai_server_tn, \@fai_server_col_names); $fai_server_db->create_table($fai_release_tn, \@fai_release_col_names); # connect to packages_list_db +unlink($packages_list_file_name.".si.lock"); unlink($packages_list_file_name); $packages_list_db = GOSA::DBsqlite->new($packages_list_file_name); $packages_list_db->create_table($packages_list_tn, \@packages_list_col_names); # connect to messaging_db +unlink($messaging_file_name.".si.lock"); $messaging_db = GOSA::DBsqlite->new($messaging_file_name); $messaging_db->create_table($messaging_tn, \@messaging_col_names); diff --git a/gosa-si/modules/DBsqlite.pm b/gosa-si/modules/DBsqlite.pm index 8eba13d47..06f2d0e0e 100644 --- a/gosa-si/modules/DBsqlite.pm +++ b/gosa-si/modules/DBsqlite.pm @@ -16,7 +16,7 @@ sub new { my $class = shift; my $db_name = shift; - my $lock = $db_name.".lock"; + my $lock = $db_name.".si.lock"; # delete existing lock - instance should be running only once if(stat($lock)) { unlink($lock); @@ -38,7 +38,7 @@ sub lock_exists : locked { my $result=(-f $lock); if($result) { #&main::daemon_log("(".((defined $funcname)?$funcname:"").") Lock (PID ".$$.") $lock found", 8); - usleep 100; + usleep 500; } return $result; }