3 # mdadm This shell script takes care of starting and stopping mdadm.
5 # chkconfig: 2345 80 30
6 # description: RAID array monitoring
9 # config: /etc/mdadm.conf
10 # pidfile: /var/run/mdadm.pid
12 # Source function library.
13 . /etc/rc.d/init.d/functions
15 # Source mdadm configuration.
16 if [ -f /etc/sysconfig/mdadm ]; then
17 . /etc/sysconfig/mdadm
22 if [ ! -f /var/lock/subsys/mdadm ]; then
23 [ -n "$MDADM_EMAIL" ] && echo "WARNING: sysconfig/mdadm:MDADM_EMAIL no longer supported. Please use /etc/mdadm.conf:MAILADDR setting." >&2
25 daemon /sbin/mdadm --monitor --scan --daemonise --pid-file /var/run/mdadm.pid ${MDADM_OPTS}
27 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/mdadm
29 msg_already_running mdadm
35 if [ -f /var/lock/subsys/mdadm ]; then
37 killproc --pidfile /var/run/mdadm.pid mdadm
38 rm -f /var/lock/subsys/mdadm >/dev/null 2>&1
45 if [ -f /var/lock/subsys/mdadm ]; then
55 # See how we were called.
79 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"