I have a script driver that controls a job line that can run jobs in parallel or sequentially based on a dependency graph. For instance:
Job Predecessors A null BA CA DB ED, C FE
The driver starts A in the background and waits for it to complete, suspending the use of bash's built-in suspend . Upon completion, task A sends the SIGCONT driver, which then starts B and C in the background and pauses it again, etc.
The driver has set -m , so job control is enabled.
This works great when the driver itself starts in the background. However, when the driver is invoked in the foreground, the first call to pause work is fine . the second call seems to turn into " exit ", which says " There are stopped jobs ", but does not exit . the third call to pause also turns into " exit " and kills the driver and all children [since it must be taken into account that this is the second converted call to ' exit '].
And this is my question: Is this the expected behavior? If so, why and how do I get around it?
Thanks.
Code fragments below:
Driver:
for step in $(hash_keys 'RUNNING_HASH') do proc=$(hash_find 'RUNNING_HASH' $step) if [ $proc ] then
Job:
#
source share