diff options
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | debian/checkarray | 16 |
2 files changed, 9 insertions, 8 deletions
diff --git a/debian/changelog b/debian/changelog index 7af3ad10..0b2e125e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,7 @@ mdadm (3.2.3-1) UNRELEASED; urgency=low (Closes: #641972) * set nice value of the check/resync thread too, together with I/O scheduling class, based on patch by Sergey B Kirpichev (Closes: #652547) + * small changes for debian/checkarray [ Peter Eisentraut ] * Added support for "status" action to mdadm init script (Closes: #651737) 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 |