Results 1 to 4 of 4
Hi, I had a job running in the background in a shell... I closed the session... Now I reconnect, I can see the process still running, but the terminal is ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 04-29-2010 #1
- Join Date
- Dec 2008
Recover Linux Job from Old Terminal Session?
Hi, I had a job running in the background in a shell... I closed the session...
Now I reconnect, I can see the process still running, but the terminal is coming up as ?
boss 19609 0.0 0.0 63880 1128 ? S 10:28 0:01 /bin/bash ./netstat.sh
Is there a way I can get control of this job again without having to just kill it off?
- 04-29-2010 #2
Normally it auto kills the job when you close the session.
But execute: jobs to get a list of running jobs.
Then type: fg # to get it back to the foreground.
- 04-30-2010 #3
- Join Date
- Apr 2009
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
It has been effectively nohup'd so killing the session didn't also kill the process. The problem is reattaching it to another session (shell), which I'm not sure how to accomplish, sorry...Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 04-30-2010 #4
This is essentially what the screen utility is for: you can leave a screen session running, logout, login later, and reconnect to screen, and it's as though you never left.
However, given the current circumstance, I don't believe that you can reconnect to that process: it is now completely inaccessible.
It might be interesting to know where its stdin and stdout are going: you can check the stdout and stdin file descriptors by running:
ls -l /proc/19609/fd
Of course, if it's /dev/null, you're out of luck.