From 4184688893b7c09f913692533828bfd9bfc4179d Mon Sep 17 00:00:00 2001 From: tonnesen Date: Wed, 26 Jun 2002 18:57:02 +0000 Subject: [PATCH] Fixed hard coded directories in z3950 shell scripts, and moved z3950 scripts to scripts directory in tarball. --- buildrelease | 3 +++ installer.pl | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/buildrelease b/buildrelease index 41ed3fbef1..1fd4ccaad8 100644 --- a/buildrelease +++ b/buildrelease @@ -215,6 +215,9 @@ system("mv $rootdir/intranet-cgi/tkperl $rootdir/scripts"); system("mv $rootdir/intranet-cgi/translator $rootdir/scripts"); system("mv $rootdir/intranet-cgi/updater $rootdir/scripts"); system("mv $rootdir/intranet-cgi/misc $rootdir/scripts"); +system("mv $rootdir/intranet-cgi/acqui.simple/processz3950queue $rootdir/scripts"); +system("mv $rootdir/intranet-cgi/acqui.simple/z3950-daemon-launch.sh $rootdir/scripts"); +system("mv $rootdir/intranet-cgi/acqui.simple/z3950-daemon-shell.sh $rootdir/scripts"); # Remove extraneous files from intranet-cgi diff --git a/installer.pl b/installer.pl index 6b10991f7a..80d851c01f 100644 --- a/installer.pl +++ b/installer.pl @@ -698,6 +698,75 @@ Press to continue... } +print qq| + +SETTING UP Z39.50 DAEMON +======================== +|; + +my $kohalog='/var/log/koha'; +print "Directory for logging by Z39.50 daemon [$kohalogdir]: "; +chomp($input = ); +if ($input) { + $kohalogdir=$input; +} + +unless (-e "$kohalogdir") { + my $result = mkdir 0770, "$kohalogdir"; + if ($result==0) { + my @dirs = split(m#/#, $kohalogdir); + my $checkdir=''; + foreach (@dirs) { + $checkdir.="$_/"; + unless (-e "$checkdir") { + mkdir($checkdir, 0775); + } + } + } +} +chmod 0770, $kohalogdir; +chown((getpwnam($httpduser)) [2,3], $kohalogdir) or warn "can't chown $kohalogdir: $!"; + +# LAUNCH SCRIPT +my $newfile=''; +open (L, "scripts/z3950-daemon-launch.sh"); +while () { + if (/^RunAsUser=/) { + $newfile.="RunAsUser=$httpduser\n"; + } elsif (/^KohaZ3950Dir=/) { + $newfile.="KohaZ3950Dir=$kohadir/scripts/\n"; + } else { + $newfile.=$_; + } +} +close L; +system("mv scripts/z3950-daemon-launch.sh z3950-daemon-launch.sh.orig"); +open L, ">scripts/z3950-daemon-launch.sh"; +print L $newfile; +close L; + +# SHELL SCRIPT +$newfile=''; +open (S, "scripts/z3950-daemon-shell.sh"); +while () { + if (/^KohaModuleDir=/) { + $newfile.="KohaModuleDir=$kohadir/modules\n"; + } elsif (/^KohaZ3950Dir=/) { + $newfile.="KohaZ3950Dir=$kohadir/scripts\n"; + } elsif (/^LogDir=/) { + $newfile.="LogDir=$kohalogdir\n"; + } else { + $newfile.=$_; + } +} +close S; + +system("mv scripts/z3950-daemon-shell.sh z3950-daemon-shell.sh.orig"); +open S, ">scripts/z3950-daemon-shell.sh"; +print S $newfile; +close S; + + #RESTART APACHE print "\n\n"; print qq| -- 2.39.5