Questions tagged [job-control]
43 questions
464
votes
6 answers
How can I resume a stopped job in Linux?
How can I resume a stopped job in Linux? I was using emacs and accidentally hit ctrl-z which blasted me back to the console. I can see it when I type 'jobs'
[*****]$ jobs
[1]+ Stopped emacs test_queue.cpp
Bobby
- 4,751
48
votes
4 answers
How to run programs from a linux terminal without blocking the terminal?
When I start a program from a terminal I can't use that terminal instance again until I close the program.
Is there a way to execute a program/application from a terminal without blocking the terminal until the program ends?
ueaiox
- 483
43
votes
1 answer
Continue a "ctrl-z"-ed job in background
Is it possible to continue a stopped background job in background?
I have a process running, I used ctrl-z to stop it and return to bash. If I want to continue it, there's fg command available but that brings the job back to front. Is it possible to…
Martin Tóth
- 852
8
votes
1 answer
Socat and rich terminals (with Ctrl+C/Ctrl+Z/Ctrl+D propagation)
socat - exec:'bash -li',pty,stderr,ctty -> bash: no job control in this shell
What options should I use to get fully fledged shell as I get with ssh/sshd?
I want to be able to connect the shell to everything socat can handle (SOCKS 5, UDP, OpenSSL),…
Vi.
- 17,755
6
votes
1 answer
Why doesn't disown operate on the last job if I background it?
Say I have backgrounded a process e.g. VIM with ctrl-z. Then I start an xterm using the following command xterm &> /dev/null &.
If I just type disown then I will lose my vim process. I instead have to type the PID of the xterm process to disown…
Joe
- 75
5
votes
3 answers
How do I detach from a controlling terminal from the command line?
I know about nohup and it won't do what I want:
Example:
$ nohup sleep 600 2>/dev/null >/dev/null TTY'
UID PID PPID C STIME TTY TIME CMD
me 21844 19313 0 09:37 pts/9 …
Omnifarious
- 672
4
votes
2 answers
How to start a job in the stopped state?
In bash, how can I initiate a job in a stopped state, as if I started it normally and then immediately pressed Ctrl-Z?
Or as if I had sent SIGSTOP to the process immediately, but without giving the process a chance to execute before it receives the…
nibot
- 2,147
- 4
- 15
- 18
4
votes
2 answers
How to foreground a job from another session
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)…
Bren Goforth Adelante
- 41
- 1
- 2
3
votes
2 answers
List job ids (instead process ids)
The shell command jobs supports a -p option to just get the list of process ids. Is there an easy way to get just a list of job ids? (I know there is, but I am not really a shell guy (yet)).
This would be very handy for kill, as killing a job id…
medihack
- 940
2
votes
2 answers
SLURM allows jobs using more CPUs than requested to start
The problem I am facing with SLURM can be summarized as follows. Consider a bash script test.sh that requests 8 CPUs but actually starts a job using 10 CPUs:
#!/bin/sh
#SBATCH --ntasks=8
stress -c 10
On a server with 32 CPUs, if I start 5 times…
remek
- 121
- 1
- 4
2
votes
3 answers
What risks are there in stopping and resuming processes in Linux?
Let's say I stop a process using Ctrl+Z and resume it five hours later using fg. How risky is this with regards to the proper functioning of the process?
For instance, imagine that vim is working on writing a big file to disk, and that I stop it…
haroba
- 235
2
votes
0 answers
Setting up an Ubuntu Linux scalable web video cluster
I'm in the process of setting up what I hope will be a robust and scalable video processing cluster for a website I'm creating.
Currently, I am processing video uploads with FFMPEG on the same web server on which my site is running.
This works well…
flexage
- 121
2
votes
1 answer
How can I get bash-like job control in zsh?
I want to configure zsh so that its job control behaves more like (I think) bash does by default. In particular:
When I start a background job, it is by default owned by the shell and can be controlled via its job control.
When I try to quit once,…
Andrew Ferrier
- 2,264
2
votes
2 answers
Execute background program in bash without job control
I often execute GUI programs, such as firefox and evince from shell. If I type "firefox &", firefox is considered as a bash job, so "fg" will bring it to foreground and "hang" the shell. This becomes annoying when I have some background jobs such as…
Wu Yongzheng
- 299
2
votes
1 answer
How to dynamically add tasks to a PowerShell job queue
I have created a PowerShell script that copies any e-books I download to a predetermined directory, which is periodically scanned by my e-book manager and added to my library. The script is run immediately after every download.
The problem is that…
Mavaddat Javid
- 217