mdcheck: add some logging.
PATCH 1/2 mdcheck: add some logging.
Use 'logger' to report when mdcheck starts, stops, or continues the check on an array.
Signed-off-by NeilBrown <[email protected]>
--- misc/mdcheck | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
misc/mdcheck +7 -2
@@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (C) 2014 Neil Brown <[email protected]> +# Copyright (C) 2014-2017 Neil Brown <[email protected]> # # # This program is free software; you can redistribute it and/or modify
@@ -14,7 +14,7 @@ # GNU General Public License for more details. # # Author: Neil Brown -# Email: <[email protected]> +# Email: <[email protected]> # This script should be run periodically to automatically # perform a 'check' on any md arrays.
@@ -94,17 +94,20 @@ do if [ -z "$cont" ] then start=0 + logger -p daemon.info mdcheck start checking $dev elif [ -z "$MD_UUID" -o ! -f "$fl" ] then # Nothing to continue here continue else start=`cat "$fl"` + logger -p daemon.info mdcheck continue checking $dev from $start fi cnt=$[cnt+1] eval MD_${cnt}_fl=\$fl eval MD_${cnt}_sys=\$sys + eval MD_${cnt}_dev=\$dev echo $start > $fl echo $start > $sys/md/sync_min echo check > $sys/md/sync_action
@@ -145,6 +148,7 @@ for i in `eval echo {1..$cnt}` do eval fl=\$MD_${i}_fl eval sys=\$MD_${i}_sys + eval dev=\$MD_${i}_dev if [ -z "$fl" ]; then continue; fi
@@ -156,4 +160,5 @@ do fi echo idle > $sys/md/sync_action cat $sys/md/sync_min > $fl + logger -p daemon.info pause checking $dev at `cat $fl` done
Signature · 1 line
2.14.0.rc0.dirty
PATCH 2/2 mdcheck: improve cleanup
We should remove the tmp file on signals as well as on exit.
Signed-off-by NeilBrown <[email protected]>
--- misc/mdcheck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
misc/mdcheck +1 -1
@@ -66,7 +66,7 @@ shift # We need a temp file occasionally... tmp=/var/lib/mdcheck/.md-check-$$ -trap 'rm -f "$tmp"' 0 +trap 'rm -f "$tmp"' 0 2 3 15 # firstly, clean out really old state files
Signature · 1 line
2.14.0.rc0.dirty
Jes Sorensen
AppliedQuoted 8 lines · NeilBrown
Use 'logger' to report when mdcheck starts, stops, or continues the check on an array.
Signed-off-by NeilBrown <[email protected]>--- misc/mdcheck | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
Applied!
Thanks,
Jes
Jes Sorensen
AppliedRe: [mdadm PATCH 2/2] mdcheck: improve cleanup
In reply to NeilBrownQuoted 7 lines · NeilBrown
We should remove the tmp file on signals as well as on exit.
Signed-off-by NeilBrown <[email protected]>--- misc/mdcheck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied!
Thanks,
Jes