From 53b128ccdf8e538dcb0df3ed3a65b9c8814541dc Mon Sep 17 00:00:00 2001 From: amillar Date: Tue, 11 Jun 2002 06:26:57 +0000 Subject: [PATCH] Scripts for Z39.50 search daemon --- acqui.simple/z3950-daemon-launch.sh | 36 +++++++++++++++++++++++++++ acqui.simple/z3950-daemon-shell.sh | 38 +++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100755 acqui.simple/z3950-daemon-launch.sh create mode 100755 acqui.simple/z3950-daemon-shell.sh diff --git a/acqui.simple/z3950-daemon-launch.sh b/acqui.simple/z3950-daemon-launch.sh new file mode 100755 index 0000000000..0e6fab8672 --- /dev/null +++ b/acqui.simple/z3950-daemon-launch.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +# Script to start Koha background Z39.50 search daemon + +# Part of the Koha Library Mgmt System - www.koha.org +# Licensed under the GPL + +#---------------------------- +# Call this script during system startup, such as from rc.local + +# Bugs/To Do: +# Needs SysV-type start/stop options + +#---------------------------- +# User ID to run the daemon as. Don't use "root" +RunAsUser=apache + +KohaDir=/usr/local/www/koha/htdocs/cgi-bin/koha/acqui.simple +export KohaDir + +#---------------------------- +if [ ! -d $KohaDir ] +then + echo ERROR: Cannot find Koha directory $KohaDir + exit 1 +fi + +KohaZ3950Shell=$KohaDir/z3950-daemon-shell.sh + +if [ ! -x $KohaZ3950Shell ] +then + echo ERROR: Cannot find Koha Z39.50 daemon launcher $KohaZ3950Shell + exit 1 +fi + +su -s /bin/sh -c '$KohaZ3950Shell &' - $RunAsUser & diff --git a/acqui.simple/z3950-daemon-shell.sh b/acqui.simple/z3950-daemon-shell.sh new file mode 100755 index 0000000000..b51710c1a3 --- /dev/null +++ b/acqui.simple/z3950-daemon-shell.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +# Script to start Koha background Z39.50 search daemon + +# Part of the Koha Library Mgmt System - www.koha.org +# Licensed under the GPL + +#---------------------------- +# Do NOT run this script directly from system startup- +# Call z3950-daemon-launch.sh instead + +#---------------------------- + +KohaDir=/usr/local/www/koha/htdocs/cgi-bin/koha/acqui.simple +KohaModuleDir=/usr/local/koha/modules +LogDir=/var/log/koha + +#---------------------------- +LOGFILE=$LogDir/z3950-daemon-`date +%Y%m%d-%H%M`.log + +touch $LOGFILE +if [ ! -w $LOGFILE ] +then + echo ERROR: Cannot write to log file $LOGFILE + exit 1 +fi + +KohaZ3950Script=$KohaDir/processz3950queue +if [ ! -x $KohaZ3950Script ] +then + echo ERROR: Cannot find Koha Z39.50 daemon script $KohaZ3950Script + exit 1 +fi + +PERL5LIB=$KohaModuleDir +export PERL5LIB + +exec $KohaDir/processz3950queue >>$LOGFILE 2>&1