View | Details | Raw Unified | Return to bug 11078
Collapse All | Expand All

(-)a/etc/koha-conf.xml (+1 lines)
Lines 283-288 __PAZPAR2_TOGGLE_XML_POST__ Link Here
283
 <opachtdocs>__OPAC_TMPL_DIR__</opachtdocs>
283
 <opachtdocs>__OPAC_TMPL_DIR__</opachtdocs>
284
 <intrahtdocs>__INTRANET_TMPL_DIR__</intrahtdocs>
284
 <intrahtdocs>__INTRANET_TMPL_DIR__</intrahtdocs>
285
 <includes>__INTRANET_TMPL_DIR__/prog/en/includes/</includes>
285
 <includes>__INTRANET_TMPL_DIR__/prog/en/includes/</includes>
286
 <lockdir>__LOCK_DIR__</lockdir>
286
 <logdir>__LOG_DIR__</logdir>
287
 <logdir>__LOG_DIR__</logdir>
287
 <docdir>__DOC_DIR__</docdir>
288
 <docdir>__DOC_DIR__</docdir>
288
 <backupdir>__BACKUP_DIR__</backupdir>
289
 <backupdir>__BACKUP_DIR__</backupdir>
(-)a/misc/migration_tools/rebuild_zebra.pl (-1 / +24 lines)
Lines 5-10 use strict; Link Here
5
5
6
use C4::Context;
6
use C4::Context;
7
use Getopt::Long;
7
use Getopt::Long;
8
use Fcntl qw(:flock);
8
use File::Temp qw/ tempdir /;
9
use File::Temp qw/ tempdir /;
9
use File::Path;
10
use File::Path;
10
use C4::Biblio;
11
use C4::Biblio;
Lines 139-150 my $dbh = C4::Context->dbh; Link Here
139
my ($biblionumbertagfield,$biblionumbertagsubfield) = &GetMarcFromKohaField("biblio.biblionumber","");
140
my ($biblionumbertagfield,$biblionumbertagsubfield) = &GetMarcFromKohaField("biblio.biblionumber","");
140
my ($biblioitemnumbertagfield,$biblioitemnumbertagsubfield) = &GetMarcFromKohaField("biblioitems.biblioitemnumber","");
141
my ($biblioitemnumbertagfield,$biblioitemnumbertagsubfield) = &GetMarcFromKohaField("biblioitems.biblioitemnumber","");
141
142
143
# We need to create our own lock directory which incorporates the database instance
144
# we are indexing to facilitate multiple instances on the same machine.
145
146
my $lockdir = C4::Context->config("lockdir") . "/koha_rebuild_zebra_" . C4::Context->config("database");
147
mkpath($lockdir, 0, 0755) unless (-d $lockdir);
148
my $lockfile = $lockdir . "/lock";
149
142
if ( $verbose_logging ) {
150
if ( $verbose_logging ) {
143
    print "Zebra configuration information\n";
151
    print "Zebra configuration information\n";
144
    print "================================\n";
152
    print "================================\n";
145
    print "Zebra biblio directory      = $biblioserverdir\n";
153
    print "Zebra biblio directory      = $biblioserverdir\n";
146
    print "Zebra authorities directory = $authorityserverdir\n";
154
    print "Zebra authorities directory = $authorityserverdir\n";
147
    print "Koha directory              = $kohadir\n";
155
    print "Koha directory              = $kohadir\n";
156
    print "Lockfile                    = $lockfile\n";
148
    print "BIBLIONUMBER in :     $biblionumbertagfield\$$biblionumbertagsubfield\n";
157
    print "BIBLIONUMBER in :     $biblionumbertagfield\$$biblionumbertagsubfield\n";
149
    print "BIBLIOITEMNUMBER in : $biblioitemnumbertagfield\$$biblioitemnumbertagsubfield\n";
158
    print "BIBLIOITEMNUMBER in : $biblioitemnumbertagfield\$$biblioitemnumbertagsubfield\n";
150
    print "================================\n";
159
    print "================================\n";
Lines 156-168 if ($do_munge) { Link Here
156
165
157
my $tester = XML::LibXML->new();
166
my $tester = XML::LibXML->new();
158
167
168
# The main work is done here by calling do_one_pass().  We have added locking
169
# avoid race conditions between Full rebuilds and incremental updates either from
170
# daemon mode or periodic invocation from cron.  The race can lead to an updated
171
# record being overwritten by a rebuild if the update is applied after the export
172
# by the rebuild and before the rebuild finishes (more likely to effect large
173
# catalogs).
174
open(LockFH, ">$lockfile") or die "$lockfile: $!";
159
if ($daemon_mode) {
175
if ($daemon_mode) {
160
    while (1) {
176
    while (1) {
161
        do_one_pass() if ( zebraqueue_not_empty() );
177
        # For incremental updates, skip the update if the updates are locked
178
	if (flock(LockFH, LOCK_EX|LOCK_NB)) {
179
	    do_one_pass() if ( zebraqueue_not_empty() );
180
	    flock(LockFH, LOCK_UN);
181
	}
162
        sleep $daemon_sleep;
182
        sleep $daemon_sleep;
163
    }
183
    }
164
} else {
184
} else {
185
    # all one-off invocations, wait for the lock to free
186
    flock(LockFH, LOCK_EX);
165
    do_one_pass();
187
    do_one_pass();
188
    flock(LockFH, LOCK_UN);
166
}
189
}
167
190
168
191
(-)a/rewrite-config.PL (-1 / +1 lines)
Lines 102-107 $prefix = $ENV{'INSTALL_BASE'} || "/usr"; Link Here
102
  "__KOHA_GROUP__" => "koha",
102
  "__KOHA_GROUP__" => "koha",
103
  "__ZEBRA_PASS__" => "zebrastripes",
103
  "__ZEBRA_PASS__" => "zebrastripes",
104
  "__ZEBRA_USER__" => "kohauser",
104
  "__ZEBRA_USER__" => "kohauser",
105
  "__LOCK_DIR__" => "$ENV{'INSTALL_BASE'}/var/lock",
105
  '__BACKUP_DIR__' => "$prefix/var/spool",
106
  '__BACKUP_DIR__' => "$prefix/var/spool",
106
  '__INTRANET_CGI_DIR__' => "$prefix/intranet/cgi-bin",
107
  '__INTRANET_CGI_DIR__' => "$prefix/intranet/cgi-bin",
107
  '__INTRANET_TMPL_DIR__' => "$prefix/intranet/templates",
108
  '__INTRANET_TMPL_DIR__' => "$prefix/intranet/templates",
108
- 

Return to bug 11078