diff options
author | Zdenek Behan <rain@matfyz.cz> | 2009-10-19 13:13:58 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-10-19 13:13:58 +1100 |
commit | 9a36a9b713a6c789f268251a81de67bb8fd9c7f8 (patch) | |
tree | 1591bd243d1267838e6cbe405533dac6348b0f1b /mdadm.c | |
parent | 1373b07d758213b643f72a09384b840e4f08057a (diff) | |
download | mdadm-9a36a9b713a6c789f268251a81de67bb8fd9c7f8.tar.gz mdadm-9a36a9b713a6c789f268251a81de67bb8fd9c7f8.tar.xz mdadm-9a36a9b713a6c789f268251a81de67bb8fd9c7f8.zip |
Monitor: add option to specify rebuild increments
ie. the percent increments after which RebuildNN event is generated
This is particulary useful when using --program option, rather than
(only) syslog for alerts.
Signed-off-by: Zdenek Behan <rain@matfyz.cz>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r-- | mdadm.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -89,6 +89,7 @@ int main(int argc, char *argv[]) int require_homehost = 1; char *mailaddr = NULL; char *program = NULL; + int increments = 20; int delay = 0; int daemonise = 0; char *pidfile = NULL; @@ -698,6 +699,14 @@ int main(int argc, char *argv[]) program = optarg; continue; + case O(MONITOR,'r'): /* rebuild increments */ + increments = atoi(optarg); + if (increments>99 || increments<1) { + fprintf(stderr, Name ": please specify positive integer between 1 and 99 as rebuild increments.\n"); + exit(2); + } + continue; + case O(MONITOR,'d'): /* delay in seconds */ case O(GROW, 'd'): case O(BUILD,'d'): /* delay for bitmap updates */ @@ -1377,7 +1386,7 @@ int main(int argc, char *argv[]) } rv= Monitor(devlist, mailaddr, program, delay?delay:60, daemonise, scan, oneshot, - dosyslog, test, pidfile); + dosyslog, test, pidfile, increments); break; case GROW: |