From c82627b6a004df42453b15e926cab9d240fbf7ca Mon Sep 17 00:00:00 2001 From: tonnesen Date: Thu, 25 Jul 2002 17:34:02 +0000 Subject: [PATCH] shell scripts now parse the config file to get working directories and apache userid --- acqui.simple/z3950-daemon-launch.sh | 28 +++++++++++++++++++++++-- acqui.simple/z3950-daemon-shell.sh | 32 ++++++++++++++++++++++++++--- 2 files changed, 55 insertions(+), 5 deletions(-) diff --git a/acqui.simple/z3950-daemon-launch.sh b/acqui.simple/z3950-daemon-launch.sh index 68ae681666..55334c6f28 100755 --- a/acqui.simple/z3950-daemon-launch.sh +++ b/acqui.simple/z3950-daemon-launch.sh @@ -13,11 +13,31 @@ # Bugs/To Do: # Needs SysV-type start/stop options + +# Parse /etc/koha.conf +for line in `cat /etc/koha.conf` ; do + OIFS=$IFS + IFS='=' + set -- $line + if [ $1 = 'intranetdir' ] ; then + intranetdir=$2 + fi + if [ $1 = 'httpduser' ] ; then + httpduser=$2 + fi + if [ $1 = 'kohalogdir' ] ; then + kohalogdir=$2 + fi + IFS=$OIFS +done + + + #---------------------------- # User ID to run the daemon as. Don't use "root" -RunAsUser=apache +RunAsUser=$httpduser -KohaZ3950Dir=/usr/local/www/koha/htdocs/cgi-bin/koha/acqui.simple +KohaZ3950Dir=$intranetdir/scripts/z3950daemon export KohaZ3950Dir #---------------------------- @@ -41,6 +61,10 @@ exit #-------------- # $Log$ +# Revision 1.1.2.4 2002/07/25 17:34:02 tonnesen +# shell scripts now parse the config file to get working directories and apache +# userid +# # Revision 1.1.2.3 2002/06/26 19:56:57 tonnesen # Bug fix. Single quotes were causing $KohaZ3950Shell variable to not get # expanded diff --git a/acqui.simple/z3950-daemon-shell.sh b/acqui.simple/z3950-daemon-shell.sh index 831f61703a..3f081ac9fa 100755 --- a/acqui.simple/z3950-daemon-shell.sh +++ b/acqui.simple/z3950-daemon-shell.sh @@ -13,9 +13,31 @@ #---------------------------- -KohaZ3950Dir=/usr/local/www/koha/htdocs/cgi-bin/koha/acqui.simple -KohaModuleDir=/usr/local/koha/modules -LogDir=/var/log/koha + +# Parse /etc/koha.conf +for line in `cat /etc/koha.conf` ; do + OIFS=$IFS + IFS='=' + set -- $line + if [ $1 = 'intranetdir' ] ; then + intranetdir=$2 + fi + if [ $1 = 'httpduser' ] ; then + httpduser=$2 + fi + if [ $1 = 'kohalogdir' ] ; then + kohalogdir=$2 + fi + IFS=$OIFS +done + + + + + +KohaZ3950Dir=$intranetdir/scripts/z3950daemon +KohaModuleDir=$intranetdir/modules +LogDir=$kohalogdir #---------------------------- LOGFILE=$LogDir/z3950-daemon-`date +%Y%m%d-%H%M`.log @@ -41,6 +63,10 @@ exec $KohaZ3950Script $LogDir >>$LOGFILE 2>&1 #------------------- # $Log$ +# Revision 1.1.2.4 2002/07/25 17:34:02 tonnesen +# shell scripts now parse the config file to get working directories and apache +# userid +# # Revision 1.1.2.3 2002/06/28 17:45:39 tonnesen # z3950queue now listens for a -HUP signal before processing the queue. Z3950.pm # sends the -HUP signal when queries are added to the queue. -- 2.39.5