2

I have an mdadm-RAID and want to get notified about events, for example a failing HDD. I can use MAILADDR and PROGRAM in the mdadm config file to achieve this. I decided to use the latter. So I wrote a simple notification bash-script and set the PROGRAM-option to the script's path.

To avoid that each and every user can use this script to send notifications only the root-user has the execute-right on that script. So when mdadm wants to send a notification it must run the script as root.

However I cannot find any option to set the user. Is it always root by default?

1 Answer 1

1

AFAIK it will run as root, as long as mdadm --monitor is being run as root (which is the normal case).

I found the MAILADDR option in mdadm.conf more flexible in this respect. On my server any email is sent to a specially created user, for which an entry in .procmailrc does execute a program with that user as owner. That program is located in a directory not accessible by any other (normal) users (it sends a notification from my server to my desktop on my work machine, in addition to forwarding the email).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .