| Summary: | Issue with command substitution (#927586) | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Timothy Farmer <timothy.n.farmer> |
| Component: | ksh | Assignee: | Siteshwar Vashisht <svashisht> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | BaseOS QE - Apps <qe-baseos-apps> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.4 | CC: | darroch_royden, fkrska, jeffrey.ross, kdudka, richard.brittain, timothy.n.farmer |
| Target Milestone: | rc | Keywords: | Reopened |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-10-20 12:12:48 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: | |
|
Description
Timothy Farmer
2013-09-24 17:14:47 UTC
This request was not resolved in time for the current release. Red Hat invites you to ask your support representative to propose this request, if still desired, for consideration in the next release of Red Hat Enterprise Linux. *** Bug 1022589 has been marked as a duplicate of this bug. *** This is also reproducible under RHEL 5.10 with the package: ksh-20100621-18.el5
ksh-20100621-12.el5 does not have the same issue.
It is intermittent with ksh-20100621-18.el5, example script:
#!/bin/ksh
while [ -n "$(echo hello | grep -v "$(date +%y%m%d)")" ];
do
((COUNT += 1))
if [[ "$COUNT" -gt 1000 ]]; then
echo here
break
fi
done
echo $COUNT
Running the script 10 times, will give you 10 different results of $COUNT. Most of them < 50
Please test if you can reproduce this with latest ksh package that we have in rhel6.5: ksh-20120801-10.el6 My issue is under RHEL5.10, rather than RHEL6.x - should I raise a seperate bugzilla id? ksh-20100621-18.el5 is the latest version for RHEL5.10. (In reply to Darroch Royden from comment #6) > My issue is under RHEL5.10, rather than RHEL6.x - should I raise a seperate > bugzilla id? No need to do this. We already have bug for rhel5. It's bug #1028504, but you won't be able to see it as it is private. My question was for Timothy Understood - can I be granted access to track its progress and help test solutions? (In reply to Darroch Royden from comment #8) > Understood - can I be granted access to track its progress and help test > solutions? You will have to open support case at http://access.redhat.com/home , then support team can monitor it for you and/or maybe grant you access to that bug. Timothy: Please test if you can reproduce this with latest ksh package that we have in rhel6.5: ksh-20120801-10.el6 Thank you Michal, I will test as soon as I have an opportunity to. Waiting on a co-worker to give me the go-ahead. Michal, I will test as soon as I have an opportunity to. Waiting on a co-worker to give me the go-ahead. This issue is resolved with the latest version. This bug has resurfaced in ksh-20120801-10.el6_5.3.x86_64. We ran a non tty session with the following code
#!/bin/ksh
set -x
hostname=$(hostname)
echo Hostname is ${hostname}
hostname=`hostname`
echo Hostname 2 is ${hostname}
Our output was
+ hostname
+ hostname=''
+ echo Hostname is
Hostname is
+ hostname
+ hostname=server.domain.local
+ echo Hostname 2 is server.domain.local
Hostname 2 is server.domain.local
in a PuTTY session we get the following
+ hostname
+ hostname=server.domain.local
+ echo Hostname is server.domain.local
Hostname is server.domain.local
+ hostname
+ hostname=server.domain.local
+ echo Hostname 2 is server.domain.local
Hostname 2 is server.domain.local
I've tried to reproduce this with latest 6.5.z ~ 2012-08-01-10.el6_5.7 and it works fine. I stored the reproducer in test.sh and tried: ./test.sh ssh localhost `pwd`/test.sh su - $USER `pwd`/test.sh and in all three cases it worked. What are your complete reproducer steps, what do you mean by "non tty session" ? Running the script through a non interactive session causes the failure. I'm working on generalizing the process to further the evaluation. Will post results once completed. It appears to be an issue with ksh being utilized by 3rd party applications in a non TTY session. The above script was run via a remote agent with KSH version ksh-20100621-19.el6_4.3.x86_64 and completed successfully. A localized test case was also run via setsid sh -c 'tty; ps -jp "$$"; .//test.sh' < /dev/null > ./test_sh.log 2>&1 which also completed successfully. This issue has only recently resurfaced. I will continue to investigate to see if I can provide a further breakdown. (In reply to Timothy Farmer from comment #17) > I will continue to investigate to see if I can > provide a further breakdown. Hi, any success with reproducer? I have the same problem with ksh receiving nothing from `hostname -s` when run in the background. But I haven't found a simple method of reproducing it. On my system (6.5 with ksh-20120801-10.el8.i686) I have set up upstart to use a script entry to start a script that starts X & mwm (Motif Window Manager) and mwm is configured to call another script to open a window and remote-shell onto a machine. That latter script works fine from the command line, but not from the mwm menu. Using strace I can see that "hostname" is called, returns the host name as a string, but sends it to /dev/null instead of stdout. So the script line "DISPLAY=`hostname -s`:0" gets simply ":0". Changing the scipt from "#!/bin/ksh" to "#!/bin/sh" solves the problem and is an acceptable work-around for me. The bug described in comment #0 appears to be fixed. Please open a separate bug report with clear steps to reproduce if you need any further improvements. |