X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=initscripts%2Fpl_boot;h=417a1839a678bb10a137c318024c8e35b4e2defc;hb=0597762b242c534572d27be7b895304923b4cc82;hp=52ddd2cb704b6b96305db82b30b75cc6ac6bff71;hpb=6d24faea133bcec8a5e03d7c0571cbe6af8b833a;p=bootcd.git diff --git a/initscripts/pl_boot b/initscripts/pl_boot index 52ddd2c..417a183 100755 --- a/initscripts/pl_boot +++ b/initscripts/pl_boot @@ -1,5 +1,16 @@ #!/bin/bash +### xxx tmp debug + +set -x +echo pl_boot on console > /dev/console +exec 2>&1 +exec > /dev/console +echo pl_boot plain + +### +. /etc/init.d/pl_functions + . /tmp/planet.cnf # Run gpg once to create default options @@ -20,11 +31,11 @@ ATTEMPTS_BEFORE_BACKUP=3 BOOT_DIR=/usr/boot/ # get the server we are going to be contacting -BOOT_SERVER=`cat $BOOT_DIR/boot_server` -BOOT_SERVER_PORT=`cat $BOOT_DIR/boot_server_port` +BOOT_SERVER=$(cat $BOOT_DIR/boot_server) +BOOT_SERVER_PORT=$(cat $BOOT_DIR/boot_server_port) # the file to request from the boot server -BOOT_SERVER_PATH=`cat $BOOT_DIR/boot_server_path` +BOOT_SERVER_PATH=$(cat $BOOT_DIR/boot_server_path) # location of the cacert for this boot server BOOT_SERVER_CACERT=$BOOT_DIR/cacert.pem @@ -33,11 +44,11 @@ BOOT_SERVER_CACERT=$BOOT_DIR/cacert.pem BOOT_SERVER_GPG_KEYRING=$BOOT_DIR/pubring.gpg # get the backup server we are going to be contacting -BACKUP_BOOT_SERVER=`cat $BOOT_DIR/backup/boot_server` -BACKUP_BOOT_SERVER_PORT=`cat $BOOT_DIR/backup/boot_server_port` +BACKUP_BOOT_SERVER=$(cat $BOOT_DIR/backup/boot_server) +BACKUP_BOOT_SERVER_PORT=$(cat $BOOT_DIR/backup/boot_server_port) # the file to request from the backup boot server -BACKUP_BOOT_SERVER_PATH=`cat $BOOT_DIR/backup/boot_server_path` +BACKUP_BOOT_SERVER_PATH=$(cat $BOOT_DIR/backup/boot_server_path) # location of the cacert for the backup boot server BACKUP_BOOT_SERVER_CACERT=$BOOT_DIR/backup/cacert.pem @@ -105,11 +116,7 @@ while : ; do if [[ $contact_count != 0 ]]; then - if [[ $on_backup_server == 1 ]]; then - echo $(date "+%H:%M:%S") " pl_boot: attempting to fetch script from backup server in 30s" - else - echo $(date "+%H:%M:%S") " pl_boot: attempting to fetch script from primary server in 30s" - fi + echo $(date "+%H:%M:%S") " pl_boot: next attempt in 30s, to fetch script from server at $CONNECT_BOOT_SERVER" /bin/sleep 30 fi @@ -168,13 +175,9 @@ while : ; do echo $(date "+%H:%M:%S") " we recommend checking your DNS settings. If you cannot, then " echo $(date "+%H:%M:%S") " please double check your network settings registered at PLC and " echo $(date "+%H:%M:%S") " stored on this Boot Image." - for file in `ls /etc/sysconfig/network-scripts/ifcfg-eth*` ; do - echo $(date "+%H:%M:%S") $file : - cat $file - done ;; 60) - echo $(date "+%H:%M:%S") " This error likely indicates that the hardware clock is not set " + echo $(date "+%H:%M:%S") " This error likely indicates that the hardware clock is likely not set " echo $(date "+%H:%M:%S") " to GMT. The result is that authentication between the local and " echo $(date "+%H:%M:%S") " remote site fails. Please double check this machine's system " echo $(date "+%H:%M:%S") " clock, and set it to GMT in the BIOS. If after rebooting the same " @@ -187,6 +190,9 @@ while : ; do echo $(date "+%H:%M:%S") " with as much detail as possible." ;; esac + # in any case display as much info as we can (see pl_functions) + pl_network_sanity_checks + # retry continue fi elif [ -n "$DISCONNECTED_OPERATION" ]; then