#!/bin/bash
+. /etc/init.d/pl_functions
+
. /tmp/planet.cnf
# Run gpg once to create default options
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* /etc/resolv.conf) ; do
- echo $(date "+%H:%M:%S") contents of $file :
- cat $file
- echo $(date "+%H:%M:%S") end of $file :
- done
;;
60)
echo $(date "+%H:%M:%S") " This error likely indicates that the hardware clock is likely not set "
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
--- /dev/null
+#-*-shell-script-*-
+
+function verbose_show_message () {
+ echo $(date "+%H:%M:%S") " ==================== " "$@"
+}
+
+function verbose_run_command () {
+ echo $(date "+%H:%M:%S") " ========== running" "$@"
+ "$@"
+ echo $(date "+%H:%M:%S") " ==========" "$@" "returned with retcod=$?"
+}
+
+function pl_network_sanity_checks () {
+ echo $(date "+%H:%M:%S") " ======================================== BEG SANITY CHECKS"
+ for file in $(ls /etc/resolv.conf /etc/sysconfig/network-scripts/ifcfg-eth* ) ; do
+ verbose_run_command cat $file
+ done
+ verbose_show_message Loaded modules
+ verbose_run_command lsmod
+ verbose_show_message Configured interfaces
+ verbose_run_command ifconfig
+ verbose_show_message Routing table
+ verbose_run_command netstat -rn
+ verbose_show_message Pinging google public DNS
+ verbose_run_command ping -c 1 -w 5 8.8.8.8
+ # try to resolve this hostname as that's the one used for ntp
+ dnss=$(grep '^nameserver' /etc/resolv.conf 2>/dev/null | awk '{print $2;}')
+ if [ -z "$dnss" ] ; then
+ # not too helpful, but..
+ verbose_show_message No server found in /etc/resolv.conf - Resolving hostname at the google public DNS
+ verbose_run_command host -W 4 pool.ntp.org 8.8.8.8
+ else
+ for dns in $dnss; do
+ verbose_show_message Resolving hostname at $dns
+ verbose_run_command host -W 4 pool.ntp.org $dns
+ done
+ fi
+ echo $(date "+%H:%M:%S") " ======================================== END SANITY CHECKS"
+}
+
#!/bin/sh
+#-*-shell-script-*-
# the name of the floppy based network configuration
# files (checked first). the name planet.cnf is kept
#!/bin/sh
+. /etc/init.d/pl_functions
+
echo ""
echo "PlanetLab BootCD - distro @PLDISTRO@ based on @FCDISTRO@"
echo $(date "+%H:%M:%S") "pl_sysinit: bringing network online"
/etc/init.d/pl_netinit
+# just in case, sometimes we're seeing weird stuff already at this point
+pl_network_sanity_checks
+
echo ""
echo $(date "+%H:%M:%S") "pl_sysinit: attempting to sync clock"
/usr/sbin/ntpdate -b -t 10 -u pool.ntp.org
# Install initscripts
echo "* Installing initscripts"
-for file in pl_sysinit pl_hwinit pl_netinit pl_validateconf pl_boot ; do
+for file in pl_functions pl_sysinit pl_hwinit pl_netinit pl_validateconf pl_boot ; do
sed -i -e "s,@PLDISTRO@,$pldistro,g" -e "s,@FCDISTRO@,$fcdistro,g" initscripts/$file
install -D -m 755 initscripts/$file $bootcd/etc/init.d/$file
done