2

Possible Duplicate:
How can I disown it a running process and associate it to a new screen shell?

I started a process from one ssh session to a target machine T. The system from which I ssh'ed, A, hung. I checked using ssh from another machine, B that the process is still running on T. Now I want to be able to restart A without affecting the run of the process on T. I had forgotten to use screen or byobu etc. Since A is currently hung, I cant even do a ctrl z and disown or something. What can be done ? I dont want the process to terminate but I want to be able to restart A which has hung.

AnkurVj
  • 1,003

2 Answers2

1

You might modify the file descriptors attached to that process but, in general, doing so requires some a bit dirty tricks to be used. The whole concept is quite nicely covered in this question. Whether running a program like retty will succeed in your case, depends on how rigorously the process monitors the status of its own file descriptors.

1

You could try to send a SIGCONT signal to the process, but as rozcietrzewiacz mentions, you may need to do some trickery with file descriptors if the process requires terminal access.

kill -CONT pid

If this still comes up as T, then it likely needs user input.

Arcege
  • 22,536