Fix/cleanup mdmonitor init script

This commit is contained in:
Doug Ledford 2005-05-16 22:03:20 +00:00
parent 67c8300cd8
commit 2f225ca405
2 changed files with 12 additions and 18 deletions

View File

@ -1,7 +1,7 @@
Summary: mdadm controls Linux md devices (software RAID arrays)
Name: mdadm
Version: 1.11.0
Release: 3.fc4
Release: 4.fc4
Source: http://www.cse.unsw.edu.au/~neilb/source/mdadm/mdadm-%{version}.tgz
Source1: mdmonitor.init
Source2: mdmpd-0.4.tgz
@ -81,12 +81,16 @@ fi
%attr(0700,root,root) %dir /var/run/mdadm
%changelog
* Mon May 16 2005 Doug Ledford <dledford@redhat.com> 1.11.0-4.fc4
- Make the mdmonitor init script use the pid-file option, major cleanup
of the script now possible (#134459)
* Mon May 16 2005 Doug Ledford <dledford@redhat.com> 1.11.0-3.fc4
- Put back the obsoletes: raidtools that was present in 1.11.0-1.fc4
* Mon May 16 2005 Doug Ledford <dledford@redhat.com> 1.11.0-2.fc4
- Change the default auto= mode so it need not be on the command line to
work with udev, however it is still supported on the command line.
work with udev, however it is still supported on the command line (#132706)
- Add a man page (from Luca Berra) for mdassemble
* Wed May 11 2005 Doug Ledford <dledford@redhat.com> - 1.11.0-1.fc4

View File

@ -12,6 +12,7 @@
PATH=/sbin:/usr/sbin:$PATH
RETVAL=0
OPTIONS="--monitor --scan -f --pid-file=/var/run/mdadm/mdadm.pid"
prog=mdmonitor
@ -33,31 +34,20 @@ usage ()
start ()
{
ulimit -S -c 0 >/dev/null 2>&1
echo -n $"Starting $prog: "
daemon --check mdadm --user=root \
"/bin/bash -c \"mdadm --monitor --scan -f > /var/run/mdadm/mdadm.pid\""
# hack: wait for mdadm to die, assume success if it doesn't die quickly
usleep 100000
if [ -s /var/run/mdadm/mdadm.pid -a -d /proc/$(cat /var/run/mdadm/mdadm.pid) ] ; then
success $"mdadm"
RETVAL=0
touch /var/lock/subsys/$prog
else
failure $"mdadm"
rm -f /var/run/mdadm/mdadm.pid
rm -f /var/lock/subsys/$prog
RETVAL=1
fi
daemon --check --user=root mdadm ${OPTIONS}
ret=$?
[ $ret -eq "0" ] && touch /var/lock/subsys/$prog
echo
return $ret
}
stop ()
{
[ -f /var/lock/subsys/$prog ] || return 0
echo -n "Killing $prog: "
killproc mdadm
echo
rm -f /var/run/mdadm/mdadm.pid
rm -f /var/lock/subsys/$prog
}