Removed -s from su call after Thomas D reports it breaks FreeBSD
[koha.git] / z3950 / z3950-daemon-launch.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 # Call this script during system startup, such as from rc.local
12
13 # Bugs/To Do:
14 #   Needs SysV-type start/stop options
15
16 #----------------------------
17 . $(dirname $0)/z3950-daemon-options
18 export KohaZ3950Dir
19
20 #----------------------------
21 if [ ! -d $KohaZ3950Dir ]
22 then
23         echo ERROR: Cannot find Koha directory $KohaZ3950Dir
24         exit 1
25 fi
26
27 KohaZ3950Shell=$KohaZ3950Dir/z3950-daemon-shell.sh
28
29 if [ ! -x $KohaZ3950Shell ]
30 then
31         echo ERROR: Cannot find Koha Z39.50 daemon launcher $KohaZ3950Shell
32         exit 1
33 fi
34
35 #MJR: removed -s option, as we have a #! at the start of z3950-daemon-shell.sh
36 su -c $KohaZ3950Shell - $RunAsUser &
37
38 exit
39
40 #--------------
41 # $Log$
42 # Revision 1.5  2005/06/20 17:05:17  slef
43 # Removed -s from su call after Thomas D reports it breaks FreeBSD
44 #
45 # Revision 1.4  2003/11/05 23:33:45  slef
46 # Now figures out what directory the scripts are in
47 #
48 # Revision 1.3  2003/10/06 09:10:39  slef
49 # Removing config info from z3950*sh and using C4::Context in processz3950queue (Fixed bug 39)
50 #
51 # Revision 1.2  2003/04/29 16:48:25  tipaul
52 # really proud of this commit :-)
53 # z3950 search and import seems to works fine.
54 # Let me explain how :
55 # * a "search z3950" button is added in the addbiblio template.
56 # * when clicked, a popup appears and z3950/search.pl is called
57 # * z3950/search.pl calls addz3950search in the DB
58 # * the z3950 daemon retrieve the records and stores them in z3950results AND in marc_breeding table.
59 # * as long as there as searches pending, the popup auto refresh every 2 seconds, and says how many searches are pending.
60 # * when the user clicks on a z3950 result => the parent popup is called with the requested biblio, and auto-filled
61 #
62 # Note :
63 # * 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.
64 # * 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.
65 #
66 # Revision 1.1  2002/11/22 10:15:22  tipaul
67 # moving z3950 related scripts to specific dir
68 #
69 # Revision 1.3  2002/07/02 22:08:50  tonnesen
70 # merging changes from rel-1-2
71 #
72 # Revision 1.1.2.3  2002/06/26 19:56:57  tonnesen
73 # Bug fix.  Single quotes were causing $KohaZ3950Shell variable to not get
74 # expanded
75 #
76 # Revision 1.1.2.2  2002/06/26 16:25:51  amillar
77 # Make directory variable name more explanatory
78 #