Lines Matching +full:led +full:- +full:s
4 # Turn off/on vdevs' enclosure fault LEDs when their pool's state changes.
6 # Turn a vdev's fault LED on if it becomes FAULTED, DEGRADED or UNAVAIL.
7 # Turn its LED off when it's back ONLINE again.
12 # only set the LED for that particular vdev. This is the case for statechange
23 # 0: enclosure led successfully set
26 # 3: The led sysfs path passed from ZFS does not exist
30 [ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc"
31 . "${ZED_ZEDLET_DIR}/zed-functions.sh"
33 if [ ! -d /sys/class/enclosure ] && [ ! -d /sys/bus/pci/slots ] ; then
50 # Read an enclosure sysfs file, and write it if it's not already set to 'val'
64 if [ -z "$val" ]; then
68 if [ ! -e "$file" ] ; then
72 # If another process is accessing the LED when we attempt to update it,
73 # the update will be lost so retry until the LED actually changes or we
79 read -r current < "${file}"
82 # it will return 2. Treat all non-zero values as 1 for
90 zed_log_msg "vdev $vdev set '$file' LED to $val"
99 # On JBODs the fault LED is called 'fault' and on a path like this:
103 # On NVMe it's called 'attention' and on a path like this:
107 # This function returns the full path to the fault LED file for a given
113 if [ -f "$dir/fault" ] ; then
115 elif [ -f "$dir/attention" ] ; then
145 read -r address < "/sys/class/block/$dev/device/address"
147 find /sys/bus/pci/slots -regex '.*/[0-9]+/address$' | \
148 while read -r sys_addr; do
149 read -r this_address < "$sys_addr"
158 if echo "$address" | grep -Eq ^"$this_address" ; then
188 ZPOOL_SCRIPTS_AS_ROOT=1 $ZPOOL status -c upath,fault_led "$pool" | grep '/dev/' | (
190 while read -r vdev state _ _ _ therest; do
191 # Read out current LED value and path
193 dev=$(basename "$(echo "$therest" | awk '{print $(NF-1)}')")
195 if [ ! -d "$vdev_enc_sysfs_path" ] ; then
206 if [ -z "$vdev_enc_sysfs_path" ] ; then
207 # Skip anything with no sysfs LED entries
212 if [ ! -e "$led_path" ] ; then
221 # LED is already set correctly
232 if [ -n "$ZEVENT_VDEV_ENC_SYSFS_PATH" ] && [ -n "$ZEVENT_VDEV_STATE_STR" ] ; then