Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How do I resume a suspended process in a *different* shell?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
fRIOUX
n00b
n00b


Joined: 13 Jul 2005
Posts: 21

PostPosted: Thu Aug 17, 2006 5:38 am    Post subject: How do I resume a suspended process in a *different* shell? Reply with quote

Often I have the problem of starting a large emerge and get halfway through and want to log out of X, or I have run the emerge in the console and I want to see the status in X. But I can't because I didn't think ahead and start the thing in a screen session. Is there a way that I can suspend (Ctrl-Z) and then resume (fg %1) from a screen session? I have wanted to know how to do something like this for a long time, so if someone know's fill me in on the secret!
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Thu Aug 17, 2006 6:11 am    Post subject: Reply with quote

not that I know, but you can still stop it with 'CTRL+C' then when you're ready again, run 'emerge --resume'


just be aware, that you should avoid stopping emerge process when it's copying/deleting files to the filsystem
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Thu Aug 17, 2006 7:39 am    Post subject: Reply with quote

fRIOUX: But just to be sure not to break anything, you should do the same I did in the past: I changed by personal habits. :D Nowadays ALWAYS when I touch emerge -- even if just emerge --sync, I start it in screen session. Just in case.
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
beatryder
Veteran
Veteran


Joined: 08 Apr 2005
Posts: 1138

PostPosted: Thu Aug 17, 2006 8:05 am    Post subject: Reply with quote

emerge screen

then learn how to use it :D
_________________
Dont make it idiot proof, make it work.
Neucode.org
<suppressed key>
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Thu Aug 17, 2006 9:35 am    Post subject: Reply with quote

you obviously did not read his post... :roll:

Last edited by truc on Thu Aug 17, 2006 2:09 pm; edited 1 time in total
Back to top
View user's profile Send private message
nevynxxx
Veteran
Veteran


Joined: 12 Nov 2003
Posts: 1123
Location: Manchester - UK

PostPosted: Thu Aug 17, 2006 1:34 pm    Post subject: Reply with quote

1) Create a script that starts a screen session, then runs the emerge within it, then alias that script to emerge....

2) set your shell to the screen executable...

3) set your bash.rc to start screen last....

Any of those sound reasonable?
_________________
My Public Key

Wanted: Instructor in the art of Bowyery
Back to top
View user's profile Send private message
beatryder
Veteran
Veteran


Joined: 08 Apr 2005
Posts: 1138

PostPosted: Thu Aug 17, 2006 2:19 pm    Post subject: Reply with quote

truc wrote:
you obviously did not read his post... :roll:


Correct, my bad :oops:
_________________
Dont make it idiot proof, make it work.
Neucode.org
<suppressed key>
Back to top
View user's profile Send private message
fRIOUX
n00b
n00b


Joined: 13 Jul 2005
Posts: 21

PostPosted: Thu Aug 17, 2006 6:37 pm    Post subject: Reply with quote

nevynxxx wrote:
1) Create a script that starts a screen session, then runs the emerge within it, then alias that script to emerge....

2) set your shell to the screen executable...

3) set your bash.rc to start screen last....

Any of those sound reasonable?


Yeah, that's what I generally do really. I have been using one computer all summer and when a term opens it automatically runs 'screen -x main' on start, but I was just working on a different computer and I hadn't started in a screen session. Thanks for the help anyway. I was just really wondering if there was a UNIXy, configless way to fix this issue if I didn't do things right in the beginning.
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Thu Aug 17, 2006 6:38 pm    Post subject: Reply with quote

fRIOUX wrote:
I was just really wondering if there was a UNIXy, configless way to fix this issue if I didn't do things right in the beginning.


I wonder if retty could help you in those cases.
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
wizkid
n00b
n00b


Joined: 23 Sep 2004
Posts: 54

PostPosted: Thu Aug 17, 2006 10:26 pm    Post subject: Reply with quote

I always just use screen. It's easier, and if it's a big emerge, I can ssh in and monitor it from work, capture a log file, etc. It's your best option.

Screen will spoil ya.
_________________
Linux Rules --- NT (And XP) Drools
Back to top
View user's profile Send private message
hegga
Apprentice
Apprentice


Joined: 04 Jun 2003
Posts: 210
Location: Norway

PostPosted: Fri Oct 05, 2007 1:28 pm    Post subject: move job inside screen Reply with quote

I've started a job outside screen, but have found out that it's going to take a while to finish
and want to move inside a screen shell.

Does anyone know how I can achieve that?
_________________
hegga
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Sat Oct 06, 2007 7:21 am    Post subject: Reply with quote

Merged the above post.
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Sun Oct 07, 2007 2:01 am    Post subject: Reply with quote

Do you have to have to move it to screen?

If you just didn't want to leave the xterm open, you could probably suspend the emerge process, background it and then disown it.
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum