Forum OpenACS Q&A: Re: Can't exec a command in tcl page

Collapse
Posted by Gustaf Neumann on
ok, i've installed libreoffice on a ubuntu machine and tried to reproduce Antonio's problem. As suspected in https://openacs.org/forums/message-view?message_id=4168810, the command "/usr/bin/libreoffice ..." exists with exit code "77". Google tells me that the exit code of libreoffice means roughly "insufficient permissions", but unfortunately, libreoffice gives no more details. After some more digging around, it seems that libreoffice requires write permissions on the directory to which the from the environment variable HOME points!

The environment variables are inherited from the shell from where NaviServer was started to nsd and nsproxy. When nsd is started from the startup scripts, it is not so unlikely that HOME points something like "/root", and that the userid under which the server is running has no write permissions. This might explain as well, why e.g. Neophytos got no errors, maybe since he started nsd from his userid.

The solution is to set in the startup script the environment variable HOME to something writable for the userid under which the server runs, e.g. the home directory of the server instance.

all the best
-gustaf neumann

Collapse
Posted by Bjoern Kiesbye on
Hi Antonio,

Gustaf is right with his assumption, try running the command without the --headless flag which suppresses all output including useful warnings and errors. If possible in /ds/shell in case you have developer support installed.
This is the error I got issuing the command:


ERROR:
No protocol specified
Failed to open display
[Java framework] Error in function createSettingsDocument (elements.cxx).
javaldx failed!
Warning: failed to read path from javaldx
No protocol specified
No protocol specified
mkstemp("/root/.execoooaVoik8") failed: Keine Berechtigung
while executing
"exec /usr/bin/libreoffice --convert-to xls /tmp/filedNva4p.xls /tmp/filedNva4p"
("uplevel" body line 1)
invoked from within
"uplevel 1 $script"

Collapse
Posted by Antonio Pisano on
Uau, this was subtle!
Thanks a lot to everybody for testing and finding out!

All the best

Antonio