Page 1 of 1

exec empty ret

Posted: Tue Jan 29, 2019 12:02 pm
by aitchon
Why is $ret from this command empty?

<exec nobr "/usr/bin/java" "-version"></exec>

I even tried running as root, but get exit code 127. I verified that /usr/bin/java exists.

exec empty ret

Posted: Tue Jan 29, 2019 12:56 pm
by Kai
If you're running this in a Vortex script in a web request, the web server's environment may not allow execution of subprocesses in the restricted CGI environment.

What do $ret.stderr and $ret.err contain after this statement? What is written to vortex.log?

exec empty ret

Posted: Tue Jan 29, 2019 1:16 pm
by aitchon
The script is being run from the command line. ret.err is empty, but ret.stderr returns what I expected in $ret:

openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

vortex.log is empty

exec empty ret

Posted: Tue Jan 29, 2019 1:20 pm
by John
That just means that java is outputting the version information to the standard error handle rather than standard output. On the command line you typically see both without distinction between them.