running as apache user does not work, why?

mario chiari ml at mariochiari.net
Fri Aug 16 09:39:05 CEST 2019


Hi

thanks for the perceptive replies.


On Fri, 2019-08-16 at 00:43 +0200, Zdenek Wagner wrote:
> Hi,
> 
> remember, that "apache" is not a normal user. Unless you have modified
> /etc/passwd, it has no login shell. 

I have  >> apache:x:48:48:Apache:/usr/share/httpd:/sbin/nologin << and do not
think to modify it

> It will not read settings in shell
> startup files used by normal users and root, hence it tries to use the
> TeX distribution from Fedora packages, not TeX Live from TUG, as you
> can see from the paths. 
Ok

> In addition, it is not sufficient to define
> environment variables in such a way that sudo will know about them.
> When you later try to run TeX from a script invoked by the Apache
> server, 
Yes, that is what I need

> they will not work unless you define them in you config file
> by SetEnv or PassEnv directives. 
How, where?

> It is better not to run TeX directly
> but use a script which will define the necessary variables including
> PATH and then call TeX.
Yes.
I have a .php script

<?php
......

$test2 = `/usr/local/texlive/2019/bin/x86_64-linux/pdflatex  --interaction
batchmode myFile.tex`;
$test21 = `sudo -u root /usr/local/texlive/2019/bin/x86_64-
linux/biber   myFile.bib`;
$test22 = `/usr/local/texlive/2019/bin/x86_64-linux/pdflatex  --interaction
batchmode myFile.tex`;
.....
?>

How would you define the necessary variables therein?

Note: everything works fine, even from within the .php script, if I call a older
2016 version of texlive.

thanks
mario




> 
> Zdeněk Wagner
> http://ttsm.icpf.cas.cz/team/wagner.shtml
> http://icebearsoft.euweb.cz
> 
> čt 15. 8. 2019 v 21:13 odesílatel David Carlisle
> <d.p.carlisle at gmail.com> napsal:
> > It looks like the path for that account does not include
> > /usr/local/texlive/2019/bin/x86_64-linux (or at least that is not before
> > /usr/local/bin)
> > 
> > David
> > 
> > 
> > On Thu, 15 Aug 2019 at 19:47, mario chiari <ml at mariochiari.net> wrote:
> > > Hi
> > > 
> > > I try to run the following from terminal:
> > > 
> > > >  sudo -u apache  /usr/local/texlive/2019/bin/x86_64-
> > > > linux/pdflatex  myFile.tex
> > > 
> > > I get the following error
> > > 
> > > LaTeX Font Warning: Font shape `T2A/wncyr/m/n' undefined
> > > (Font)              using `T2A/cmr/m/n' instead on input line 3.
> > > 
> > > 
> > > kpathsea: Running mktextfm larm1000
> > > /usr/share/texlive/texmf-dist/web2c/mktexnam: Could not map source
> > > abbreviation  for larm1000.
> > > /usr/share/texlive/texmf-dist/web2c/mktexnam: Need to update ?
> > > mkdir: cannot create directory ‘././usr/share/httpd/.texlive2018’:
> > > Permission
> > > denied
> > > mktextfm: mktexdir /usr/share/httpd/.texlive2018/texmf-
> > > var/fonts/tfm/unknown/unknown failed.
> > > kpathsea: Appending font creation commands to missfont.log.
> > > ! Font T2A/cmr/m/n/10=larm1000 at 10.0pt not loadable: Metric (TFM) file
> > > not fo
> > > und.
> > > <<<
> > > 
> > > Is kpathsea trying to call /usr/share/texlive/.../ instead of
> > > /usr/local/texlive/2019/.../? Why?
> > > I do not understand why it tries to write into  ‘././usr/share/httpd/;
> > > also
> > > why .texlive2018  instead of .texlive2019?
> > > 
> > > 
> > > Everything works fine if I run it as root (I am on a Fedora 29 machine).
> > > Help is welcome
> > > 
> > > thanks cheers
> > > mario
> > > 
> > > 
> > > ps this is an old issue of mine, with a new  glitch.
> > > 



More information about the tex-live mailing list