Bug 129975

Summary: Problem with nested use of "set -m" in pdksh.
Product: Red Hat Enterprise Linux 3 Reporter: Vijayeendra Namasevi <nvijayee>
Component: pdkshAssignee: Karsten Hopp <karsten>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-05 12:02:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vijayeendra Namasevi 2004-08-16 05:14:35 UTC
Description of problem:
Hi,
In one of our scripts, we use the "set -m" to monitor background
processes in a nested fashion. With pdksh, after the second "set -m"
none of the statements get executed. Following toned down script 
demostrates the problem,



#!/bin/ksh
set -x
TEST_PROGRAM=./test  ## This is a test C hello world program
set -m
nohup ksh << NohupStdinEOF > vt.out 2>&1 &
echo "Testing"
set -m
#### None of the following statements execute until the set -m
echo " before exec"
exec $TEST_PROGRAM 2>&1 | tee test1.out &
echo $?
echo " after exec"
set +m
#### Statements after this do execute.
NohupStdinEOF
sleep 1
set +m
sleep 1
set +x

The PDKSH level on my machine is, pdksh-5.2.14-21
Kernel level is -> kernel-2.4.21-9.EL

We downloaded ksh93 from the kornshell.com site and the above 
script works perfectly fine. 

Has anyone seen a similar issue? Any suggestions to get around this 
problem?

Thanks
Vijay


Version-Release number of selected component (if applicable):
pdksh-5.2.14-21

How reproducible:
Everytime

Steps to Reproduce:
1.Write a simple hello world C program and name it test.c. 
2.Build the test program into an executable (test) and place in the 
same directory as the script.
3.Now run the script. Check the output files, 
  
Actual results:
Two output files are to be generated. vt.out and test1.out (along 
side anything that comes on the stderr. The output is redirected to 
those files and stderr). vt.out has "Testing" which is expected, but 
test1.out has nothing in it, which is the problem.


Expected results:
vt.out should have "Testing" which it already has.
test1.out should have "hello world"

Additional info:

Comment 1 Karsten Hopp 2004-10-05 12:02:18 UTC
Please use the AT&T ksh package from our RHN Extras Channel if you need
a 'real' ksh. pdksh doesn't have nearly as much features as the
original ksh and probably never will have. It is known to have some
incompatibilities.