Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Gentoo: User

How can I move running proces to background & out of screen?

 

 

Gentoo user RSS feed   Index | Next | Previous | View Threaded


mr.jarry at gmail

Mar 1, 2011, 10:56 AM

Post #1 of 16 (1957 views)
Permalink
How can I move running proces to background & out of screen?

Hi,
is there any way to move running (already started) process
to background, and disconnect it from screen/terminal
so that I could log off (without terminating the process)?

Sometimes I start updating my server, but it keeps running
for long time, and I would like to log out but I can not.

I know, I could have started it with:
nohup emerge -uv gcc &

But I forgot to do it that way, and now I'm sitting, watching
messages scrolling in my shell. So is there any way to do
this nohup-trick on running process?

Jarry
--
_______________________________________________________________
This mailbox accepts e-mails only from selected mailing-lists!
Everything else is considered to be spam and therefore deleted.


edwardlotus at gmail

Mar 1, 2011, 11:06 AM

Post #2 of 16 (1928 views)
Permalink
Re: How can I move running proces to background & out of screen? [In reply to]

On 03/01/11 10:56, Jarry wrote:
> Hi,
> is there any way to move running (already started) process
> to background, and disconnect it from screen/terminal
> so that I could log off (without terminating the process)?
>
> Sometimes I start updating my server, but it keeps running
> for long time, and I would like to log out but I can not.
>
> I know, I could have started it with:
> nohup emerge -uv gcc &
>
> But I forgot to do it that way, and now I'm sitting, watching
> messages scrolling in my shell. So is there any way to do
> this nohup-trick on running process?
>
> Jarry
Hi,

If i can remember correctly I think the command would be :

bg

but i don't know the whole syntax.


jarausch at igpm

Mar 1, 2011, 11:07 AM

Post #3 of 16 (1931 views)
Permalink
Re: How can I move running proces to background & out of screen? [In reply to]

On 03/01/2011 07:56:40 PM, Jarry wrote:
> Hi,
> is there any way to move running (already started) process
> to background, and disconnect it from screen/terminal
> so that I could log off (without terminating the process)?
>
> Sometimes I start updating my server, but it keeps running
> for long time, and I would like to log out but I can not.
>
> I know, I could have started it with:
> nohup emerge -uv gcc &
>
> But I forgot to do it that way, and now I'm sitting, watching
> messages scrolling in my shell. So is there any way to do
> this nohup-trick on running process?
>

You might have a look at
http://www.quantprinciple.com/invest/index.php/docs/tipsandtricks/unix/jobcontrol/

Helmut.


michael at orlitzky

Mar 1, 2011, 11:12 AM

Post #4 of 16 (1935 views)
Permalink
Re: How can I move running proces to background & out of screen? [In reply to]

On 03/01/11 13:56, Jarry wrote:
> Hi,
> is there any way to move running (already started) process
> to background, and disconnect it from screen/terminal
> so that I could log off (without terminating the process)?
>
> Sometimes I start updating my server, but it keeps running
> for long time, and I would like to log out but I can not.
>
> I know, I could have started it with:
> nohup emerge -uv gcc &
>
> But I forgot to do it that way, and now I'm sitting, watching
> messages scrolling in my shell. So is there any way to do
> this nohup-trick on running process?
>
> Jarry

See,


http://blog.nelhage.com/2011/01/reptyr-attach-a-running-process-to-a-new-terminal/

Combine with GNU Screen to achieve what you want.

(I'll do an ebuild for reptyr in the next week or so if nobody beats me
to it.)


realnc at arcor

Mar 1, 2011, 11:22 AM

Post #5 of 16 (1929 views)
Permalink
Re: How can I move running proces to background & out of screen? [In reply to]

On 03/01/2011 08:56 PM, Jarry wrote:
> Hi,
> is there any way to move running (already started) process
> to background, and disconnect it from screen/terminal
> so that I could log off (without terminating the process)?

The cleanest way to do this is not with job control but with a tool like
"screen". Install it (app-misc/screen) and start programs with it. You
also start a shell in screen. For example:

screen su - USERNAME

Now you can press CTRL+A, D to detach the screen. The programs in it
will continue running in the background. To re-attach, type "screen -r".

You can read the docs of this tool to learn about all nifty stuff you
can do with it, like opening more screen windows from the same screen
session and switch between them.


wonko at wonkology

Mar 1, 2011, 12:21 PM

Post #6 of 16 (1923 views)
Permalink
Re: How can I move running proces to background & out of screen? [In reply to]

Jarry writes:

> is there any way to move running (already started) process
> to background, and disconnect it from screen/terminal
> so that I could log off (without terminating the process)?

Ctrl-Z
bg

But I really suggest using screen for this. Then you can detach the shell
with Ctrl-A D, and re-attach later with screen -DR.

Wonko


neil at digimed

Mar 1, 2011, 1:07 PM

Post #7 of 16 (1924 views)
Permalink
Re: How can I move running proces to background & out of screen? [In reply to]

On Tue, 01 Mar 2011 14:12:31 -0500, Michael Orlitzky wrote:

> (I'll do an ebuild for reptyr in the next week or so if nobody beats me
> to it.)

It looks like somebody already has :)

% eix reptyr
* app-misc/reptyr [1]
Available versions: (~)9999
Description: Reparent a running program to a new terminal

[1] "foo-overlay" layman/foo-overlay


--
Neil Bothwick

New sig wanted good price paid.
Attachments: signature.asc (0.19 KB)


michael at orlitzky

Mar 1, 2011, 1:19 PM

Post #8 of 16 (1923 views)
Permalink
Re: How can I move running proces to background & out of screen? [In reply to]

On 03/01/11 16:07, Neil Bothwick wrote:
> On Tue, 01 Mar 2011 14:12:31 -0500, Michael Orlitzky wrote:
>
>> (I'll do an ebuild for reptyr in the next week or so if nobody beats me
>> to it.)
>
> It looks like somebody already has :)
>
> % eix reptyr
> * app-misc/reptyr [1]
> Available versions: (~)9999
> Description: Reparent a running program to a new terminal
>
> [1] "foo-overlay" layman/foo-overlay
>
>

(Does anyone commit to portage any more?)

I didn't realize there was no release tagged. I'll ask the author if he
would tag a version epsilon>0 so that it's easier to keyword.


stroller at stellar

Mar 1, 2011, 10:21 PM

Post #9 of 16 (1917 views)
Permalink
Re: How can I move running proces to background & out of screen? [In reply to]

On 1/3/2011, at 7:12pm, Michael Orlitzky wrote:
> ...
> Combine with GNU Screen to achieve what you want.

Not screen.

He's never used screen before, therefore he has no reason not to use tmux.

$ eix -I tmux
[I] app-misc/tmux
Available versions: 1.2 1.3 ~1.4 **9999 {debug vim-syntax}
Installed versions: 1.3(18:51:19 10/08/10)(vim-syntax)
Homepage: http://tmux.sourceforge.net
Description: Terminal multiplexer
$

tmux is better that screen in a variety of ways. Many of those ways are minor, however all together and in total they're significant enough. You may want to stay with screen if you have a highly-customised .screenrc and use many other machines on which you're unable to install tmux, but screen should not be recommended over tmux without a very good reason.

Stroller.


daniel.heemann at gmx

Mar 2, 2011, 11:02 AM

Post #10 of 16 (1915 views)
Permalink
Re: How can I move running proces to background & out of screen? [In reply to]

On Tuesday 01 March 2011 21:21:32 Alex Schuster wrote:
> Jarry writes:
> > is there any way to move running (already started) process
> > to background, and disconnect it from screen/terminal
> > so that I could log off (without terminating the process)?
>
> Ctrl-Z
> bg

I think to be able to detach from the terminal w/o terminating the process you
also need 'disown'.

Regards


wonko at wonkology

Mar 2, 2011, 11:55 AM

Post #11 of 16 (1905 views)
Permalink
Re: How can I move running proces to background & out of screen? [In reply to]

Daniel Heemann writes:

> On Tuesday 01 March 2011 21:21:32 Alex Schuster wrote:
> > Jarry writes:
> > > is there any way to move running (already started) process
> > > to background, and disconnect it from screen/terminal
> > > so that I could log off (without terminating the process)?
> >
> > Ctrl-Z
> > bg
>
> I think to be able to detach from the terminal w/o terminating the
> process you also need 'disown'.

You are right. I was not sure myself, so I did test this, but only with a
'sleep 60' command. It was still running when I closed the shell, so I
thought this would work. But now I learnt this is not true for emerge. Does
anyone know why?

I agree with Stroller, tmux seems like the way to go. I do not use it (yet),
because I already know screen, but it is on my to do list, after some
postings here.

Wonko


volkerarmin at googlemail

Mar 2, 2011, 12:44 PM

Post #12 of 16 (1909 views)
Permalink
Re: How can I move running proces to background & out of screen? [In reply to]

On Wednesday 02 March 2011 06:21:13 Stroller wrote:
> On 1/3/2011, at 7:12pm, Michael Orlitzky wrote:
> > ...
> > Combine with GNU Screen to achieve what you want.
>
> Not screen.
>
> He's never used screen before, therefore he has no reason not to use tmux.
>
> $ eix -I tmux
> [I] app-misc/tmux
> Available versions: 1.2 1.3 ~1.4 **9999 {debug vim-syntax}
> Installed versions: 1.3(18:51:19 10/08/10)(vim-syntax)
> Homepage: http://tmux.sourceforge.net
> Description: Terminal multiplexer
> $
>
> tmux is better that screen in a variety of ways. Many of those ways are
> minor, however all together and in total they're significant enough. You
> may want to stay with screen if you have a highly-customised .screenrc and
> use many other machines on which you're unable to install tmux, but screen
> should not be recommended over tmux without a very good reason.
>
> Stroller.

please elaborate


wonko at wonkology

Mar 2, 2011, 12:54 PM

Post #13 of 16 (1911 views)
Permalink
Re: How can I move running proces to background & out of screen? [In reply to]

Am 02.03.2011 21:44, schrieb Volker Armin Hemmann:

> On Wednesday 02 March 2011 06:21:13 Stroller wrote:

>> tmux is better that screen in a variety of ways. Many of those ways are
>> minor, however all together and in total they're significant enough. You
>> may want to stay with screen if you have a highly-customised .screenrc and
>> use many other machines on which you're unable to install tmux, but screen
>> should not be recommended over tmux without a very good reason.
>>
>> Stroller.
>
> please elaborate

He already did:
http://www.mail-archive.com/gentoo-user [at] lists/msg107371.html

I really have to give tmux a try.

Wonko


rdalek1967 at gmail

Mar 2, 2011, 2:50 PM

Post #14 of 16 (1909 views)
Permalink
Re: How can I move running proces to background & out of screen? [In reply to]

Alex Schuster wrote:
>
> You are right. I was not sure myself, so I did test this, but only with a
> 'sleep 60' command. It was still running when I closed the shell, so I
> thought this would work. But now I learnt this is not true for emerge. Does
> anyone know why?
>
> I agree with Stroller, tmux seems like the way to go. I do not use it (yet),
> because I already know screen, but it is on my to do list, after some
> postings here.
>
> Wonko
>
>

Do share. I use screen here to but plan to look into tmux. Right now,
I have no clue what it even is. I'm going to install it when I finish
the current download.

Dale

:-) :-)


wonko at wonkology

Mar 2, 2011, 3:01 PM

Post #15 of 16 (1914 views)
Permalink
Re: How can I move running proces to background & out of screen? [In reply to]

Dale writes:

> Alex Schuster wrote:

>> I agree with Stroller, tmux seems like the way to go. I do not use it (yet),
>> because I already know screen, but it is on my to do list, after some
>> postings here.

> Do share. I use screen here to but plan to look into tmux. Right now,
> I have no clue what it even is. I'm going to install it when I finish
> the current download.

See Stroller's comprehensive posting:
http://www.mail-archive.com/gentoo-user [at] lists/msg107371.html

Wonko


rdalek1967 at gmail

Mar 2, 2011, 4:48 PM

Post #16 of 16 (1907 views)
Permalink
Re: How can I move running proces to background & out of screen? [In reply to]

Alex Schuster wrote:
>
> See Stroller's comprehensive posting:
> http://www.mail-archive.com/gentoo-user [at] lists/msg107371.html
>
> Wonko
>
>

I read that but still would love to here of someone else's experience.
From that link tho, it sounds . . . interesting.

Dale

:-) :-)

Gentoo user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.