From b112d35b7a6d33bacf61f1e3a9a355f87e7fab70 Mon Sep 17 00:00:00 2001 From: tonnesen Date: Tue, 3 Sep 2002 21:15:35 +0000 Subject: [PATCH] Removing hard coded values for apache user and pid-file directory (note that these hard coded values were never actually used unless processz3950queue was run as root in any case). --- acqui.simple/processz3950queue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/acqui.simple/processz3950queue b/acqui.simple/processz3950queue index 68cc91bd89..1aacfc4c6d 100755 --- a/acqui.simple/processz3950queue +++ b/acqui.simple/processz3950queue @@ -8,15 +8,19 @@ use C4::Output; use Net::Z3950; +my $configfile=configfile(); + if ($< == 0) { # Running as root, switch privs - if (-d "/var/run") { + my $kohalogdir=$configfile->{'kohalogdir'}; + if (-d $kohalogdir) { open PID, ">/var/run/processz3950queue.pid"; print PID $$."\n"; close PID; } # Get real apacheuser from koha.conf or reparsing httpd.conf - my $apacheuser='www-data'; + my $apacheuser=$configfile->{'httpduser'}; + ($apacheuser) || ($apacheuser='www-data'); my $uid=0; unless ($uid = (getpwnam($apacheuser))[2]) { die "Attempt to run daemon as non-existent or superuser\n"; @@ -24,7 +28,6 @@ if ($< == 0) { $>=$uid; $<=$uid; } - my $dbh=C4Connect; @@ -35,7 +38,7 @@ $SIG{CHLD}='reap'; $SIG{HUP}='checkqueue'; -my $logdir=$ARGV[0]; +my $logdir=$configfile->{'kohalogdir'}; open PID, ">$logdir/processz3950queue.pid"; print PID $$."\n"; -- 2.39.5