[Koha-patches] [PATCH 4/4] Bug 11078 Add locking to rebuild_zebra (QA Patch 2 10/28)

Doug Kingston dpk at randomnotes.org
Tue Oct 29 07:33:36 CET 2013


In the event lockdir is not specified in the koha-conf.xml file
which will occur for old installations, default the lockdir to a
sensible default (/var/lock).
---
 misc/migration_tools/rebuild_zebra.pl |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl
index e18725c..8b77686 100755
--- a/misc/migration_tools/rebuild_zebra.pl
+++ b/misc/migration_tools/rebuild_zebra.pl
@@ -143,7 +143,9 @@ my ($biblioitemnumbertagfield,$biblioitemnumbertagsubfield) = &GetMarcFromKohaFi
 # We need to create our own lock directory which incorporates the database instance
 # we are indexing to facilitate multiple instances on the same machine.
 
-my $lockdir = C4::Context->config("lockdir") . "/koha_rebuild_zebra_" . C4::Context->config("database");
+my $lockdir = C4::Context->config("lockdir");
+$lockdir = "/var/lock" if $lockdir == "";
+$lockdir .= ("/koha_rebuild_zebra_" . C4::Context->config("database"));
 mkpath($lockdir, 0, 0755) unless (-d $lockdir);
 my $lockfile = $lockdir . "/lock";
 
-- 
1.7.9.5



More information about the Koha-patches mailing list