# Some exit codes \>0 from a child process still report a job exit code of 0

**URL:** <https://community.openpbs.org/t/some-exit-codes-0-from-a-child-process-still-report-a-job-exit-code-of-0/3551>\
**Category:** Users/Site Administrators\
**Created:** [May 18, 2023, 9:47pm UTC](https://community.openpbs.org/t/some-exit-codes-0-from-a-child-process-still-report-a-job-exit-code-of-0/3551 "2023-05-18T21:47:13Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chase](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@Chase](https://community.openpbs.org/u/Chase)\
**Post date:** [May 18, 2023, 9:47pm UTC](https://community.openpbs.org/t/some-exit-codes-0-from-a-child-process-still-report-a-job-exit-code-of-0/3551/1 "2023-05-18T21:47:13Z")

</div>

I have jobs that in some cases are finishing with qstat reporting an exit status of 0 even though a child process from a Singularity container that provided the job environment reported an exit code \>=1. My users are asking me to make it so qstat recognizes when a child process fails.

I have some experimentation in mind I can try. Before I do I figured I’d ask this community for any experiences with this situation. Please share your thoughts.

Basic Info:

- openpbs 20.0.1
- Ubuntu 18.04
- Singularity 3.9.9

---

<div class="post-metadata">

**Author:** ![Chase](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@Chase](https://community.openpbs.org/u/Chase)\
**Post date:** [May 18, 2023, 11:33pm UTC](https://community.openpbs.org/t/some-exit-codes-0-from-a-child-process-still-report-a-job-exit-code-of-0/3551/2 "2023-05-18T23:33:41Z")

</div>

It appears the qsub argument “-sync y” may be what I need. However, that argument appears it may be depreciated.

---

<div class="post-metadata">

**Author:** ![agurban](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/agurban/32/67_2.png) [@agurban](https://community.openpbs.org/u/agurban)\
**Post date:** [May 19, 2023, 1:37am UTC](https://community.openpbs.org/t/some-exit-codes-0-from-a-child-process-still-report-a-job-exit-code-of-0/3551/3 "2023-05-19T01:37:19Z")

</div>

Which qsub are you looking at?

---

<div class="post-metadata">

**Author:** ![Chase](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@Chase](https://community.openpbs.org/u/Chase)\
**Post date:** [May 19, 2023, 2:09am UTC](https://community.openpbs.org/t/some-exit-codes-0-from-a-child-process-still-report-a-job-exit-code-of-0/3551/4 "2023-05-19T02:09:35Z")

</div>

I’m not following you. What do you mean which qsub? My workflow executes qsub to run an array job.

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [May 19, 2023, 7:51am UTC](https://community.openpbs.org/t/some-exit-codes-0-from-a-child-process-still-report-a-job-exit-code-of-0/3551/5 "2023-05-19T07:51:29Z")

</div>

Could you please share the output of the below command

> qsub --version  
> qsub -h

---

<div class="post-metadata">

**Author:** ![Chase](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@Chase](https://community.openpbs.org/u/Chase)\
**Post date:** [May 19, 2023, 2:21pm UTC](https://community.openpbs.org/t/some-exit-codes-0-from-a-child-process-still-report-a-job-exit-code-of-0/3551/6 "2023-05-19T14:21:49Z")

</div>

ah, what qsub version. Now I follow you

qsub --version  
pbs\_version = 20.0.1

qsub -h  
Job script will be read from standard input. Submit with CTRL+D.

---

<div class="post-metadata">

**Author:** ![Chase](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@Chase](https://community.openpbs.org/u/Chase)\
**Post date:** [May 19, 2023, 2:25pm UTC](https://community.openpbs.org/t/some-exit-codes-0-from-a-child-process-still-report-a-job-exit-code-of-0/3551/7 "2023-05-19T14:25:56Z")

</div>

I’m going to test with the directive #PBS -W block=true

Based on the documentation, that may force the job to wait until the child process finishes and collect its exit code. Does that make sense?

---

<div class="post-metadata">

**Author:** ![agurban](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/agurban/32/67_2.png) [@agurban](https://community.openpbs.org/u/agurban)\
**Post date:** [May 19, 2023, 5:08pm UTC](https://community.openpbs.org/t/some-exit-codes-0-from-a-child-process-still-report-a-job-exit-code-of-0/3551/8 "2023-05-19T17:08:16Z")

</div>

Where did you read about the “sync y” option? That does not show up in OpenPBS.

---

<div class="post-metadata">

**Author:** ![Chase](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@Chase](https://community.openpbs.org/u/Chase)\
**Post date:** [May 19, 2023, 8:22pm UTC](https://community.openpbs.org/t/some-exit-codes-0-from-a-child-process-still-report-a-job-exit-code-of-0/3551/9 "2023-05-19T20:22:40Z")

</div>

Here are some links. The sync option is either depreciated or an option with other schedulers forked off PBS. I also did not see any mention of it in recent/current PBS documentation

> <https://stackoverflow.com/questions/36190850/hold-remainder-of-shell-script-commands-until-pbs-qsub-array-job-completes>

[https://slurm-dev.schedmd.narkive.com/hSPCuZbk/how-to-emulate-qsub-s-sync-y-wblock-true](https://slurm-dev.schedmd.narkive.com/hSPCuZbk/how-to-emulate-qsub-s-sync-y-wblock-true)  
[https://gridscheduler.sourceforge.net/htmlman/htmlman1/qsub.html](https://gridscheduler.sourceforge.net/htmlman/htmlman1/qsub.html)

---

<div class="post-metadata">

**Author:** ![Chase](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@Chase](https://community.openpbs.org/u/Chase)\
**Post date:** [May 24, 2023, 8:12pm UTC](https://community.openpbs.org/t/some-exit-codes-0-from-a-child-process-still-report-a-job-exit-code-of-0/3551/10 "2023-05-24T20:12:19Z")

</div>

Got back to this and tested the directive #PBS -W block=true. I still saw the job with a child process in a singularity container produce an exit code of 1 while qstat still reported a sucessfullly finished job.

I have some other ideas I’m going to test
