summaryrefslogtreecommitdiff
path: root/debian/checkarray
diff options
context:
space:
mode:
Diffstat (limited to 'debian/checkarray')
-rw-r--r--debian/checkarray16
1 files changed, 8 insertions, 8 deletions
diff --git a/debian/checkarray b/debian/checkarray
index 96538e33..2043d8cd 100644
--- a/debian/checkarray
+++ b/debian/checkarray
@@ -139,33 +139,33 @@ fi
[ $all = 1 ] && arrays="$(ls -d1 /sys/block/md* | cut -d/ -f4)"
for array in $arrays; do
- SYNC_ACTION_CTL=/sys/block/$array/md/sync_action
+ MDBASE=/sys/block/$array/md
- if [ ! -e $SYNC_ACTION_CTL ]; then
+ if [ ! -e $MDBASE/sync_action ]; then
[ $quiet -lt 1 ] && echo "$PROGNAME: I: skipping non-redundant array $array." >&2
continue
fi
- cur_status="$(cat $SYNC_ACTION_CTL)"
+ read cur_status < $MDBASE/sync_action
if [ $action = status ]; then
echo "$array: $cur_status"
continue
fi
- if [ ! -w $SYNC_ACTION_CTL ]; then
- [ $quiet -lt 2 ] && echo "$PROGNAME: E: $SYNC_ACTION_CTL not writeable." >&2
+ if [ ! -w $MDBASE/sync_action ]; then
+ [ $quiet -lt 2 ] && echo "$PROGNAME: E: $MDBASE/sync_action not writeable." >&2
exit 4
fi
- if [ "$(cat /sys/block/$array/md/array_state)" = 'read-auto' ]; then
+ if [ "$(cat $MDBASE/array_state)" = 'read-auto' ]; then
[ $quiet -lt 1 ] && echo "$PROGNAME: W: array $array in auto-read-only state, skipping..." >&2
continue
fi
case "$action" in
idle)
- echo $action > $SYNC_ACTION_CTL
+ echo $action > $MDBASE/sync_action
[ $quiet -lt 1 ] && echo "$PROGNAME: I: cancel request queued for array $array." >&2
;;
@@ -177,7 +177,7 @@ for array in $arrays; do
# queue request for the array. The kernel will make sure that these requests
# are properly queued so as to not kill one of the array.
- echo $action > $SYNC_ACTION_CTL
+ echo $action > $MDBASE/sync_action
[ $quiet -lt 1 ] && echo "$PROGNAME: I: check queued for array $array." >&2
case "$ionice" in