LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-20-2006, 03:14 PM   #1
RAdams
Member
 
Registered: May 2006
Location: Cincinnati, Ohio
Distribution: Ubuntu
Posts: 256

Rep: Reputation: 30
Recalling jobs started using nohup and "&"


If I:
Code:
nohup myjob &
Then of course "myjob" will be started and I can freely exit, perform other tasks, etc, with it still running. However, what happens when I want to bring it back to the foreground? Using "jobs" produces nothing on it, thanks to nohup, running myjobs with the intent to disown it only starts another instance of the program, no affecting the original, and fg doesn't help, because it can't recognize the process, apparently.

Code:
ps -A | grep myjob
That returns the PID of the job, but trying to bring that job to the foreground gives an error "no such job" I can kill the job using the output PID, but I want a way to bring the job back to the foreground.

How can I do this?
 
Old 12-20-2006, 03:44 PM   #2
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Use screen instead of nohup

You can start a screen session launch your application, script, whatever, then disconnect from the screen. you can later re-attach to the screen easily. .
 
Old 12-21-2006, 01:31 AM   #3
RAdams
Member
 
Registered: May 2006
Location: Cincinnati, Ohio
Distribution: Ubuntu
Posts: 256

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by farslayer
Use screen instead of nohup

You can start a screen session launch your application, script, whatever, then disconnect from the screen. you can later re-attach to the screen easily. .
I can't sudo. Is there a way around this? (I used "screen -D -RR myjob")
 
Old 12-21-2006, 07:15 AM   #4
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
simply run the screen command alone..
once screen is running you should be able to sudo inside the screen session.. and do whatever you need..
 
  


Reply

Tags
fg, foreground, jobs, nohup



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ABIT "KN8 ultra" chipset "NFORCE4" & Slack 10.2 k6_400 Slackware 5 09-06-2006 06:13 PM
"NIM thread blocked" & "Deadman Switch (DMS) close to trigger" errors sosborne Linux - Networking 1 06-28-2006 02:07 PM
cannot exit normally after "nohup blablabla > output.txt &" LQYY Linux - Newbie 1 12-14-2004 10:02 AM
Does "ac97 & RH8" imply "buy a Sound Blaster Live"? nicktoop Linux - Hardware 3 02-13-2004 08:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration