I have done this to that programe: ctrl-z disown -h %1 bg 1
then logout,
Is it still possible for me to see what that programe outputs to stdout now?
ctrl-z the program
bg % so it wont die when you logoff
screen retty $Pid
will attach the running program into screen
duplicate question of how to replace the "disown" with "screen"?
General screen
usage:
user@machine:/home/user$ screen bash -l
user@machine:/home/user$ long_running_program
<user presses ctrl-a d to detach from the screen session>
user@machine:/home/user$ screen -ls
There is a screen on:
58356.ttys000.machine (Detached)
1 Socket in /tmp/uscreens/S-user.
user@machine:/home/user$ screen -r 58356
<user is connected to the original screen session>
Don't know if it will help you, but you could call "gdb" and change the file descriptor. See http://blog.tridgell.net/?p=4
This should be possible..
Yes, this is an old question, but I'm sure others have been in the same position. This gentleman's gdb script wizardry allows one to "repoint" file descriptors in running processes. It can be done per-process by PID, or will call fuser to find all processes using the file. I also just confirmed it works on /dev/pty/*, so STD(IN,OUT,ERR) are possible as well.
http://groups.google.com/group/alt.hackers/browse_thread/thread/d1932c31ce43bd4c
.
Same as the answer I posted here: how to replace the "disown" with "screen"?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With