Hi,
I thought of a way to work around this issue. Then I looked at my vmcp
wrapper function (below) and it seems I already did (Homer slapping head -
D'oh).
But I still had the default buffer size for the vmcp command set to 1M.
Given the previous comments, I moved that down to 32K in zoom and zuess
(will have to update code on SourceForge after some testing):
< vmcpCmd="/sbin/vmcp --buffer=32K"
---
> vmcpCmd="/sbin/vmcp --buffer=1M"
The wrapper function tries to trap the error for buffer overflow and if
found, resend the vmcp command with the required size. So I'm guessing the
vast majority of vmcp calls made will have output that will fit in 32K.
Does this look like a good approach?
#+--------------------------------------------------------------------------+
function zCPcmd
# invoke a CP command with the vmcp module/command
# Args 1-n: the command to issue
# Return: the CP return code (not the vmcp rc)
#+--------------------------------------------------------------------------+
{
: SOURCE: ${BASH_SOURCE}
: STACK: ${FUNCNAME[@]}
local CPrc=0 # assume CP command succeeds
# local CPout # CP output
zVerbose "Invoking CP command: $vmcpCmd $@"
CPout=`$vmcpCmd $@ 2>&1` # run the CP command
local rc=$?
if [ "$rc" = 2 ]; then # output buffer overflow
local bytes=`echo $CPout | awk -F'(' '{print $2}' | awk '{print $1}'`
if [[ "$bytes" -gt 1048576 ]]; then # output too large
zWarn "Unable to get CP output of $bytes bytes - larger than 1 MB"
return 11 # so caller can exit 11
fi
zWarn "Warning: increasing vmcp buffer size to $bytes bytes and trying
again"
CPout=`$vmcpCmd --buffer=$bytes $@ 2>&1`
local rc2=$?
if [ $rc2 != 0 ]; then # capture the CP return code
after "#"
CPrc=`echo $CPout | grep "Error: non-zero CP" | awk -F# '{print $2}'`
fi
elif [ $rc != 0 ]; then # capture the CP return code
after "#"
CPrc=`echo $CPout | grep "Error: non-zero CP" | awk -F# '{print $2}'`
fi
if [ ${#CPout} != 0 -a "$CPverbose" = "yes" ]; then
echo "$CPout" # show CPoutput in verbose mode
fi
return $CPrc # return code from CP
} # zCPcmd()
Thanks.
-Mike
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/