I am trying to make mdadm call into a simple bash script which writes a message in the kernel log in case of a state change.
The script is as follows,
# cat /tmp/test.sh
#!/bin/bash
echo "raid array status change" > /dev/kmsg
I have added the following to the mdadm config file
PROGRAM /tmp/test.sh
ARRAY /dev/md0 UUID=
But when I do the test, it says the md0 is being picked up, and the correct program option is being used, but nothing gets printed in dmesg
mdadm --monitor --test /dev/md0 -1
Note that when I manually run the script, it prints the message in kernel log.
My questions
1. Does the above process of calling the program depend on the mail setting also? Because my mail config is not set.
2. Any idea what could be wrong or missing?
Asked by Haris
(113 rep)
Jul 30, 2025, 09:40 AM