Questions tagged [job-control]

69 questions
5
votes
2 answers

Slurm job arrays: is there a way to create a job array on slurm that starts at different times?

I have a long-running task that I want to run using a job array on slurm. The script I am currently using to submit the jobs is: #!/bin/bash #SBATCH --output=slurm-%A_%a.out #SBATCH --array=1-30 #SBATCH --ntasks=1 #SBATCH --qos=qos-15d #SBATCH…
5
votes
1 answer

How to tell bash not to issue warnings "cannot set terminal process group" and "no job control in this shell" when it can't assert job control?

To create a new interactive bash shell I call bash -i. Due to issues with my environment, bash cannot assert job control (I'm using cygwin bash in GNU emacs) and issues warnings ("cannot set terminal process group" and "no job control in this…
halloleo
  • 9,216
  • 13
  • 64
  • 122
4
votes
2 answers

Bash wait terminates immediately?

I want to play a sound after a command finishes, but only if the command took more than a second. I have this code (copied from https://stackoverflow.com/a/11056286/1757964 and modified slightly): ( $COMMAND ) & PID=$! ( sleep 1; wait -f $PID…
APerson
  • 8,140
  • 8
  • 35
  • 49
4
votes
1 answer

Why a background ssh can take over the tty from Bash?

(I'm using Bash 4.4.12 on Debian 8. Question also asked in the bash mailing list.) See the following steps to reproduce the problem. From tty #1 (pts/2): [STEP 101] # tty /dev/pts/2 [STEP 102] # ssh -o ControlMaster=yes -o…
pynexj
  • 19,215
  • 5
  • 38
  • 56
4
votes
1 answer

How to start a linux shell as from /etc/inittab

We used to have two entries in our /etc/inittab: ::sysinit:/etc/init.d/rcS ttyS0::respawn:-/bin/sh rcS is a shell script which normally starts our application, but in a special case we called "return" to terminate it which apparently lets the…
siebert
  • 155
  • 2
  • 7
3
votes
2 answers

Job Control in Linux - Want to give control back to terminal

I need some help regarding job control in linux. I run my program out of a terminal, like this $ ./test.elf & My program/process is then being run as the background process. After a while (let say 5 seconds), I type fg to put my process in the…
joeks
  • 31
  • 1
  • 2
3
votes
4 answers

Run lynx -dump in background?

I have a bash script mystuff containing a line like lynx -dump http://example.com >tmpfile and the script works fine, including this part, except when I run it non-interactively: $ ./mystuff & [1] 3712 $ jobs [1]+ Stopped The job is stopped. I…
system PAUSE
  • 37,082
  • 20
  • 62
  • 59
3
votes
2 answers

Unable to put "X" to right prompt to indicate number of jobs in Zsh

This article's code does not work for me. I have pasted all its code to my .zshrc. I have the following in my .zshrc RPROMPT='%{\[0;33m%}%1v%{\[0m%}' It should indicate whether you have jobs or not. However, it does not do that for me. I would like…
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
3
votes
1 answer

Why should I add wait after done?

I am trying to create a ping sweeper and the code never exits properly. However, when I add a wait after the done it exits and is so much faster. Why is that so? for ip in {200..254} ; do ping -c 1 "192.168.16.${ip}" |grep "bytes from" |cut -d"…
Kynan E
  • 41
  • 1
  • 4
3
votes
1 answer

How to change signal handler in child-process?

I'm writing a shell with job control. The main process should ignore stop-signals and handle SIGCHLD. Child process after fork() should set signals to SIG_DFL. The problem is that my child process ignores signals too. At the start of my program I…
rudi8848
  • 33
  • 1
  • 4
3
votes
3 answers

Is the child process in foreground or background on fork in C

When I perform a fork() in C on Linux, is the newly created child a foreground or a background process? If it is foreground by default, is there any way to force it to be created as a background process? I read through quite a few links about fork,…
Randomly Named User
  • 1,889
  • 7
  • 27
  • 47
3
votes
1 answer

why group leader cannnot able create the session in Linux

Why group leader can't able to create the session. but, other than the group leader able to create the session? #include #include #include main() { int pid; int ppid=getppid(); if ( setsid() < 0) …
Rajalakshmi
  • 681
  • 5
  • 17
3
votes
1 answer

Neovim job control example with ruby

Neovim's job-control example in :help job-control works well for bash scripts. However, I am unable to make it work for ruby. Consider the following example: set nocp set buftype=nowrite call jobstart('shell', 'bash', ['-c', 'for ((i = 0; i < 5;…
Alex
  • 1,618
  • 1
  • 17
  • 25
3
votes
3 answers

Ran multiple instances of my program in the background at the same time, what do these return signs mean?

I just kicked off a bunch of instances (17) of my program to test them running concurrently. This is what the terminal output looked like near the end. [9] Done perl test.pl -a [10] Done perl test.pl…
hmatt1
  • 4,939
  • 3
  • 30
  • 51
2
votes
0 answers

Docker Container won't stop with bash jobcontrol enabled

I have a very simple Dockerfile which extends the mssql one, as you can see below. Two additional scripts are put into the final image, one with some database setup stuff, the otherone the entrypoint.sh which I use as wrapper to first start the sql…
Zarathustra
  • 2,853
  • 4
  • 33
  • 62