[Koha] Zebra not updating biblios au tomatically in koha 3.8

Paul paul.a at aandc.org
Wed Sep 5 04:01:48 NZST 2012


At 08:00 AM 9/4/2012 -0500, Randall Rowe wrote:
>Why would this require a server reboot?

Reboot or logout/login (I just played it safe...)

>Also .bashrc env vars dono't affect cron. If you want to insure that cron 
>env variables are set properly edit that users crontab.

Very specifically Koha 3.8.4 on Ubuntu 12.04.1 64-bit (I am NOT necessarily 
generalizing [1]); the env vars required for user=koha to run a koha-owned 
cron do not survive reboot. A "proper edit" of crontab gives (see Wiki, 
install, etc):

KOHA_CONF=/etc/koha/koha-conf.xml
KOHAPATH=/usr/share/koha
PERL5LIB=$KOHAPATH/lib
*/1 * * * *    koha    $KOHAPATH/bin/migration_tools/rebuild_zebra.pl -a -b 
-z &> /dev/null

After a reboot (that does happen in real life, particularly on my sandbox 
where I established this "proof of concept") the env vars do not survive:

koha at server:/$ printenv|grep koha
USER=koha
MAIL=/var/mail/koha
HOME=/home/koha
LOGNAME=koha

and the cron rebuild_zebra.pl -a -b -z fails [Can't locate C4/Context.pm in 
@INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 
/usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 
/usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at 
/usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 6.
BEGIN failed--compilation aborted at 
/usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 6.]

So, add the env vars to koha's .bashrc so that it reads:

$ cat /home/koha/.bashrc
export PERL5LIB=/usr/share/koha/lib
export KOHA_CONF=/etc/koha/koha-conf.xml

and after reboot:

koha at server:/$ printenv | grep koha
PERL5LIB=/usr/share/koha/lib
USER=koha
MAIL=/var/mail/koha
KOHA_CONF=/etc/koha/koha-conf.xml
HOME=/home/koha
LOGNAME=koha

and the cron rebuild_zebra.pl -a -b -z is fully functional.

Verify: all permutations of rem'ing {first 3 lines of cron job} and {2 
lines of koha/.bashrc} confirms the above. CONCLUSION: to renew 
PERL5LIB=/usr/share/koha/lib and KOHA_CONF=/etc/koha/koha-conf.xml after 
reboot, the 'export' must be in /home/koha/.bashrc

Now, leave the two 'export' lines in /home/koha/.bashrc and modify the cron to:

paul at server:/etc/cron.d$ cat koha
# KOHA_CONF=/etc/koha/koha-conf.xml
# KOHAPATH=/usr/share/koha
# PERL5LIB=$KOHAPATH/lib
*/1 * * * *    koha    $KOHAPATH/bin/migration_tools/rebuild_zebra.pl -a -b 
-z &> /dev/null

Works perfectly ....  QED

>*nix != windoze

Not sure it's relevant here, but I've been preaching that to the choir for 
twenty + years (first appearance of Windows 2|3; I thought the first DOS 
GUI looked promising ;=} .)  I originally started on ALGOL and Fortran 
(smattering of COBOL) in the late 50s, until Unix was recompiled in c in 
the early 70s. I never got the opportunity of using the original assembly 
language version ...

>server reboot not usually necessary. When changing .bashrc files all that 
>is required is to logout and log back in.

Agreed, see above.

[1] -- BTW, our production server runs Koha 3.6.1 on Ubuntu (10.04 LTS part 
updated to 11.10) and uses the same construct.

Best - Paul


>Randy Rowe
>Lincoln City Libraries I.T.
>
>
>
>
>
>---- Original Message ----
>From: "Paul" <paul.a at aandc.org>
>Sent: 8/31/2012 3:40:10 PM
>To: "Elaine Bradtke" <eb at efdss.org>, Koha at lists.katipo.co.nz
>Subject: Re: [Koha] Zebra not updating biblios automatically in koha 3.8
>
>At 08:37 PM 8/31/2012 +0100, Elaine Bradtke wrote:
> >My colleagues are reporting a similar problem with 3.8.4
> >Downloading and editing of records seems to function normally, but
> >once it is saved,  none of the usual searches brings it up, and
> >running a report on recently catalogued items give zero results.
> >
> >mysql Ver 14.14 Distrib 5.1.63, for debian-linux-gnu (i486) using 
> readline 6.1
> >  Apache/2.2.16 (Debian)
> >Zebra version:Zebra 2.0.50
> >
> >Any ideas?
>
>I have found that 3.8.x may have problems with env vars not being available
>to cron. Please try editing:
>
>sudo vi /home/koha/.bashrc
>
>Add the following two lines:
>
>export PERL5LIB=/usr/share/koha/lib
>export KOHA_CONF=/etc/koha/koha-conf.xml
>:x
>
>then reboot your server.  This in itself cannot do any harm, and could well
>cure your problem.
>
>Best - Paul
>
> >Elaine Bradtke
> >
> >On Fri, Aug 31, 2012 at 12:05 PM, sunil sharma <koha.sunil007 at gmail.com>
> >wrote:
> > >
> > > Dear All,
> > >
> > > I installed Koha 3.8.02 and also check latest version of koha 3.8.04 on
> > > centos 6.2, The same problem I am facing in both of these version. when I
> > > enter any new biblio, it is not updated automatically to zebra, I am 
> using
> > > zebra latest version 2.0.54 and all cronjobs are set. I also manually 
> check
> > > zebra functioning by ./rebuild_zebra.pl -b -a -v -z but it shows export
> > > biblios zero, but I already added some bilios to koha yet it shows 
> exported
> > > zero. And, when I use ./rebuild_zebra.pl -b -a -v -r then it rebuild all
> > > the biblios and my all added biblio shows in result i.e. exported 10
> > > biblios. My question is that why  ./rebuild_zebra.pl -b -a -v -z 
> option is
> > > not working. where is the problem, because my zebra working fine in 
> 3.6, is
> > > there any problem in koha 3.8. or any other issue. Please help me out.
> > >
> > > Thanx in advance.
> > >
> > > Sunil
> > > _______________________________________________
> > > Koha mailing list  http://koha-community.org
> > > Koha at lists.katipo.co.nz
> > > http://lists.katipo.co.nz/mailman/listinfo/koha
> >
> >
> >
> >
> >--
> >Elaine Bradtke
> >Data Wrangler
> >VWML
> >English Folk Dance and Song Society | http://www.efdss.org
> >Cecil Sharp House, 2 Regent's Park Road, London NW1 7AY
> >Tel    +44 (0) 20 7485 2206 (This number is for the English Folk Dance
> >and Song Society in London, England. If you wish to phone me
> >personally, send an e-mail first. I work off site)
> >--------------------------------------------------------------------------
> >Registered Company No. 297142
> >Charity Registered in England and Wales No. 305999
> >---------------------------------------------------------------------------
> >"Writing about music is like dancing about architecture"
> >--Elvis Costello (Musician magazine No. 60 (October 1983), p. 52)
> >_______________________________________________
> >Koha mailing list  http://koha-community.org
> >Koha at lists.katipo.co.nz
> >http://lists.katipo.co.nz/mailman/listinfo/koha
>
>---
>Maritime heritage and history, preservation and conservation,
>research and education through the written word and the arts.
><http://NavalMarineArchive.com> and <http://UltraMarine.ca>
>
>_______________________________________________
>Koha mailing list  http://koha-community.org
>Koha at lists.katipo.co.nz
>http://lists.katipo.co.nz/mailman/listinfo/koha

---
Maritime heritage and history, preservation and conservation,
research and education through the written word and the arts.
<http://NavalMarineArchive.com> and <http://UltraMarine.ca>



More information about the Koha mailing list