The job-control tag has no wiki summary.
4
votes
1answer
46 views
Understanding when background process gets terminated
I have a script which starts a number of background processes and if works fine when called from the cmdline.
However the same script is also called during my xsession startup and additionally on ...
7
votes
1answer
2k views
How to suspend and resume proccesses like bash does
this question is a follow-up to: How to suspend and resume proccesses
I have started firefox from a bash session in gnome-terminal.
The proccess tree looks like this:
$ ps -e -o pid,ppid,cmd -H
...
3
votes
1answer
373 views
Difference between process group and job?
What's the difference between a process group and a job? If I type pr * | lpr then is it both a process group as well a job?
What exactly is the difference between a process group ID and a job ID?
...
4
votes
1answer
150 views
why do background jobs hang depending on the size of the output?
I had some stress-testing scripts that were running in parallel and they would hang after finishing and would wait for a RETURN keystroke to exit. After investigating I discovered that it is not ...
2
votes
1answer
97 views
Can I transfer running process from dead ssh [duplicate]
Possible Duplicate:
How can I disown a running process and associate it to a new screen shell?
I have started (as expected) a long copy process from ssh shell (putty) which died due to ...
2
votes
2answers
42 views
How to supress the display of previous job details?
When I run a process in the background the process ID gets displayed in the command prompt. For example:
$ gvim 1 &
[3] 9584
Now when I run another process the state of the previous one also ...
0
votes
1answer
124 views
How to make a scheduled task based on a file creation time?
The supercomputer I run my Analysis uses SGE to do the job management and requires each job duration not longer than 24 hours. And this feature is causing me quite a headache.
Sadly, I was asked to ...
1
vote
1answer
87 views
Application in terminal still running but not directly accessible [duplicate]
Possible Duplicate:
How to suspend and bring a background process to foreground
I have kind of an odd problem which I haven't encountered before. Here's what I did:
I started an ...
1
vote
3answers
152 views
How can I kill a job that was initiated in another shell (terminal window or tab)?
If I begin a process and background it in a terminal window (say ping google.com &), I can kill it using kill %1 (assuming it is job 1).
However if I open another terminal window (or tab) the ...
6
votes
2answers
255 views
Concept of controlling terminal in Unix
Can some one please explain in an easy to understand way the concept of controlling terminal in unix and unix like systems ? Is it related to a session ? If yes, then how ?
1
vote
2answers
157 views
How to Kill Difficult Task in Mac Terminal
I ran this grep:
grep -r "\-\-\-foo\-\-\-" * | grep -vi bar
For the past 5 minutes my Mac has been running hot (I can hear the fan) and I can't hit Ctrlz or x or c to kill the current task.
Even ...
5
votes
3answers
1k views
How can I kill and wait for background processes to finish in a shell script when I Ctrl+C it?
I'm trying to set up a shell script so that it runs background processes, and when I Ctrlc the shell script, it kills the children, then exits.
The best that I've managed to come up with is this. It ...
1
vote
1answer
66 views
Is it possible to disconnect a GUI program launched within vifm from vifm?
One can launch GUI programs, for example, gv or xpdf from vifm in background in vifm's command line:
:!gv %f &
However, if gv is launched by pressing Enter on a file like aPSfile.ps in vifm, ...
33
votes
6answers
10k views
How can I disown a running process and associate it to a new screen shell?
I have a running program on a SSH shell. I want to pause it and be able to unpause its execution when I come back.
One way I thought of doing that was to transfer its ownership to a screen shell, ...
2
votes
1answer
481 views
How to recover a backgrounded job from a previous shell? [duplicate]
Possible Duplicate:
How can I disown a running process and associate it to a new screen shell?
I launched a command that lasts a long time.
I had to disconnect so I moved it in the ...
2
votes
1answer
235 views
How do I detach a process from its parent? [duplicate]
Possible Duplicate:
How can I disown a running process and associate it to a new screen shell?
The problem is that the process is not a job inside of my active shell (as I've logged in from ...
1
vote
3answers
675 views
Bash wait for jobs and limit job count [duplicate]
Possible Duplicate:
Four tasks in parallel… how do I do that?
Suppose a loop invoking a command
grep -v '#' < files.m3u | sed 's/\\\\/\/\//g' | sed 's/\\/\//g' | while read line
...
8
votes
2answers
3k views
How to suspend and bring a background process to foreground
I have a process originally running in the foreground. I suspended by Ctrl+Z, and then resume its running in the background by bg <jobid>.
I wonder how to suspend a process running in the ...
5
votes
2answers
474 views
Why jobs aren't killed at logout when executed with “> /dev/null 2>&1 &”?
When you run jobs like the example below, they're killed when you logout:
$ ./job.sh &
However, when you execute them as in the below example, redirecting stdout to /dev/null and stderr to ...
1
vote
2answers
255 views
What is the real-world use of the bg command?
This is the output:
[USER@SERVER ~] ping localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.037 ms
64 bytes from localhost ...
2
votes
3answers
726 views
How to schedule something run once using anacron?
Frequently within my scripts I schedule auxiliary tasks for later in the form:
at now + 8 hours <<< "rm -f workfile.$$ >> $worklog 2>&1 "
or
at 11pm + $(date +%M) minutes ...
0
votes
0answers
102 views
Job IDs and their meaning/reference
Using Red Hat, I sent few jobs to a cluster and got "job IDs" in return. Using qstat I can see only one is running, one was canceled and the rest are still in the queue.
I wrote something like this: ...
15
votes
2answers
2k views
What is the difference between a job and a process?
What is the difference between a "job" and a "process"?
1
vote
2answers
228 views
Basic job control: stop a job, add a job onto the stack, and `fg`
Job control is probably my favorite thing about Linux. I find myself, often, starting a computationally demanding process that basically renders a computer unusable for up to days at a time, and being ...
2
votes
1answer
145 views
Why doesn't an orphan process receive signals?
I have two shell scripts: launch_job.sh and sub_job.sh.
If launch_job.sh uses the following method to run sub_job.sh:
nohup sub_job.sh &
sub_job.sh becomes an orphan, i.e. with PPID 1.
I ...
2
votes
3answers
659 views
Where do background jobs go?
From gnome-terminal I know the ability to suspend a job with C-z, and then send it to the background. When I close the terminal the process does not end. Where is the job being managed from, or is it ...
4
votes
1answer
829 views
Non-blocking bash command
Let's say I have a bash script with the following:
#!/bin/sh
gedit
rm *.temp
When I execute it using sh ./test.sh, gedit pops-up but the rm part does not run until after I close gedit.
I want the ...
2
votes
1answer
336 views
Why do backgrounded processes sometimes stop spontaneously?
Sometimes, some time after I've backgrounded a process with bg in bash, when I press Enter in the same shell to redisplay the prompt (just to check that I'm still in bash when some output from the ...
4
votes
4answers
519 views
How can I move a process into the background and also silence its output?
Say I start a process in the terminal and it sends output to standard error while it runs. I want to move the process into the background and also silence it at the same time.
Is there a way to do ...
15
votes
4answers
1k views
What happens to the output of a process that has been disowned and lost its terminal?
If I close the virtual terminal, where some process was started, does the output just go straight to /dev/null, or can it pollute memory somehow?
Can I anyhow grab the output to continue reading it at ...
2
votes
3answers
398 views
How can I turn the behavior of `gedit sOmEtHiNg & disown` into the default behavior when calling gedit from the command line?
When I gedit files from the command line, it's always locking the terminal, and I'm tired of explicitly commanding a detached process for it.
I tried to alias gedit as something like gedit $* & ...
13
votes
5answers
4k views
How can I close a terminal without killing its children (without running `screen` first)?
sometimes I run an app in the gnome-terminal, but then I suddenly have to restart gnome or something. I guess the answer to the question is also useful then I want to disconnect from SSH where ...
0
votes
1answer
376 views
safely killing a background process
I'm writing data to a pipe in a parent process. The parent process creates a background job that reads data from the pipe & write it to the screen & to a log file.
How can I know when to kill ...
4
votes
2answers
328 views
What are the virtues of multitasking with traditional job control vs Tmux/Screen?
tmux and screen let you run different processes (e.g. vim, a bash script, mysql, psql, etc) in different virtual windows. But traditional Unix job control (using CTRL-z, fg, bg, and jobs) seem to give ...
6
votes
2answers
597 views
Is it possible to transfer a running process to your terminal? [duplicate]
Possible Duplicate:
How can I pause up a running process over ssh, disown it, associate it to a new screen shell and unpause it?
It is fairly easy to disown a process, or make it run ...
64
votes
1answer
10k views
Difference between nohup, disown and &
What is the difference between
$ nohup foo
and
$ foo &
and
$ foo &
$ disown
4
votes
2answers
518 views
How to suspend and resume proccesses
In the bash terminal I can hit Control+Z to suspend any running proccess... then I can type fg to resume the proccess.
Is it possible to suspend a process if I only have it's PID? And if so, what ...
3
votes
1answer
274 views
Background task finished notification syntax
Last night, before abandoning my computer for the evening, I started a bunch of compiler jobs so they'd be ready in the morning, using make -f alpha.mak &>alpha.out &. When I came back and ...
1
vote
1answer
587 views
ant script stops, waiting for input when run in background
I'm running an ant (Java build tool) script on CentOS 5.5 that execs another java process. When I run the ant script in the background:
ant -f myfile.xml &> foo.out &
The forked process' ...

