Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1150554

Summary: zsh wait builtin does not work for already exited processes [RHEL-7]
Product: Red Hat Enterprise Linux 7 Reporter: Tim Speetjens <tspeetje>
Component: zshAssignee: Kamil Dudka <kdudka>
Status: CLOSED ERRATA QA Contact: Jan Kepler <jkejda>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.0CC: fkrska, james.antill, jkejda, kdudka, mkolaja, msvistun, ovasik, qe-baseos-apps
Target Milestone: rcKeywords: Patch, Reopened, ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: zsh-5.0.2-9.el7 Doc Type: Enhancement
Doc Text:
With this update, the "wait" built-in command of zsh can now wait for (and obtain the exit status of) any selected background process, which no longer needs to be the latest created one.
Story Points: ---
Clone Of: 1150541
: 1274698 (view as bug list) Environment:
Last Closed: 2015-11-19 05:19:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1162198    
Bug Blocks: 1150541, 1274698    

Comment 2 Tim Speetjens 2014-10-24 07:40:45 UTC
When zsh (5.0.3, shipped with rhel7) is run with either
- a symlink named 'sh' pointing to zsh
- a symlink named 'ksh' pointing to zsh binary
- with the "-o POSIXJOBS" arguments (to set the POSIXJOBS option)

it runs correctly.

This means that the sh/ksh compatibility option runs correctly.

Also, as explained in http://www.zsh.org/mla/workers/2014/msg01280.html zsh-workers don't consider this as bug for zsh, running without POSIXJOBS option, as there are some more POSIX non-conformity issues remaining.

Therefor, closing not a bug.

Comment 3 Tim Speetjens 2014-10-24 07:45:36 UTC
However, testing with multiple pids, like:

sh -c "echo done1" &
pid1=$!
sh -c "echo done2" &
pid2=$!
sh -c "echo done3" &
pid3=$!
sleep 1
wait $pid1 $pid2 $pid3

still fails
$ zsh -o POSIXJOBS test-multi.sh 
done1
done2
done3
test-multi.sh:wait:9: pid 7203 is not a child of this shell
test-multi.sh:wait:9: pid 7204 is not a child of this shell
rc: 0
rc: 3

Comment 4 Kamil Dudka 2014-11-07 17:22:43 UTC
This seems to be fixed upstream:

http://sourceforge.net/p/zsh/code/ci/b4f7ccec
http://sourceforge.net/p/zsh/code/ci/9a551ca8

Comment 7 Kamil Dudka 2014-11-21 11:29:57 UTC
*** Bug 1150541 has been marked as a duplicate of this bug. ***

Comment 15 errata-xmlrpc 2015-11-19 05:19:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2208.html