Possible duplicate:Redirect STDERR / STDOUT of the process AFTER it starts using the command line?
Is there a way in Bash to capture / redirect the output (and stderr?) Of a process after it starts?
Use of gdb is possible. The question has already been answered in this thread .
No, at least not very reliable.
When a process forks, it has (at least) its first three file descriptors, ordered by the parent before fork (), so it inherits them.
fork, , , , .
, , . , (, gdb), . . , , , , .