|
From: Matt <mat...@us...> - 2007-07-05 16:23:08
|
Update of /cvsroot/openqrm/plugins/linuxcoe/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8032/plugins/linuxcoe/etc Modified Files: pxe-template.preseed post-install-openqrm.preseed Log Message: progressing with debian auto-installations :) Index: post-install-openqrm.preseed =================================================================== RCS file: /cvsroot/openqrm/plugins/linuxcoe/etc/post-install-openqrm.preseed,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** post-install-openqrm.preseed 27 Jun 2007 15:53:49 -0000 1.1 --- post-install-openqrm.preseed 5 Jul 2007 16:23:03 -0000 1.2 *************** *** 1,26 **** #!/bin/bash ! # TODO ! OPENQRM_CLIENT_INTERFACE=`` ! # check which rpm will fit best ! OPENQRM_RESOURCE_RPM="" ! echo "using $OPENQRM_CLIENT_INTERFACE for $LOCAL_VE_NAME" ! echo "installing $OPENQRM_RESOURCE_RPM" ! while ! wget http://downloads.sourceforge.net/openqrm/$OPENQRM_RESOURCE_RPM?; do ! echo "retrying ..." ! sleep 2 ! if wget http://downloads.sourceforge.net/openqrm/$OPENQRM_RESOURCE_RPM?; then ! echo "success ..." break fi done ! rpm -ihv $OPENQRM_RESOURCE_RPM ! echo "y" | /opt/qrm/resource/sbin/qrm-bootstrap integrate -q ${QRM_SERVER_IP_ADDRESS} -v ${LOCAL_VE_NAME} -i $OPENQRM_CLIENT_INTERFACE -t "" --- 1,125 ---- #!/bin/bash ! INSTALL_TIME=`date +%D-%T | sed -e "s#/#.#g" | sed -e "s#:#.#g"` ! LOCAL_VE_NAME="linuxcoeZZZ_LINUXCOE_PROFILE_ZZZ-$INSTALL_TIME" ! OPENQRM_BOOTSTRAP="/opt/qrm/resource/sbin/qrm-bootstrap" ! OPENQRM_NODES_BASE_DIR="/opt" ! OPENQRM_RESOURCE_CONF="/var/qrm/conf/qrm.conf" ! LINUXCOE_INSTALL_CONF="/etc/opt/LinuxCOE/args" ! # package selection ! OPENQRM_RESOURCE_DEB_PACKAGE="openqrm-core-resource-3.1.4-2_i386.deb" ! # retry config ! RETRY_DELAY=10 ! RETRY_COUNT=10 ! RETRY_LOOP=0 ! DOWNLOAD_RETRY=5 ! DOWNLOAD_LOOP=0 ! function linuxcoe_log() { ! echo $@ ! echo $@ | logger ! } ! # needed for gathering the openQRM interface ! if [ ! -f $LINUXCOE_INSTALL_CONF ]; then ! linuxcoe_log "ERROR: Could not find installation config file $LINUXCOE_INSTALL_CONF" ! exit 1 ! fi ! # really Suse based ? ! if [ ! -f /etc/SuSE-release ]; then ! linuxcoe_log "ERROR: Could not find /etc/SuSE-release" ! exit 1 ! fi ! # is network already up ? ! # since this is started from rc.local it may run ! # before the network is initialysed. ! if ! ping -c 1 -W 1 ZZZ_QRM_SERVER_IP_ADDRESS_ZZZ 1>/dev/null; then ! linuxcoe_log "NOTICE: Network not initialysed yet. Running again later." ! exit 0 ! fi ! ! . $LINUXCOE_INSTALL_CONF ! OPENQRM_CLIENT_INTERFACE=$NETDEV ! if [ "$NETDEV" == "" ]; then ! linuxcoe_log "ERROR: Could not find the network-interface to use for the openQRM integration!" ! exit 1 ! fi ! ! ! linuxcoe_log "using $OPENQRM_CLIENT_INTERFACE for $LOCAL_VE_NAME" ! linuxcoe_log "installing $OPENQRM_RESOURCE_DEB_PACKAGE" ! ! if [ ! -d /root ]; then ! mkdir -p /root ! fi ! while (true); do ! /bin/rm -f $OPENQRM_RESOURCE_DEB_PACKAGE ! if wget -O /root/$OPENQRM_RESOURCE_DEB_PACKAGE http://downloads.sourceforge.net/openqrm/$OPENQRM_RESOURCE_DEB_PACKAGE?; then ! linuxcoe_log "NOTICE: Successfully downloaded $OPENQRM_RESOURCE_DEB_PACKAGE" break + else + linuxcoe_log "WARNING: Could not download $OPENQRM_RESOURCE_DEB_PACKAGE, retrying ..." + DOWNLOAD_LOOP=$(( DOWNLOAD_LOOP + 1 )) + if [ "$DOWNLOAD_LOOP" == "$DOWNLOAD_RETRY" ]; then + linuxcoe_log "ERROR: Max. download-retry count is reached. Exiting !" + linuxcoe_log "ERROR: Please try to integrate it manually." + exit 1 + fi + sleep $RETRY_DELAY fi done ! linuxcoe_log "NOTICE: installing $OPENQRM_RESOURCE_DEB_PACKAGE" ! dpkg -i /root/$OPENQRM_RESOURCE_DEB_PACKAGE ! # before we integrate the debian system we need to make sure we have the "ip" utils ! # so we "apt-get install iproute" ! linuxcoe_log "NOTICE: Installing iproute ! Required for the openQRM-agents." ! echo y | apt-get install iproute + # trying hard to integrate the node + linuxcoe_log "NOTICE: Starting the openQRM-integration" + while (true); do + while (true); do + echo "y" | $OPENQRM_BOOTSTRAP integrate -q ZZZ_QRM_SERVER_IP_ADDRESS_ZZZ -v $LOCAL_VE_NAME -i $OPENQRM_CLIENT_INTERFACE -t "" + if [ -f "$OPENQRM_RESOURCE_CONF" ]; then + . $OPENQRM_RESOURCE_CONF + if [ "$CR_ID" != "" ]; then + linuxcoe_log "NOTICE: Successfully added the new resource with CR_ID $CR_ID" + break + else + linuxcoe_log "WARNING: Could not receive valid resource parameters ! Retrying ..." + fi + else + linuxcoe_log "WARNING: Could not add new resource, ... retrying, removing first." + $OPENQRM_BOOTSTRAP remove + sleep $RETRY_DELAY + fi + done + # start the openQRM node-agents + linuxcoe_log "NOTICE: openQRM-integration complete. Starting the openQRM node-agents" + $OPENQRM_NODES_BASE_DIR/qrm/etc/init.d/qrm start + sleep 2 + + # check if everything is running ok + if ps ax | grep qrm-infod 1>/dev/null; then + linuxcoe_log "NOTICE: Successfully started the openQRM node-agents" + break + else + linuxcoe_log "ERROR: Could not start the openQRM node-agents!" + linuxcoe_log "ERROR: ... retrying to integrate the resource, removing first." + $OPENQRM_BOOTSTRAP remove + sleep $RETRY_DELAY + fi + + RETRY_LOOP=$(( RETRY_LOOP + 1 )) + if [ "$RETRY_LOOP" == "$RETRY_COUNT" ]; then + linuxcoe_log "ERROR: Max. retry-count is reached. Could not integrate the resource into openQRM!" + linuxcoe_log "ERROR: Please try to integrate it manually." + exit 1 + fi + + done Index: pxe-template.preseed =================================================================== RCS file: /cvsroot/openqrm/plugins/linuxcoe/etc/pxe-template.preseed,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pxe-template.preseed 29 Jun 2007 21:52:47 -0000 1.3 --- pxe-template.preseed 5 Jul 2007 16:23:02 -0000 1.4 *************** *** 3,6 **** label linux kernel boot/res-${LINUXCOE_RESOURCE_ID}-kernel ! append ramdisk_size=131072 initrd=boot/res-${LINUXCOE_RESOURCE_ID}-initrd.img preseed/url=http://${QRM_SERVER_IP_ADDRESS}/plugins/linuxcoe/inst/preseed${LINUXCOE_PROFILE}.cfg root=/dev/ram rw debconf/priority=critical debian-installer/framebuffer=false --- 3,6 ---- label linux kernel boot/res-${LINUXCOE_RESOURCE_ID}-kernel ! append ramdisk_size=131072 initrd=boot/res-${LINUXCOE_RESOURCE_ID}-initrd.img languagechooser/language-name=${LINUXCOE_INSTALL_LANGUAGE} auto=true preseed/url=http://${QRM_SERVER_IP_ADDRESS}/plugins/linuxcoe/inst/preseed${LINUXCOE_PROFILE}.cfg root=/dev/ram rw debconf/priority=critical debian-installer/framebuffer=false |