#!/bin/sh # # # chkconfig: 2345 49 88 # description: Set hostname WITHOUT_RC_COMPAT=1 PROPAGATOR_IMAGE_DIR=/image EVMS_CONF_FILE=/etc/evms.conf RETVAL=0 # Source function library. . /etc/init.d/functions # find block device name corresponding to given block device name find_device() { find /sys/devices/ -path "*/$1" |head -n1| sed -n 's|.*block/\([^/]\+\).*|\1|p' } tune_evms() { # exclude source devices local exclude= local dev= local mpoint= local fstype= local opts= local dummy= while read dev mpoint fstype opts dummy; do [ "$mpoint" = '/' -o "$mpoint" = "$PROPAGATOR_IMAGE_DIR" ] || continue dev="$(readlink -e "$dev")" [ -z "$dev" -o -n "${dev%%/dev/*}" ] || exclude="$exclude $(find_device ${dev##*/})" done /proc/sys/dev/raid/speed_limit_max } start() { local msg="Tuning evms config" echo -n "$msg " tune_evms RETVAL=$? [ $RETVAL -eq 0 ] && success "$msg" || failure "$msg" echo return $RETVAL } stop() { true } restart() { stop start } # See how we were called. case "$1" in start) start ;; stop|condstop|status) ;; restart|reload|condrestart|condreload) ;; *) msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}" RETVAL=1 esac exit $RETVAL