summaryrefslogtreecommitdiffstats
path: root/mdadm.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2005-12-05 05:55:56 +0000
committerNeil Brown <neilb@suse.de>2005-12-05 05:55:56 +0000
commit773135f5bdf57219bf7f957b86964ba40d041180 (patch)
treea4d6248d3df1e4a101489f4d5696078db8009fbb /mdadm.c
parentfe394e5e4237e9c4d36a9a507ae36e5874ec66c4 (diff)
downloadmdadm-773135f5bdf57219bf7f957b86964ba40d041180.tar.gz
mdadm-773135f5bdf57219bf7f957b86964ba40d041180.tar.xz
mdadm-773135f5bdf57219bf7f957b86964ba40d041180.zip
syslog support for monitor mode
From: ross@jose.lug.udel.edu (Ross Vandegrift) Hi Neil, While adding the text message mode, I saw a FIXME asking for syslog support in monitor mode. This patch adds exactly that. Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mdadm.c b/mdadm.c
index c808799..844f6d4 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -94,6 +94,7 @@ int main(int argc, char *argv[])
int writemostly = 0;
int re_add = 0;
char *shortopt = short_options;
+ int dosyslog = 0;
int copies;
@@ -674,6 +675,10 @@ int main(int argc, char *argv[])
case O(MONITOR,'t'): /* test */
test = 1;
continue;
+ case O(MONITOR,'y'): /* log messages to syslog */
+ openlog("mdadm", 0, SYSLOG_FACILITY);
+ dosyslog = 1;
+ continue;
/* now the general management options. Some are applicable
* to other modes. None have arguments.
@@ -1116,7 +1121,8 @@ int main(int argc, char *argv[])
break;
}
rv= Monitor(devlist, mailaddr, program,
- delay?delay:60, daemonise, scan, oneshot, configfile, test, pidfile);
+ delay?delay:60, daemonise, scan, oneshot,
+ dosyslog, configfile, test, pidfile);
break;
case GROW: