Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [job-control]

Questions about the various ways jobs can be controlled by the shell: suspending, resuming, terminating execution etc.

7
votes
1answer
286 views

Stopped (ctrl z) process will not restart, and no longer in job list

I was running apt upgrade, when I needed the terminal, so did a ctrlz. When I tried to restart it (fg), it would not restart, because it was no-longer in the jobs list (jobs). (I Did not, run disown). ...
3
votes
1answer
69 views

Assign job number to background process by hand

Let's say I send two jobs to the background. $ sleep 77 & $ sleep 99 & Then I check my jobs $ jobs > [1] - running sleep 77 > [2] + running sleep 99 Can I control what job ...
2
votes
1answer
449 views

mpd daemon prematurely ending jobs

I am trying to configure mpirun and mpiexec to run software called Materials Studio on a 1 node, 2 processor, 12 core cluster. The submission scheme is PBS. I had everything set up properly (with some ...
1
vote
1answer
172 views

Cannot recover from sleeping tmux during SSH session

I've tried searching this on google but have been very unsuccessful so I've resorted to trying to get someone's help with this. On my local machine I do the following: $ tmux CTRL+b CTRL+z $ fg and ...
1
vote
1answer
450 views

Submitting jobs with sequential completion

If I have numerous jobs that rely on environment variables, how can I submit them sequentially? Here is my attempt that has not been working, week 6 is always submitted (and finishes) before week 5. ...
0
votes
1answer
67 views

Bash interactive shell hangs when Tmux is suspended if it was automatically started by Bash startup file

When I manually start Tmux by issuing tmux from my Bash interactive shell I can later suspend Tmux with CTRL-BZ without problems. Pressing this key combination brings me back to the parent process, i....
0
votes
1answer
72 views

How can I bring a background GUI job to the front of my desktop?

In Lubuntu 18.04, I have many background GUI jobs running in a bash shell. Among them, I have a evince process running in background: $ jobs | grep evince [29] Running evince ...
0
votes
1answer
49 views

Monitor Process Output For Scripts

Is there a way to view the console outputs of a particular script that is running in the background on a machine? Maybe using the pid or something similar. For example, to view the output of this ...
0
votes
1answer
36 views

Starting up and keeping up a process

I am having an Ubuntu box on which I am having a Haskell process (think of it as a random server process) that I built. I want to start it on boot and restart it in case it fails for whatever reason (...
0
votes
1answer
236 views

How to dynamically chose PBS queue during job submission

I run a lot of small computing jobs in remote cluster where job submission is managed by PBS. Normally in a PBS (bash) script I specify the queue that I would like to submit the job through the ...
0
votes
1answer
457 views

When executing a command, it is automatically suspended

The problem happened on one of my local machines with CentOS 6. I ssh to it from my MacBook trying to test a script, which is in /usr/local/bin. However, whenever I tried to execute the command, it is ...
3
votes
0answers
30 views

Log background jobs started in all the manually started shells?

Sometimes I accidentally killed all the background jobs in a shell, for example, because The window of a Window's program running under Wine is not in the front by default. I know I can use ...
3
votes
0answers
327 views

Why doesn't putting elinks in background and then resuming with `fg` work reliably?

The elinks program takes over the terminal to let you browse the web. But its behavior in the context of job control is wonky. If I CTRL-Z suspend an elinks session, and then try to resume it with ...
2
votes
0answers
141 views

Shell job-control: possible to “rename” a running job?

In the shell (I'm using Bash), I frequently use Ctrl-Z and fg to suspend one job and foreground another. An example would be suspending a running instance of Vim and foregrounding a previously ...
2
votes
0answers
28 views

How can I make sublime appear in the jobs list?

How can I make Sublime Text appear in the jobs list when started from the command line? For example... $ subl $ jobs ... doesn't show anything. I want to do this because my prompt is configured to ...
2
votes
0answers
48 views

why did a local crash kill my remote jobs?

Yesterday I made an interesting observation. I sit on my local office computer (Ubuntu 16.04) and I have several remote jobs (long CFD simulations) on our cluster (CentOS7) running. All jobs were ...
2
votes
0answers
318 views

Any caveats to using bash disown from a shell script as an alternative to screen?

I have a process which starts and outputs to a log file. The script which starts it launches it in a GNU screen and then follows the log with tail. The process will immediately begin writing to the ...
1
vote
0answers
29 views

List all jobs in all shell sessions (not just the current shell), by current user

I know that the jobs command only shows jobs running in current shell session. Is there a bash code that will show jobs across shell sessions (for example, jobs from another terminal tab) for ...
1
vote
0answers
61 views

Program start from interactive shell fails when shell script initiated by launcher

[This post has been edited from the original text to add the results of further investigation and get to the point more quickly -- Thanks @ctrl-alt-delor] Why does this script: #!/bin/bash read -p "...
1
vote
0answers
40 views

Killing a process when some other process is finished

Given a | b, i'd like to kill b when a is finished. b is an interactive process, which doesn't terminates when a is finished (fzf in my case), and the whole a | b is executed in a $() subshell. So ...
1
vote
0answers
33 views

Mass killing stale backgrounded jobs

$ jobs [1] Stopped emacsclient -nw components/frontend/app/views/frontend/dashboard/index.html.erb [2] Stopped emacsclient -nw components/frontend/app/views/...
1
vote
0answers
81 views

How to run GDB in backround and bring it back?

I'm writing bash scripts that launch a test scenarios: several programs that connect to each other. If something crashed, I'd like to have a GDB command line. Looks something like that: myprogram &...
1
vote
0answers
27 views

Create a file at time 't' after PBS job execution begins

I submit a PBS job for 02:00:00 hours. I need to create a file in the PBS working directory at a specified time t (say 01:30:00 hours) after the job has begun to ensure that the job terminates ...
0
votes
0answers
75 views

jobs command gives wrong output

I'm using Red Hat 6, and typing jobs gives me: [2] + 12511 12510 Running find . | xargs grep -i "string" >../a.txt Those pids don't exist, and typing fg %2 outputs: ...