2

we are using lualatex to produce some automatically generated documents on our webserver.

We do have an Ubuntu 18.04 based server, on which Nginx runs as webserver. Nginx does not run as root, but as a different user www-data. On some websites, there is a script, which generates a LaTeX file. This LaTeX files compiles without error, if it is called manually as user root with lualatex filename.tex. Therefore I daresay, that all needed classes, styles and such are available.

If the same file is run as user www-data, using the same identical command, it stops nearly immediately after loading the LaTeX input file and calling LaTeX2e.

Ironically, lualatex sends a return value of 0, i.e. no error. There is only a log file generated, which is 12 lines long. Even the log file does not contain any errors or further hints, why lualatex did not succeed. This is the said log-file:

This is LuaTeX, Version 1.07.0 (TeX Live 2019/dev/Debian)  (format=lualatex 2019.3.12)  12 MAR 2019 16:53
 restricted system commands enabled.
**04-201901.tex
(./04-201901.tex
LaTeX2e <2018-12-01>
Lua module: luaotfload-main 2019-02-14 2.96 luaotfload entry point
Lua module: luaotfload-init 2019-02-14 2.96 luaotfload submodule / initializatio
n
Lua module: lualibs 2019-02-14 2.64 ConTeXt Lua standard libraries.
Lua module: lualibs-extended 2019-02-14 2.64 ConTeXt Lua libraries -- extended c
ollection.
Lua module: luaotfload-log 2019-02-14 2.96 luaotfload submodule / logging

Does anybody have any hints, what to do, to get lualatex running in this webserver (with restricted rights as user www-data)?

  • 4
    I don't use lualatex that much, but doesn't it need somewhere to write the otfload cache to? I don't think www-data has a home dir. Have you checked if there are any options to where to place the cache. Note that root does have a home dir – daleif Mar 18 at 17:13
  • 1
    Relevant information: github.com/sharelatex/sharelatex/issues/450 – daleif Mar 19 at 10:51
4

As suggested by daleif, luaotfload fails to find a suitable directory for it's caches because there is no writable texmf-var directory in the user directory of ẁww-data. But you can help lualatex: Instead of running

lualatex <your options> filename.tex

you can use

TEXMFCACHE=:/tmp/ lualatex <your options> filename.tex

where /tmp can be any directory the user www-data can write to.

As suggested by Ulrike Fischer in the chat, this might only be an indicator for a bigger problem: You really should add some writable path to TEXMFVAR. So a better fix would be to create some directory (I will use /some/dir/for/www-data), for which www-data has write permissions and then set the environment variable TEXMFVAR to /some/dir/for/www-data: before executing lualatex. How to do this depends on your specific invocation of lualatex because www-data probably does not even has a shell.

  • Works perfectly. Thank you very much! – Jan Mar 28 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.