zed: update zed.d/statechange-slot_off.sh
The statechange-slot_off.sh zedlet which was added in #15200 needed to be installed so it's included by the packages. Additional testing has also shown that multiple retries are often needed for the script to operate reliably. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #15210
This commit is contained in:
parent
a4f82db53d
commit
a449d8bab0
|
@ -21,6 +21,7 @@ dist_zedexec_SCRIPTS = \
|
||||||
scrub_finish-notify.sh \
|
scrub_finish-notify.sh \
|
||||||
statechange-led.sh \
|
statechange-led.sh \
|
||||||
statechange-notify.sh \
|
statechange-notify.sh \
|
||||||
|
statechange-slot_off.sh \
|
||||||
vdev_clear-led.sh \
|
vdev_clear-led.sh \
|
||||||
vdev_attach-led.sh \
|
vdev_attach-led.sh \
|
||||||
pool_import-led.sh \
|
pool_import-led.sh \
|
||||||
|
@ -39,6 +40,7 @@ zedconfdefaults = \
|
||||||
scrub_finish-notify.sh \
|
scrub_finish-notify.sh \
|
||||||
statechange-led.sh \
|
statechange-led.sh \
|
||||||
statechange-notify.sh \
|
statechange-notify.sh \
|
||||||
|
statechange-slot_off.sh \
|
||||||
vdev_clear-led.sh \
|
vdev_clear-led.sh \
|
||||||
vdev_attach-led.sh \
|
vdev_attach-led.sh \
|
||||||
pool_import-led.sh \
|
pool_import-led.sh \
|
||||||
|
|
|
@ -43,15 +43,17 @@ if [ ! -f "$ZEVENT_VDEV_ENC_SYSFS_PATH/power_status" ] ; then
|
||||||
exit 4
|
exit 4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "off" | tee "$ZEVENT_VDEV_ENC_SYSFS_PATH/power_status"
|
# Turn off the slot and wait for sysfs to report that the slot is off.
|
||||||
|
# It can take ~400ms on some enclosures and multiple retries may be needed.
|
||||||
# Wait for sysfs for report that the slot is off. It can take ~400ms on some
|
|
||||||
# enclosures.
|
|
||||||
for i in $(seq 1 20) ; do
|
for i in $(seq 1 20) ; do
|
||||||
if [ "$(cat $ZEVENT_VDEV_ENC_SYSFS_PATH/power_status)" == "off" ] ; then
|
echo "off" | tee "$ZEVENT_VDEV_ENC_SYSFS_PATH/power_status"
|
||||||
break
|
|
||||||
fi
|
for j in $(seq 1 5) ; do
|
||||||
sleep 0.1
|
if [ "$(cat $ZEVENT_VDEV_ENC_SYSFS_PATH/power_status)" == "off" ] ; then
|
||||||
|
break 2
|
||||||
|
fi
|
||||||
|
sleep 0.1
|
||||||
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "$(cat $ZEVENT_VDEV_ENC_SYSFS_PATH/power_status)" != "off" ] ; then
|
if [ "$(cat $ZEVENT_VDEV_ENC_SYSFS_PATH/power_status)" != "off" ] ; then
|
||||||
|
|
Loading…
Reference in New Issue