0

I am working on Unix systems and have a GUI application that in turn spawns couple of other processes. These processes required to run independent of the parent process (GUI application). Basically, when the GUI is crashed or closed, the child processes should keep running.

One approach could be to demonize the processes. Here is an useful answer that runs a process in background through double forking.

What I would like to ask is, if it is possible to have the same result using terminal-multiplexer, like tmux or GNU-Screen. I am not sure how these terminal-multiplexers creates and maintain shell sessions but the basic idea would be to start the GUI application, that uses 'tmux' or 'screen' to creates a shell session and run child processes within the shell session. Would it make the child process independent of parent processes?

Thanks in advance!

1 Answers1

0

It should work if your GUI runs something like this:

tmux new-session -s test -d vim

which creates a detached session named "test", running the "vim" command. The session can then be attached with:

tmux attach-session -t test
Unknown
  • 5,722
  • 5
  • 43
  • 64