February 27, 2008

Russell Coker : redirecting output from a running process

Filed under: linux — @ 14:15

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.

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment