#!/bin/sh # # description: Starts and stops the iSCSI initiator # # processname: blkmapd # pidfile: /var/run/blkmapd.pid # config: /etc/blkmapd.conf # Source function library. if [ -f /etc/init.d/functions ] ; then . /etc/init.d/functions elif [ -f /etc/rc.d/init.d/functions ] ; then . /etc/rc.d/init.d/functions else exit 0 fi PATH=/sbin:/bin:/usr/sbin:/usr/bin RETVAL=0 start() { echo -n $"Starting pNFS block-layout device discovery service: " modprobe -q blocklayoutdriver daemon /usr/sbin/blkmapd RETVAL=$? if [ $RETVAL -eq 0 ]; then touch /var/lock/subsys/blkmapd fi echo return $RETVAL } stop() { echo -n $"Stopping pNFS block-layout device discovery service: " killproc blkmapd 2> /dev/null rm -f /var/run/blkmapd.pid RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/blkmapd if [ $RETVAL -eq 0 ]; then echo_success else echo_failure fi echo return $RETVAL } restart() { stop start } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; status) status blkmapd ;; *) echo $"Usage: $0 {start|stop|restart|status}" exit 1 esac exit $RETVAL