linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Jes.Sorensen@gmail.com
Cc: Linux Raid <linux-raid@vger.kernel.org>
Subject: [mdadm PATCH 1/2] mdcheck: add some logging.
Date: Fri, 06 Oct 2017 12:33:36 +1100	[thread overview]
Message-ID: <87h8vd12mn.fsf@notabene.neil.brown.name> (raw)

[-- 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 --]

             reply	other threads:[~2017-10-06  1:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-06  1:33 NeilBrown [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h8vd12mn.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=Jes.Sorensen@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).