Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

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