Je essaie de lancer un script shell en arrière-plan qui ne se termine pas lorsque ma fonction/processus se termine. Cependant, il semble que malgré nohup, lorsque le thread Java se termine. Le script se termine aussi.
Voici un exemple de code.
///
/// Essaie d'exécuter un script en arrière-plan
///
try {
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec("nohup sh ./runner.sh > output.txt &", new String[] {}, wrkDir);
// pr.waitFor(); // Intentionnellement non utilisé
} catch(Exception e) {
throw new RuntimeException(e);
}