You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionstart_vmstat() {
echo"Starting vmstat."$id" ["$interval"]"| tee -a $LOGDIR/profile-log.$RUN_NUMBER
vmstat $interval|${LPCPUDIR}/tools/output-timestamp.pl >$LOGDIR/vmstat.$id.$RUN_NUMBER&
VMSTAT_PID=$!disown$VMSTAT_PID
}
If you read about $! in the bash manual page, it says
! Expands to the process ID of the job most recently placed into
the background, whether executed as an asynchronous command or
using the bg builtin (see JOB CONTROL below).
But which PID is that, the PID of vmstat or the output_timestamp.pl? It appears to be undefined. A more reliable way of stopping the vmstat pipeline is needed.
I fixed this temporarily by changing stop_vmstat() to use pkill vmstat. However, another way is to use a "jobspec" to specify the job to be killed. In this case, you could set VMSTAT_PID="%vmstat". Also change disown $VMSTAT_PID to disown $! and move it before setting VMSTAT_PID.
The text was updated successfully, but these errors were encountered:
I ran
on an IBM Power 10 system running RHEL 8.9. The tool appears to hang after the message about finishing time:
I used
ps
to see what was going on:The
vmstat
there seems odd, since there was a message about stoppingvmstat
above. Thetee
command is at line 1452 in lpcpu.sh:My suspicion is that
vmstat
is holding the pipe totee
open. So why didn'tvmstat
stop? Here'sstop_vmstat()
:VMSTAT_PID
is set bystart_vmstat()
:If you read about $! in the
bash
manual page, it saysBut which PID is that, the PID of
vmstat
or theoutput_timestamp.pl
? It appears to be undefined. A more reliable way of stopping thevmstat
pipeline is needed.I fixed this temporarily by changing
stop_vmstat()
to usepkill vmstat
. However, another way is to use a "jobspec" to specify the job to be killed. In this case, you could setVMSTAT_PID="%vmstat"
. Also changedisown $VMSTAT_PID
todisown $!
and move it before settingVMSTAT_PID
.The text was updated successfully, but these errors were encountered: