ubuntu-14.04opencpulatexmk

Compile .tex file with latexmk with www-data user (opencpu)


i run opencpu 1.5 [1] on ubuntu 14.04 server. My R-Package create an .tex file an trigger a system call to compile the pdf file with latexmk.

    system("latexmk -xelatex -interaction=batchmode mylatex.tex")

On ubuntu 12.04 LTS it works fine.

This not working after updating from ubtuntu 12.04 LTS to 14.04 LTS. The process is running as www-data user. With other system-users i can compile the .tex files with latexmk.

My LaTeX Version: TexLive 2016 full

Here the out from:

print(Sys.getenv())

...
APACHE_RUN_GROUP        www-data
APACHE_RUN_USER         www-data
HOME                    /tmp/ocpu-temp
PATH                   /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/texlive/current
...

Any ideas?

Thx!

--

[1] https://www.opencpu.org/


Solution

  • I found this entry in my log file:

     apparmor="DENIED" operation="exec" profile="opencpu-exec" 
         name="/usr/local/texlive/2016/texmf-dist/scripts/latexmk/latexmk.pl" pid=4305 comm="sh" requested_mask="x" denied_mask="x" fsuid=33 ouid=0
    

    Then I added the following line:

    /usr/local/texlive/2016/texmf-dist/scripts/latexmk/latexmk.pl ux,
    

    in this /etc/apparmor.d/opencpu.d/custom file.

    This has solved my latexmk issue.

    Thx to Jeroen