580b152b0e
Wed May 19 2004 Jeremy Katz <katzj@redhat.com> - 1.5.0-7 - add patch with reallyforce mode on creation to be used by anaconda Wed May 12 2004 Doug Ledford <dledford@redhat.com> 2.5.0-6 - Fix a bug in the %postun scriptlet related to downgrading to a version of mdadm that doesn't include the mdmpd daemon. Fri May 07 2004 Doug Ledford <dledford@redhat.com> 1.5.0-5 - Disable service mdmpd by default to avoid [Failed] messages on current 2.6 kernels. Possibly re-enable it by default once the 2.6 kernels have the md event interface. Thu Apr 22 2004 Doug Ledford <dledford@redhat.com> 1.5.0-4 - Update mdmonitor script to start daemon more cleanly - Repackage mdmpd tarball to include gcc-3.4 changes and to make mdmpd properly daemonize at startup instead of forking and leaving the child attached to the terminal.
86 lines
1.6 KiB
Bash
Executable File
86 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# mdmonitor This starts, stops, and reloads the mdadm-based
|
|
# software RAID monitoring and management facility
|
|
#
|
|
# chkconfig: 2345 15 85
|
|
# description: software RAID monitoring and management
|
|
# config: /etc/mdadm.conf
|
|
#
|
|
|
|
# Copyright 2002 Red Hat, Inc.
|
|
|
|
PATH=/sbin:/usr/sbin:$PATH
|
|
RETVAL=0
|
|
|
|
prog=mdmonitor
|
|
|
|
# Source function library.
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
# Make sure configuration file exists and has information we can use
|
|
# MAILADDR or PROGRAM or both must be set in order to run mdadm --monitor
|
|
[ -f /etc/mdadm.conf ] || exit 0
|
|
grep '^\(MAILADDR\|PROGRAM\) .' /etc/mdadm.conf >/dev/null 2>&1 || exit 0
|
|
|
|
|
|
usage ()
|
|
{
|
|
echo "Usage: service $prog {start|stop|status|restart|condrestart}"
|
|
RETVAL=1
|
|
}
|
|
|
|
|
|
start ()
|
|
{
|
|
ulimit -S -c 0 >/dev/null 2>&1
|
|
echo -n $"Starting $prog: "
|
|
daemon --check mdadm \
|
|
"/bin/bash -c \"mdadm --monitor --scan -f > /var/run/mdadm.pid\""
|
|
# hack: wait for mdadm to die, assume success if it doesn't die quickly
|
|
usleep 100000
|
|
if [ -s /var/run/mdadm.pid -a -d /proc/$(cat /var/run/mdadm.pid) ] ; then
|
|
success $"mdadm"
|
|
RETVAL=0
|
|
touch /var/lock/subsys/$prog
|
|
else
|
|
failure $"mdadm"
|
|
rm -f /var/run/mdadm.pid
|
|
rm -f /var/lock/subsys/$prog
|
|
RETVAL=1
|
|
fi
|
|
echo
|
|
}
|
|
|
|
stop ()
|
|
{
|
|
echo -n "Killing $prog: "
|
|
killproc mdadm
|
|
echo
|
|
rm -f /var/run/mdadm.pid
|
|
rm -f /var/lock/subsys/$prog
|
|
}
|
|
|
|
restart ()
|
|
{
|
|
stop
|
|
start
|
|
}
|
|
|
|
condrestart ()
|
|
{
|
|
[ -e /var/lock/subsys/$prog ] && restart
|
|
}
|
|
|
|
|
|
case "$1" in
|
|
start) start ;;
|
|
stop) stop ;;
|
|
status) status mdadm ;;
|
|
restart|reload) restart ;;
|
|
condrestart) condrestart ;;
|
|
*) usage ;;
|
|
esac
|
|
|
|
exit $RETVAL
|