Fix broken development setup due to "Unit attention" error on sg_modes command
Problem
At the moment, the build_deploy.sh
script fails with the following error when it executes the reset_tapes.sh
script on the dev maching:
Running SCSI MODE SENSE
mode sense(10):
Fixed format, current; Sense key: Unit Attention
Additional sense: Power on, reset, or bus device reset occurred
Unit attention
sg_modes failed: Unit attention
This is triggered by the following component of the script, which is specifically targeted at reseting the SCSI sense data after a reboot:
# Clear power on sense generate during boot.
echo "Running SCSI MODE SENSE"
for SG_DEVICE in $(lsscsi -g | grep tape | awk '{print $7}'); do
sg_modes $SG_DEVICE > /dev/null
done
However, since this script is executed with set -e
it will cause it to fail with an error.
More info can be found here: