From 773135f5bdf57219bf7f957b86964ba40d041180 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 5 Dec 2005 05:55:56 +0000 Subject: 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 --- mdadm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'mdadm.c') 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: -- cgit