Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

marked as duplicate by Gilles, rozcietrzewiacz, Michael Mrozek Oct 14 '11 at 16:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.