From f31b394a039c1e8e81ba7074ee3f543d4547ac23 Mon Sep 17 00:00:00 2001 From: slef Date: Mon, 6 Oct 2003 09:10:38 +0000 Subject: [PATCH] Removing config info from z3950*sh and using C4::Context in processz3950queue (Fixed bug 39) --- import/breeding.pl | 5 ++++- misc/Install.pm | 5 +++++ z3950/processz3950queue | 2 +- z3950/z3950-daemon-launch.sh | 8 ++++---- z3950/z3950-daemon-shell.sh | 8 ++++---- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/import/breeding.pl b/import/breeding.pl index ea3062ba06..0e52625a4f 100755 --- a/import/breeding.pl +++ b/import/breeding.pl @@ -84,7 +84,7 @@ if ($uploadmarc && length($uploadmarc)>0) { while (<$uploadmarc>) { $marcrecord.=$_; } - my ($notmarcrecord,$alreadyindb,$alreadyinfarm,$imported) = ImportBreeding($marcrecord,$overwrite_biblio,$filename,$syntax); + my ($notmarcrecord,$alreadyindb,$alreadyinfarm,$imported) = ImportBreeding($marcrecord,$overwrite_biblio,$filename,$syntax,int(rand(99999))); $template->param(imported => $imported, alreadyindb => $alreadyindb, @@ -103,6 +103,9 @@ my $file; #--------------- # log cleared, as marcimport is (almost) rewritten from scratch. # $Log$ +# Revision 1.2 2003/10/06 09:10:38 slef +# Removing config info from z3950*sh and using C4::Context in processz3950queue (Fixed bug 39) +# # Revision 1.1 2003/06/04 13:46:25 tipaul # moving breeding farm import to parameters page (GUI) and to new import/ directory (code structure) # diff --git a/misc/Install.pm b/misc/Install.pm index f1e12ddb2c..02d7d9d714 100644 --- a/misc/Install.pm +++ b/misc/Install.pm @@ -1415,6 +1415,11 @@ opachtdocs=$opacdir/htdocs/opac-tmpl #MJR: does this contain any passwords? chmod 0755, "$intranetdir/scripts/z3950daemon/z3950-daemon-launch.sh", "$intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh", "$intranetdir/scripts/z3950daemon/processz3950queue"; + #MJR: generate our own settings, to remove the /home/paul hardwired links + open(FILE,">$intranetdir/scripts/z3950daemon/z3950-daemon-options"); + print FILE "RunAsUser=apache\nKohaZ3950Dir=$intranetdir/scripts/z3950daemon\nKohaModuleDir=$intranetdir/modules\nLogDir=$kohalogdir\n"; + close(FILE); + if ($> == 0) { chown((getpwnam($httpduser)) [2,3], "$etcdir/koha.conf.tmp") or warn "can't chown koha.conf: $!"; chown(0, (getpwnam($httpduser)) [3], "$intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh") or warn "can't chown $intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh: $!"; diff --git a/z3950/processz3950queue b/z3950/processz3950queue index e21df5ca5b..2997509749 100755 --- a/z3950/processz3950queue +++ b/z3950/processz3950queue @@ -19,7 +19,7 @@ if ($< == 0) { close PID; } # Get real apacheuser from koha.conf or reparsing httpd.conf - my $apacheuser='paul'; + my $apacheuser=C4::Context->config("httpduser"); my $uid=0; unless ($uid = (getpwnam($apacheuser))[2]) { die "Attempt to run daemon as non-existent or superuser\n"; diff --git a/z3950/z3950-daemon-launch.sh b/z3950/z3950-daemon-launch.sh index 5123ed49c2..22496364bd 100755 --- a/z3950/z3950-daemon-launch.sh +++ b/z3950/z3950-daemon-launch.sh @@ -14,10 +14,7 @@ # Needs SysV-type start/stop options #---------------------------- -# User ID to run the daemon as. Don't use "root" -RunAsUser=apache - -KohaZ3950Dir=/home/paul/koha.dev/koha/z3950 +. z3950-daemon-options export KohaZ3950Dir #---------------------------- @@ -41,6 +38,9 @@ exit #-------------- # $Log$ +# Revision 1.3 2003/10/06 09:10:39 slef +# Removing config info from z3950*sh and using C4::Context in processz3950queue (Fixed bug 39) +# # Revision 1.2 2003/04/29 16:48:25 tipaul # really proud of this commit :-) # z3950 search and import seems to works fine. diff --git a/z3950/z3950-daemon-shell.sh b/z3950/z3950-daemon-shell.sh index 764b1e85d9..f06600324c 100755 --- a/z3950/z3950-daemon-shell.sh +++ b/z3950/z3950-daemon-shell.sh @@ -12,10 +12,7 @@ # Call z3950-daemon-launch.sh instead #---------------------------- - -KohaZ3950Dir=/home/paul/koha.dev/koha/z3950 -KohaModuleDir=/home/paul/koha.dev/koha -LogDir=/tmp +. z3950-daemon-options #---------------------------- LOGFILE=$LogDir/z3950-daemon-`date +%Y%m%d-%H%M`.log @@ -41,6 +38,9 @@ exec $KohaZ3950Script $LogDir >>$LOGFILE 2>&1 #------------------- # $Log$ +# Revision 1.3 2003/10/06 09:10:39 slef +# Removing config info from z3950*sh and using C4::Context in processz3950queue (Fixed bug 39) +# # Revision 1.2 2003/04/29 16:48:25 tipaul # really proud of this commit :-) # z3950 search and import seems to works fine. -- 2.39.5