#cd /etc/rc.d/init.d
#vi iscsi
###Start
case "$1" in
start)
echo -n "Starting RAID : "
/bin/sh /root/starraid.sh
;;
stop)
echo -n "Stopping RAID : "
/bin/sh /root/closraid.sh
;;
status)
echo -n "Status RAID : "
/bin/cat /proc/mdstat
;;
restart)
echo -n "Stopping RAID : "
/bin/sh /root/closraid.sh
echo -n "Starting RAID : "
/bin/sh /root/starraid.sh
;;
*)
echo "Usage: raid {start|stop|status|restart}"
exit 1
esac
###End
之後就可透過service iscsi restart 自動啟動了。
裡面的script,當然是要自己寫了,裡面要做什麼動作,就可自行發揮了
#chkconfig raid on,開機即會自行啟動