Questions tagged [job-control]

69 questions
1
vote
2 answers

Referencing Bash jobs in other jobs

I want to reference a background Bash job in another background Bash job. Is that possible? For example, say I start a background job: $ long_running_process & [1] 12345 Now I want something to happen when that job finishes, so I can use wait: $…
me_and
  • 15,158
  • 7
  • 59
  • 96
0
votes
0 answers

How to run shell builtin commands (that must change state of shell process) in background

I have asked a similar question but after revisiting some of my code I remembered from where the main issue stemmed from, here is the link to the old question. How to implement built-in commands for my C shell with job control that change the state…
Newb
  • 181
  • 1
  • 7
0
votes
1 answer

How are shell builtin commands run in background?

Main concern/question I am implementing a simple shell written in C on with proper job control and I have some confusion as to how can a builtin command get to run in background meaning as a part of a background job? My machine: x86_64, linux…
Newb
  • 181
  • 1
  • 7
0
votes
0 answers

How to start a job in the background and keep its id and pid?

In bash, I know that if I run: my_executable arg1 arg2 & I've started a background job; and I'll also get its id and pid printed on the console, e.g.: [1] 25103 but how do I place those numbers in variables? This doesn't work: my_executable arg1…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
0
votes
2 answers

Running multiple concurrent processes in a bash script, such that if one dies it takes the other ones down with it

I want to run a series of commands concurrently such that if one of them dies they all stop.
Carl Patenaude Poulin
  • 6,238
  • 5
  • 24
  • 46
0
votes
0 answers

Queuing deep learning training Jobs on a shared server

We have multiple GPU servers for deep learning training. We train our code inside Docker containers. Today every user can log into these machines interactively and run a job. There is no restriction on job duration, or how many GPUs one can…
Shahar
  • 71
  • 9
0
votes
0 answers

Why does sysvinit force the console to be its controlling terminal for any wait-type subprocess?

I'm reading the source code init.c of sysvinit(now replaced by Systemd), in the function spawn()(where init creates subprocesses), there is a comment at line 1165: /* * In sysinit, boot, bootwait or single user mode: * for any…
Li-Guangda
  • 341
  • 1
  • 4
  • 14
0
votes
0 answers

how does the process know the SIGQUIT signal?

It's said that the SIGQUIT signal cannot be caught by process,but the process response according to the signal which it catches,so why do process can be quitted by SIGQUIT?The process even don't catch(know) the signal
Half Dream
  • 11
  • 3
0
votes
1 answer

How to track the copy activity using job control file or 0 kb files(fin) in ADF?

As i am new to ADF,need help on below scenario.I need to copy the files azure blob to SFTP.The files are as below: XYZ0034_20210320.csv XYZ0034_20210321.csv XYZ0034_20210322.csv On coping these files to SFTP,to track the copy, need to create fin…
0
votes
0 answers

Strange output on master side of a pty

I'm working on a remote shell program and I have a pty created with forkpty(). Writing from the follower-end to the leader-end works as expected, but I get strange output on the leader side when I start trying to read on the follower end. I get…
JRotelli
  • 45
  • 6
0
votes
0 answers

combine ping with a background process

What am I doing wrong here? (sleep 2; touch /tmp/ok) & && ping google.com -bash: syntax error near unexpected token `&&' I'm using bash 3.2
american-ninja-warrior
  • 7,397
  • 11
  • 46
  • 80
0
votes
2 answers

How to create a job using only default bash commands?

So, I have started studying UNIX systems about a month ago and now I have a basic question about job control How can I create a job, that will contain several processes, using only default bash commands?
Daniil Zulin
  • 5
  • 1
  • 1
  • 6
0
votes
2 answers

steps to terminate a shell

I've read the chapter about the job control in the glibc manual, but I'm wondering what to do with the remaining jobs when the shell is terminated. I suppose the following steps (following the convention of posix to handle orphaned process groups…
fusillator
  • 47
  • 6
0
votes
1 answer

Implementing shell-like job control in C

I am trying to implement simple shell in C language and i am having a hard time implementing job control. Everything online seems complicated enough and i think some simplicity is always good. So let me ask this ... After fork() is called can i…
Andrew Zacharakis
  • 351
  • 1
  • 6
  • 19
0
votes
0 answers

How to obtain and save the bash "jobspec" for a backgrounded command?

When I start a command in the background via command &, the process ID of the command can be retrieved from the variable $!. This value can be saved and used in later commands, such as kill. However, a few built-ins, notably fg require a "jobspec",…
user2864482
  • 221
  • 1
  • 4