I'm using Mono on a Linux system to launch a process. Occassionaly the parent process dies an untimely death, and takes the child process with it, but I need to keep the child process going.
In testing, every variation of System.Diagnostics.Process.Start() I've tested will cause it's child process to die when I kill the parent process.
is there some setting I'm missing, or another way to accomplish this?
As a test, this:
System.Diagnostics.Process.Start(new ProcessStartInfo("journalctl", "-f") {UseShellExecute = true});
this:
System.Diagnostics.Process.Start(new ProcessStartInfo("journalctl", "-f") {UseShellExecute = false});
and this:
System.Diagnostics.Process.Start("journalctl", "-f");
will launch 'journalctl' ('ps -aef' indicates correct parent-child IDs) and when I kill the parent process, 'journalctl' also dies.
Should I launch a script that has uses nohup and disown for the the child process?