* [mdadm PATCH 1/2] mdcheck: add some logging.
@ 2017-10-06 1:33 NeilBrown
2017-10-06 1:34 ` [mdadm PATCH 2/2] mdcheck: improve cleanup NeilBrown
2017-10-10 20:41 ` [mdadm PATCH 1/2] mdcheck: add some logging Jes Sorensen
0 siblings, 2 replies; 4+ messages in thread
From: NeilBrown @ 2017-10-06 1:33 UTC (permalink / raw)
To: Jes.Sorensen; +Cc: Linux Raid
[-- Attachment #1: Type: text/plain, Size: 1703 bytes --]
Use 'logger' to report when mdcheck starts, stops, or continues
the check on an array.
Signed-off-by: NeilBrown <neilb@suse.com>
---
misc/mdcheck | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/misc/mdcheck b/misc/mdcheck
index 2c8f54d6e4cf..589d038eed9b 100644
--- a/misc/mdcheck
+++ b/misc/mdcheck
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright (C) 2014 Neil Brown <neilb@suse.de>
+# Copyright (C) 2014-2017 Neil Brown <neilb@suse.de>
#
#
# 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: <neilb@suse.de>
+# Email: <neilb@suse.com>
# 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
--
2.14.0.rc0.dirty
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [mdadm PATCH 2/2] mdcheck: improve cleanup
2017-10-06 1:33 [mdadm PATCH 1/2] mdcheck: add some logging NeilBrown
@ 2017-10-06 1:34 ` NeilBrown
2017-10-10 20:42 ` Jes Sorensen
2017-10-10 20:41 ` [mdadm PATCH 1/2] mdcheck: add some logging Jes Sorensen
1 sibling, 1 reply; 4+ messages in thread
From: NeilBrown @ 2017-10-06 1:34 UTC (permalink / raw)
To: Jes.Sorensen; +Cc: Linux Raid
[-- Attachment #1: Type: text/plain, Size: 545 bytes --]
We should remove the tmp file on signals as well as on exit.
Signed-off-by: NeilBrown <neilb@suse.com>
---
misc/mdcheck | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/misc/mdcheck b/misc/mdcheck
index 589d038eed9b..42d4094a2754 100644
--- a/misc/mdcheck
+++ b/misc/mdcheck
@@ -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
--
2.14.0.rc0.dirty
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [mdadm PATCH 1/2] mdcheck: add some logging.
2017-10-06 1:33 [mdadm PATCH 1/2] mdcheck: add some logging NeilBrown
2017-10-06 1:34 ` [mdadm PATCH 2/2] mdcheck: improve cleanup NeilBrown
@ 2017-10-10 20:41 ` Jes Sorensen
1 sibling, 0 replies; 4+ messages in thread
From: Jes Sorensen @ 2017-10-10 20:41 UTC (permalink / raw)
To: NeilBrown; +Cc: Linux Raid
On 10/05/2017 09:33 PM, NeilBrown wrote:
>
> Use 'logger' to report when mdcheck starts, stops, or continues
> the check on an array.
>
> Signed-off-by: NeilBrown <neilb@suse.com>
> ---
> misc/mdcheck | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
Applied!
Thanks,
Jes
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [mdadm PATCH 2/2] mdcheck: improve cleanup
2017-10-06 1:34 ` [mdadm PATCH 2/2] mdcheck: improve cleanup NeilBrown
@ 2017-10-10 20:42 ` Jes Sorensen
0 siblings, 0 replies; 4+ messages in thread
From: Jes Sorensen @ 2017-10-10 20:42 UTC (permalink / raw)
To: NeilBrown; +Cc: Linux Raid
On 10/05/2017 09:34 PM, NeilBrown wrote:
>
> We should remove the tmp file on signals as well as on exit.
>
> Signed-off-by: NeilBrown <neilb@suse.com>
> ---
> misc/mdcheck | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied!
Thanks,
Jes
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-10 20:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-06 1:33 [mdadm PATCH 1/2] mdcheck: add some logging NeilBrown
2017-10-06 1:34 ` [mdadm PATCH 2/2] mdcheck: improve cleanup NeilBrown
2017-10-10 20:42 ` Jes Sorensen
2017-10-10 20:41 ` [mdadm PATCH 1/2] mdcheck: add some logging Jes Sorensen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.