pslatex error on Solaris 8 contd

Shivkumar shivkumar at outbackwifi.com
Sat Apr 30 06:36:48 PDT 2005


hi,

Ive installed Freeside v1.5.0pre6 CVS dated 21 April 05 on a Solaris 8
sun-sparc machine.

Ive got all modules working fine (ive even got the Verisign PayflowPro
module working (test)), except this one thats giving me sleepless nights.
Id be doubly grateful if you all can point me in the right direction:

i am getting pslatex failed errors when i either view the invoice or view
the typeset invoice.
the httpsd_error log shows:
sh: pslatex : not found
I would assume that this meant that the path to the pslatex executable was
not available to the script.
However, when I run this small script (extracted from cust_bill.pm) in a
separate file through the browser, the pdf file gets made in the
/usr/local/etc/freeside/cache directory!

---start script (test_pslatex.pl)-----:

#!/usr/local/bin/perl
use String::ShellQuote;

my $dir= "/usr/local/etc/freeside/cache.DBI:Pg:dbname=freeside";
chdir($dir);
my $file = "invoice.2.tbcRUEyP";
my $sfile = shell_quote $dir."/".$file;

print "content-type: text/plain\n\n";
print "$sfile\n\n";
print $ENV{'PATH'};
system("pslatex $sfile.tex >/dev/null 2>&1") == 0
or die "pslatex $sfile failed: $!";
system(
    "dvips -q -t letter -f $sfile.dvi ".
    "| gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$sfile.pdf ".
    "     -c save pop -"
  ) == 0
    or die "dvips | gs failed: $!";

---end script-----

the output of this script on the browser window is:
'/usr/local/etc/freeside/cache.DBI:Pg:dbname=freeside/invoice.2.tbcRUEyP'

/usr/local/bin:/usr/bin:/bin:/usr/ccs/bin:/usr/sbin:/usr/local/teTeX/bin/sparc-sun-solaris2.8

which shows that the path to the pslatex binary is available to the script
which gets executed as the freeside user.

now if i run the
https://69.107.154.181/freeside/view/cust_bill-pdf.cgi?3.pdf script by
clicking on the 'view typeset invoice' link,
i get this output
error:  pslatex
/usr/local/etc/freeside/cache.DBI:Pg:dbname=freeside/invoice.3.bV95eIqh.tex
failed: No such file or directory at
/usr/local/lib/perl5/site_perl/5.8.6/FS/cust_bill.pm line 1448.

context:  ...
1444:  #! LaTeX Error: Unknown graphics extension: .eps.
1445:
1446:  my $sfile = shell_quote $file;
1447:
1448:  system("pslatex $sfile.tex >/dev/null 2>&1") == 0
1449:  or die "pslatex $file.tex failed: $!";
1450:
1451:  system("pslatex $sfile.tex >/dev/null 2>&1") == 0
1452:  or die "pslatex $file.tex failed: $!";
...

code stack:  /usr/local/lib/perl5/site_perl/5.8.6/FS/cust_bill.pm:1448
/usr/local/apache/htdocs/freeside/view/cust_bill-pdf.cgi:12
/usr/local/apache/htdocs/freeside/autohandler:1


and the funny thing is the test script now shows the follwing output:

'/usr/local/etc/freeside/cache.DBI:Pg:dbname=freeside/invoice.2.tbcRUEyP'

/usr/local/bin:/usr/bin:/usr/ucb:/bin

and I get
sh: pslatex : not found
in the httpsd_error log

when I go back to freeside main menu by hitting the back button on the
browser!!!

so my q is how does the path get changed for the system calls?
This does not happen on my other server which is a Debian Sarge 3

I have used the PassEnv directive in httpsd
so when i restart apache and again run the test script, the original PATH
is restored and it gets executed










-- 
Regards,
Shivkumar
Outback Wifi
F-4/7, Vasant Vihar
New Delhi 110057
India
ph +91-9312878533






More information about the freeside-users mailing list