You are not logged in.

#1 2010-08-19 19:53:06

Naunaud
Member
Registered: 2010-03-08
Posts: 9

mdadm --monitor in rc.local

Hi everyone,

I've been here in the past, I hope you'll be able to help as my many searches on the Internet didn't get me the right answer.
I have a RAID5 array built with mdadm.
I've configured mailx and msmtp to be able to receive message (from smartmontools and mdadm).
When I try the command I put in rc.local it works.

mdadm --monitor --scan --daemonise --delay 120 --test

This works when I use it with sudo.
And when I do:

sudo /etc/rc.local

It works too.
Here are the permissions on the file:

-rwxr-xr-x 1 root root 138 Aug 19 19:27 /etc/rc.local

But when I boot the machine, nothing is sent (I used the --test command, so it HAS to send a test email when run)

Kind regards,

Naunaud.

Offline

#2 2010-08-19 20:08:45

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: mdadm --monitor in rc.local

Perhaps it requires an application of raid params using mkinitcpio as outlined in the wiki to enable mdadm during boot sequence.

I am not sure of your apps however so I could be way off in no man's land!!


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#3 2010-08-19 20:22:14

Naunaud
Member
Registered: 2010-03-08
Posts: 9

Re: mdadm --monitor in rc.local

Well, the RAID5 is only for storage, the system is on another disk outside the RAID, so I'm not sure what you're talking about. I've read the wiki:
http://wiki.archlinux.org/index.php/Con … Using_raid

Is that what you're referring to ?

And as rc.local is the last script run on the machin before any login, I was hoping it would work.

Kind regards,

Naunaud.

Offline

#4 2010-08-19 20:32:49

Naunaud
Member
Registered: 2010-03-08
Posts: 9

Re: mdadm --monitor in rc.local

Mmm, now that I'm thinking about it, could it be that the mailing functions are not available by the time of the rc.local run ?

Kind regards,

Naunaud.

Offline

#5 2010-08-19 23:16:42

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,222
Website

Re: mdadm --monitor in rc.local

rc.local is run last, so network etc should all be up an running (unless you're using something like NetworkManager in your DE to manage the network of course).

Any reason you're doing this in rc.local instead of using the daemon designed for this? (/etc/rc.d/mdadm)

Offline

#6 2010-08-19 23:28:49

Naunaud
Member
Registered: 2010-03-08
Posts: 9

Re: mdadm --monitor in rc.local

fukawi2 wrote:

rc.local is run last, so network etc should all be up an running (unless you're using something like NetworkManager in your DE to manage the network of course).

Any reason you're doing this in rc.local instead of using the daemon designed for this? (/etc/rc.d/mdadm)

Well, if I launch the daemon with rc.conf, it doesn't seem to monitor anything...
When I set a drive faulty, there's no email report.

Is there another tool to monitor a RAID created with mdadm ?

Offline

#7 2010-08-20 01:25:55

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,222
Website

Re: mdadm --monitor in rc.local

Have you setup /etc/mdadm.conf? The daemon works for me after I configure that:

MAILADDR my_email_address@gmail.com
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=0.90 UUID=46649049:2fe1a3ab:d28dda9b:ac5154d8
ARRAY /dev/md1 level=raid1 num-devices=2 metadata=0.90 UUID=817f74b4:7a3fddc2:9c15dca4:e5d40b5e
ARRAY /dev/md2 level=raid1 num-devices=2 metadata=0.90 UUID=e2f167e5:8097e2b8:38f93247:422d0e7b

Offline

#8 2010-08-20 02:18:52

Naunaud
Member
Registered: 2010-03-08
Posts: 9

Re: mdadm --monitor in rc.local

fukawi2 wrote:

Have you setup /etc/mdadm.conf? The daemon works for me after I configure that:

MAILADDR my_email_address@gmail.com
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=0.90 UUID=46649049:2fe1a3ab:d28dda9b:ac5154d8
ARRAY /dev/md1 level=raid1 num-devices=2 metadata=0.90 UUID=817f74b4:7a3fddc2:9c15dca4:e5d40b5e
ARRAY /dev/md2 level=raid1 num-devices=2 metadata=0.90 UUID=e2f167e5:8097e2b8:38f93247:422d0e7b

Has it ever send you a mail in case of failure ?
(and yes my mdadm is configured like that)
I'll just put the daemon in rc.conf then and wait for a real failure!

Kind regards,

Naunaud.

Offline

#9 2010-08-20 03:08:54

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,222
Website

Re: mdadm --monitor in rc.local

Yes, I used to get email regularly when I had faulty RAM locking the computer, which would cause mdadm to rebuild after a hot-reset sad

Offline

#10 2010-08-20 14:16:33

Naunaud
Member
Registered: 2010-03-08
Posts: 9

Re: mdadm --monitor in rc.local

fukawi2 wrote:

Yes, I used to get email regularly when I had faulty RAM locking the computer, which would cause mdadm to rebuild after a hot-reset sad

Ok, thanks for you answer !

Archlinux <3

Offline

Board footer

Powered by FluxBB