As root, is there a way to foreground (fg) a job within a root session that is in the foreground of another root session? If the job in the other session has to be put in the background (using bg) first, then is there a way (from another session) to bg a job so as to be able to fg it elsewhere?
Asked
Active
Viewed 5,622 times
2 Answers
3
You can suspend a currently running process by sending SIGSTOP (kill -STOP) to it, and resume another with kill -CONT (SIGCONT). It will still be part of the same session, though – you cannot move it, AFAIK.
grawity
- 501,077
3
You could use screen utility for accomplishing what you are trying to do.
Or you could use nohup command when initiating a job and look at the log from any session. If you do not provide an output file name, then nohup.out will be used. Here is an example:
nohup script.sh > logfile.log &
dabest1
- 1,002