Russell Coker : redirecting output from a running process

Occasionnly you have a process that’s been running for a while and you decide that it’s time to log out. Of course, you’ve forgotten to use screen so when you log out, the process dies. The post by Rusell Coker shows that it is still possible to redirect the output of a running process. The process for doing so involves looking up the file handles used by the process (in /proc//fd) and then run gdb. In gdb you call the “close” system call to the current output, then create a new handler.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.