mdadm/mdmonitor.init
cvsdist 82c655e83f auto-import changelog data from mdadm-1.0.0-5.src.rpm
Fri Jun 21 2002 Tim Powers <timp@redhat.com>
- automated rebuild
Thu May 23 2002 Tim Powers <timp@redhat.com>
- automated rebuild
Wed May 15 2002 Michael K. Johnson <johnsonm@redhat.com>
- minor cleanups to the text, conditionalize rm -rf
- added mdmonitor init script
Fri May 10 2002 <neilb@cse.unsw.edu.au>
- update to 1.0.0
- Set CXFLAGS instead of CFLAGS
Sat Apr 06 2002 <neilb@cse.unsw.edu.au>
- change %install LANG=C export LANG to use "make install"
Fri Mar 15 2002 <gleblanc@localhost.localdomain>
- beautification
- made mdadm.conf non-replaceable config
- renamed Copyright to License in the header
- added missing license file
- used macros for file paths
Fri Mar 15 2002 Luca Berra <bluca@comedia.it>
- Added Obsoletes: mdctl
- missingok for configfile
Tue Mar 12 2002 NeilBrown <neilb@cse.unsw.edu.au>
- Add md.4 and mdadm.conf.5 man pages
Fri Mar 08 2002 Chris Siebenmann <cks@cquest.utoronto.ca>
- builds properly as non-root.
Fri Mar 08 2002 Derek Vadala <derek@cynicism.com>
- updated for 0.7, fixed /usr/share/doc and added manpage
Tue Aug 07 2001 Danilo Godec <danci@agenda.si>
- initial RPM build
2004-09-09 08:24:56 +00:00

81 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
#
# mdmonitor This starts, stops, and reloads the mdadm-based
# software RAID monitoring and management facility
#
# chkconfig: 2345 99 99
# 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: "
mdadm --monitor --scan &
echo $! > /var/run/mdadm.pid
# hack: wait for mdadm to die, assume success if it doesn't die quickly
usleep 100000
if [ -d /proc/$(cat /var/run/mdadm.pid) ] ; then
success $"mdadm"
RETVAL=0
else
failure $"mdadm"
RETVAL=1
fi
touch /var/lock/subsys/$prog
}
stop ()
{
killproc mdadm
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