[Comm] Re: Software RAID-5 & XFS trouble

Konstantin A. Lepikhov =?iso-8859-1?q?lakostis_=CE=C1_anti-leasure=2Eru?=
Чт Сен 30 23:06:19 MSD 2004


Hi Овечкин!

Thursday 30, at 09:50:20 AM you wrote:

<skip>
> > ужасть. Хотите дам приличный init.d скрипт для мониторинга? :)
> Был бы очень признателен.
ловите

-- 
WBR, Konstantin	      chat with ==>ICQ: 109916175
     Lepikhov,	      speak  to ==>JID: lakostis на jabber.org
aka L.A. Kostis       write  to ==>mailto:lakostis на pisem.net.nospam

...The information is like the bank... 			  (c) EC8OR
----------- следующая часть -----------
#!/bin/sh
# 
# Start the RAID monitor daemon for all active md arrays if desired.
#
# based on init.d script of Mario Jou/3en <joussen на debian.org>
# modified for ALTLinux by LAKostis <lakostis at altlinux dot ru>
#
# chkconfig: 345 90 10
# description:	mdadm monitors all active md arrays
# processname: mdadm
# pidfile: /var/run/mdadm.pid

# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions

BINARY=/usr/sbin/mdadm
CONFIG=/etc/mdadm.conf
LOCKFILE=/var/lock/subsys/mdadm
MAIL_TO=root
ARRAYS="`sed -ne 's/^\(md[[:digit:]]\+\) : active.*/\1/p' /proc/mdstat`"
RETVAL=0

# if overriding these is needed
SourceIfNotEmpty /etc/sysconfig/mdadm

start()
{
	if [ -n "$ARRAYS" ] ; then
	    if [ -e /dev/.devfsd ] ; then
		 ARRAYS="`echo $ARRAYS | sed -e 's%md%/dev/md/%g'`"
	    else
	        ARRAYS="`echo $ARRAYS | sed -e 's%md%/dev/md%g'`"
	    fi
	    start_daemon --lockfile "$LOCKFILE" --expect-user root -- \
			 $BINARY -F -f -m $MAIL_TO $ARRAYS
	else
	    echo " no arrays for monitoring were found."
	fi
	RETVAL=$?
	return $RETVAL
}

stop()
{
        stop_daemon --lockfile "$LOCKFILE" --expect-user root -- mdadm
	RETVAL=$?
	return $RETVAL
}

restart()
{
	stop
	start
}

# See how we were called.
case "$1" in
	start)
		start
		;;
	stop)
		stop
		;;
	reload)
		restart
		;;
	restart)
		restart
		;;
	condstop)
		if [ -e "$LOCKFILE" ]; then
			stop
		fi
		;;
	condrestart)
		if [ -e "$LOCKFILE" ]; then
			restart
		fi
		;;
	condreload)
		if [ -e "$LOCKFILE" ]; then
			reload
		fi
		;;
	status)
		status --expect-user root -- mdadm
		RETVAL=$?
		;;
	*)
		msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
		RETVAL=1
esac

exit $RETVAL


Подробная информация о списке рассылки community