aoe-init Script

Note: This script is located at /etc/init.d/aoe-init

#! /bin/sh
# aoe-init – example init script for ATA over Ethernet storage
#
# Edit this script for your purposes. (Changing “eth1″ to the
# appropriate interface name, adding commands, etc.)
#
# Install this script in /etc/init.d with the other init scripts.
#
# Make it executable:
# chmod 755 /etc/init.d/aoe-init
#
# Install symlinks for boot time:
# cd /etc/rc3.d && ln -s ../init.d/aoe-init S99aoe-init
# cd /etc/rc5.d && ln -s ../init.d/aoe-init S99aoe-init
#
# Install symlinks for shutdown time:
# cd /etc/rc0.d && ln -s ../init.d/aoe-init K01aoe-init
# cd /etc/rc1.d && ln -s ../init.d/aoe-init K01aoe-init
# cd /etc/rc2.d && ln -s ../init.d/aoe-init K01aoe-init
# cd /etc/rc6.d && ln -s ../init.d/aoe-init K01aoe-init
#

case “$1″ in
“start”)
# load any needed network drivers here

# replace “eth1″ with your aoe network interface
ifconfig eth1 up
sleep 10 # network interface comes up
# Changed from 3 to 10 since device didn’t initalize. JCSUOMI 04/11/2006

modprobe aoe
sleep 10 # time for AoE discovery and udev
# Changed from 3 to 10 since device didn’t initalize. JCSUOMI 04/11/2006

# add your raid assemble commands here
# Added 04/10/2006 @ 6:38 PM JCSUOMI
mdadm -A /dev/etherd/e1.[0-3]
mdadm -A /dev/md0 /dev/etherd/e1.[0-3]
# add any LVM commands if needed (e.g. vgchange)
# Added 04/10/2006 @ 6:38 PM JCSUOMI
vgscan
vgchange -ay pool0
# add your filesystem mount commands here
# Added 04/10/2006 @ 6:38 PM JCSUOMI
mount /dev/pool0/vol1 /mnt/vol1
test -d /var/lock/subsys && touch /var/lock/subsys/aoe-init
# HOTSPARE AND MONITORING
# Added 04/11/2006 @ 1:23 PM JCSUOMI
# mdadm –monitor –scan –config=/etc/raid5s-mdadm.conf
;;
“stop”)
# add your filesystem umount commands here
# Added 04/10/2006 @ 6:47 PM JCSUOMI
umount /mnt/vol1
# deactivate LVM volume groups if needed
# Added 04/10/2006 @ 6:47 PM JCSUOMI
vgchange -an pool0
# add your raid stop commands here
# Added 04/10/2006 @ 6:47 PM JCSUOMI
mdadm -S /dev/md0
rmmod aoe
rm -f /var/lock/subsys/aoe-init
;;
*)
echo “usage: `basename $0` {start|stop}” 1>&2
;;
esac

Leave a Reply