really proud of this commit :-)
[koha.git] / z3950 / z3950-daemon-shell.sh
1 #!/bin/sh
2
3 # $Id$
4
5 # Script to start Koha background Z39.50 search daemon
6
7 # Part of the Koha Library Mgmt System -  www.koha.org
8 # Licensed under the GPL
9
10 #----------------------------
11 # Do NOT run this script directly from system startup-- this should not run as root
12 #    Call  z3950-daemon-launch.sh  instead
13
14 #----------------------------
15
16 KohaZ3950Dir=/home/paul/koha.dev/koha/z3950
17 KohaModuleDir=/home/paul/koha.dev/koha
18 LogDir=/tmp
19
20 #----------------------------
21 LOGFILE=$LogDir/z3950-daemon-`date +%Y%m%d-%H%M`.log
22
23 touch $LOGFILE
24 if [ ! -w $LOGFILE ]
25 then
26         echo ERROR: Cannot write to log file $LOGFILE
27         exit 1
28 fi
29
30 KohaZ3950Script=$KohaZ3950Dir/processz3950queue
31 if [ ! -x $KohaZ3950Script ]
32 then
33         echo ERROR: Cannot find Koha Z39.50 daemon script $KohaZ3950Script
34         exit 1
35 fi
36
37 PERL5LIB=$KohaModuleDir
38 export PERL5LIB
39
40 exec $KohaZ3950Script $LogDir >>$LOGFILE 2>&1
41
42 #-------------------
43 # $Log$
44 # Revision 1.2  2003/04/29 16:48:25  tipaul
45 # really proud of this commit :-)
46 # z3950 search and import seems to works fine.
47 # Let me explain how :
48 # * a "search z3950" button is added in the addbiblio template.
49 # * when clicked, a popup appears and z3950/search.pl is called
50 # * z3950/search.pl calls addz3950search in the DB
51 # * the z3950 daemon retrieve the records and stores them in z3950results AND in marc_breeding table.
52 # * as long as there as searches pending, the popup auto refresh every 2 seconds, and says how many searches are pending.
53 # * when the user clicks on a z3950 result => the parent popup is called with the requested biblio, and auto-filled
54 #
55 # Note :
56 # * character encoding support : (It's a nightmare...) In the z3950servers table, a "encoding" column has been added. You can put "UNIMARC" or "USMARC" in this column. Depending on this, the char_decode in C4::Biblio.pm replaces marc-char-encode by an iso 8859-1 encoding. Note that in the breeding import this value has been added too, for a better support.
57 # * the marc_breeding and z3950* tables have been modified : they have an encoding column and the random z3950 number is stored too for convenience => it's the key I use to list only requested biblios in the popup.
58 #
59 # Revision 1.1  2002/11/22 10:15:22  tipaul
60 # moving z3950 related scripts to specific dir
61 #
62 # Revision 1.3  2002/07/02 22:08:50  tonnesen
63 # merging changes from rel-1-2
64 #
65 # Revision 1.1.2.3  2002/06/28 17:45:39  tonnesen
66 # z3950queue now listens for a -HUP signal before processing the queue.  Z3950.pm
67 # sends the -HUP signal when queries are added to the queue.
68 #
69 # Revision 1.1.2.2  2002/06/26 16:25:51  amillar
70 # Make directory variable name more explanatory
71 #