Issue
when I'm executing shell script through java Runtime.exec(), where do I find nohup.out file.
String command = "nohup ksh /home/xyz/script.ksh &";
Runtime rtime=Runtime.getRuntime();
rtime.exec(command);
Solution
nohup
only writes the output to a file if it's connected to a terminal. This won't be the case when you invoke it through exec
, so the output will be written to the sub-process's stdout (which you can get through getInputStream
). No nohup.out
will be created anywhere.
Answered By - sepp2k