Im trying to run a shell script in the background that does not terminate when my function/process end. However it seems that despite nohup, when the java thread ends. So does the script.
Below is sample code.
///
/// Tries to run a script in the background
///
try {
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec("nohup sh ./runner.sh > output.txt &", new String[] {}, wrkDir);
// pr.waitFor(); // Intentionally not using
} catch(Exception e) {
throw new RuntimeException(e);
}