[SOLVED] Trying to bring back a disowned process to foreground
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Trying to bring back a disowned process to foreground
I had started a process through ssh and then i did 'cntrl+Z' and 'bg' and 'disown' before closing the ssh connection. That process kept running in the background in the other machine and now i want to bring it back to foreground in that machine. However running the command 'fg %<process_id>' is not helping. What do i DO!?
Screen is a full-screen window manager that multiplexes a physical terminal between several processes
(typically interactive shells). Each virtual terminal provides the functions of a DEC VT100 terminal
and, in addition, several control functions from the ISO 6429 (ECMA 48, ANSI X3.64) and ISO 2022
standards (e.g. insert/delete line and support for multiple character sets). There is a scrollback
history buffer for each virtual terminal and a copy-and-paste mechanism that allows moving text
regions between windows.
When screen is called, it creates a single window with a shell in it (or the specified command) and
then gets out of your way so that you can use the program as you normally would. Then, at any time,
you can create new (full-screen) windows with other programs in them (including more shells), kill
existing windows, view a list of windows, turn output logging on and off, copy-and-paste text between
windows, view the scrollback history, switch between windows in whatever manner you wish, etc. All
windows run their programs completely independent of each other. Programs continue to run when their
window is currently not visible and even when the whole screen session is detached from the user's
terminal. When a program terminates, screen (per default) kills the window that contained it. If
this window was in the foreground, the display switches to the previous window; if none are left,
Just a few links to aid you to gaining some understanding;
I just created this account to put a reply to this thread. and Hello Linuxquestions!
I've herd about there is some programs that can ability to get back the running, and disowned processes to another terminal emulating window like putty window or another ssh window.
I think reptyr is one of them. https://github.com/nelhage/reptyr
I'm interest about this. I tried but failed. really don't know how to use this program.
I googled, there were many tutorials but they didn't helped me to understand.
can some1 tell me some steps to get a running process back to the window via this programm?
retty pid (i dnt knw how to use it correctly)
screen is not the answer what um looking for.
because I don't wanna make another 1 more running process to do this.
Last edited by Domination; 04-18-2013 at 02:04 AM.
The problem is that the process never stays "disowned". All disowning a process does is give the process to pid 1.
So once you disown a process it then belongs to init - and you can't get it back for any reason.
stdin/stdout/stderr are disconnected from the controlling terminal (the act of disowning it) unless they have been redirected to/from a file. Once disconnected, the data stream is closed...
What "screen" does is create a socket for communications with the screen server... which may be disconnected. The socket remains for "screen" (operating as a client) can connect to. Any processes started by screen remain attached to the pseudo terminal(s) allocated for use as a terminal. The screen utility (server side) then manages those terminal sessions.