Quote: |
Currently, ezca tools are flakey and fails too much.
So, I hacked ezca tools just like Yoichi did in 2009 (see elog #1368).
For now,
/ligo/apps/linux-x86_64/gds-2.15.1/bin/ezcaread
/ligo/apps/linux-x86_64/gds-2.15.1/bin/ezcastep
/ligo/apps/linux-x86_64/gds-2.15.1/bin/ezcaswitch
/ligo/apps/linux-x86_64/gds-2.15.1/bin/ezcawrite
are wrapper scripts that repeats ezca stuff until it succeeds (or fails more than 5 times).
Of course, this is just a temporary solution to do tonight's work.
To stop this hack, run /users/yuta/scripts/ezhack/stophacking.cmd. To hack, run /users/yuta/scripts/ezhack/starthacking.cmd.
Original binary files are located in /ligo/apps/linux-x86_64/gds-2.15.1/bin/ezcabackup/ directory.
Wrapper scripts live in /users/yuta/scripts/ezhack directory.
I wish I could alias ezca tools to my wrapper scripts so that I don't have to touch the original files. However, alias settings doesn't work in our scripts.
Do you have any idea?
|
I didn't like this solution, so I hacked up something else. I made a new single wrapper script to handle all of the utils. It then executes the correct command based on the zeroth argument (see below).
I think moved all the binaries to give them .bin suffixes, and the made links to the new wrapper script. Now everything should work as expected, with this new retry feature.
controls@rosalba:/ligo/apps/linux-x86_64/gds-2.15.1/bin 0$ for pgm in ezcaread ezcawrite ezcaservo ezcastep ezcaswitch; do mv $pgm{,.bin}; ln ezcawrapper $pgm; done
controls@rosalba:/ligo/apps/linux-x86_64/gds-2.15.1/bin 0$ cat ezcawrapper
#!/bin/bash
retries=5
pgm="$0"
run="${pgm}.bin"
if ! [ -e "$run" ] ; then
cat <&2
This is the ezca wrapper script. It should be hardlinked in place of
the ezca commands (ezcaread, ezcawrite, etc.), and executing the
original binaries (that have been moved to *.bin) with $retries
failure retries.
EOF
exit -1
fi
if [ -z "$@" ] || [[ "$1" == '-h' ]] ; then
"$run"
exit
fi
for try in $(seq 1 "$retries") ; do
if "$run" "$@"; then
exit
else
echo "retrying ($try/$retries)..." >&2
fi
done
echo "$(basename $pgm) failed after $retries retries." >&2
exit 1
|