#!/bin/sh # process this file by running "wget -nc http://www.scriptroute.org/planetlab/planetlab-install && sh ./planetlab-install" # or "curl -A scriptroute-installer -O http://www.scriptroute.org/planetlab/planetlab-install && sh ./planetlab-install" # as a sudo-capable user; the -nc tells wget to overwrite earlier downloads # the -A flag is needed on bgu.ac.il to circumvent a nasty proxy firewall. (PL #127) # on internet2 sites, we'll need proxies to download external # software. i2proxy=http://internet2.proxy.services.planet-lab.org:8080 codeenproxy=http://planetlab1.cs.duke.edu:3128 scriptroute_version=0.4.9 my_host=`hostname` curl="curl -A scriptroute-installer" # yum="yum -c http://www.scriptroute.org/planetlab/yum.conf -d4" # yum="yum -c http://www.scriptroute.org/planetlab/yum.conf" yum="yum" lockfile=/var/tmp/scriptroute-install.lock if grep 2 /etc/redhat-release; then echo "we don't do FC2 planetlab nodes. sorry. " echo "Host '$1' is running FC2" exit 1 fi populate_rpm_dir() { test -d yum-rpms || mkdir yum-rpms cd yum-rpms for i in stock-rh9/python-2.2.2-26.i386.rpm \ stock-rh9/libxml2-python-2.5.4-1.i386.rpm \ stock-rh9/libxml2-2.5.4-1.i386.rpm \ stock-rh9/expat-1.95.5-2.i386.rpm \ stock-rh9/rpm-python-4.2-0.69.i386.rpm \ stock-rh9/elfutils-0.76-3.i386.rpm \ stock-rh9/gmp-4.1.2-2.i386.rpm \ 3rdparty/pycurl-7.10.4-1.i386.rpm \ ; do echo "$my_host downloading $i"; $curl -s -C - -O http://boot.planet-lab.org/install-rpms/$i; test -e `basename $i` || ( echo "apparent failure downloading $i"; exit ) done $curl -s -O http://www.cs.princeton.edu/~alk/yum-2.0.4-1.noarch.rpm # the function returns the exit status of md5sum md5sum --check < $lockfile if ! test -e $lockfile; then echo "WARNING: unable to create lockfile" fi # if (! which yum) || (! yum --version ) || ( (test `rpm -q yum` != yum-2.0.4-1 ) && ( test `yum --version` != "2.0.7" ) ); then ## old planetlab if (! $yum --version ) || ( (test `rpm -q yum` != yum-2.0.4-1 ) && ( test `$yum --version` != "2.0.7" ) ); then ## old planetlab echo ## old planetlab echo it is easier to keep packages up to date if you have yum installed. installing yum. ## old planetlab echo ## old planetlab if populate_rpm_dir; then ## old planetlab echo "md5 check successful" ## old planetlab else ## old planetlab echo "ERROR: downloaded packages md5 check failed; retrying" ## old planetlab rm -f yum-rpms/* ## old planetlab if populate_rpm_dir; then ## old planetlab echo "second md5 check successful" ## old planetlab else ## old planetlab exit 1 ## old planetlab fi ## old planetlab fi ## old planetlab sudo rpm -Uh *.rpm ## old planetlab cd .. ## old planetlab fi ## old planetlab if ! test -e /etc/yum.conf; then ## old planetlab echo "yum does not seem to be installed, even though we tried." ## old planetlab exit 1 ## old planetlab fi ## old planetlab sudo chmod a+r /etc/yum.conf # screw security through obscurity. # if ! grep 3rdparty /etc/yum.conf; then # sudo sh -c "cat >> /etc/yum.conf" <> /etc/yum.conf" #[scriptroute] #name=Scriptroute #baseurl=http://www.scriptroute.org/planetlab # #fi # yum downloads from both, so the internet2 planetlab node # won't work: configure the duke codeen node to act as a # proxy. would be unnecessary if I read Aaron's mail closely. if ! test -z "$http_proxy" && test $http_proxy = $i2proxy; then http_proxy=$codeenproxy export http_proxy fi # meh tries to "update" libpcap due to epoch damage on subsequent # executions: sudo yum update || exit 1 # skip running yum if the programs are already installed. (much faster) if rpm --quiet -q ruby-libs ruby-devel ruby gzip zlib; then echo "ruby already installed" else echo "** running yum to install ruby" sudo $yum -t -y install ruby-libs ruby-devel ruby gzip zlib || ( echo "ERROR: YUM INSTALL OF RUBY FAILED on $my_host!"; exit 1 ) if rpm --quiet -q ruby-libs ruby-devel ruby; then echo "** success!" else echo "** of course yum doesn't work properly while planetlab is at fc stale. trying to do it ourselves." sudo rpm -Uvh http://www.scriptroute.org/planetlab/ruby-1.8.4-3.fc4.i386.rpm http://www.scriptroute.org/planetlab/ruby-devel-1.8.4-3.fc4.i386.rpm http://www.scriptroute.org/planetlab/ruby-libs-1.8.4-3.fc4.i386.rpm fi fi # 2008-08-25 rpm --quiet -q bash || sudo $yum -t -y install bash # end 2008-08-25 rpm --quiet -q libpcap || sudo $yum -t -y install libpcap rpm --quiet -q libpcap || sudo rpm -Uvh http://www.scriptroute.org/planetlab/libpcap-0.8.3-14.FC4.i386.rpm # rpm --quiet -q libpcap-0.8.1a-1 || sudo rpm -Uvh http://www.scriptroute.org/planetlab/libpcap-0.8.1a-1.i386.rpm rpm --quiet -q undns-0.1.26-1 || sudo rpm -Uvh http://www.scriptroute.org/redhat/undns-0.1.26-1.i386.rpm sudo rpm -Uvh http://www.scriptroute.org/planetlab/scriptroute-client-0.4.9-1.i386.rpm # http://www.scriptroute.org/planetlab/scriptroute-0.4.91.i386.rpm # to install the server, which you don't want to do: if test "$install_server" = "yes"; then echo "** attempting to install scriptroute server" echo "** please don't do this unless you really know what you're doing." # somehow these libraries tend to get installed badly, or lose files, or something. sudo $yum -t -y install ntp sudo $yum -t -y install libgcrypt libgpg-error echo "** libgpg-error doublecheck" rpm --quiet -q libgpg-error || sudo rpm --force -i http://www.scriptroute.org/planetlab/libgpg-error-0.5-1.i386.rpm http://www.scriptroute.org/planetlab/libgcrypt-1.1.44-1.i386.rpm echo "** libgcrypt doublecheck" rpm --quiet -q libgcrypt || sudo rpm --force -i http://www.scriptroute.org/planetlab/libgpg-error-0.5-1.i386.rpm http://www.scriptroute.org/planetlab/libgcrypt-1.1.44-1.i386.rpm echo "** now installing the server" # try all combinations, as I can't figure out how to make this work reliably otherwise sudo rpm -Uvh http://www.scriptroute.org/planetlab/scriptroute-server-0.4.9-1.i386.rpm sudo rpm -Uvh http://www.scriptroute.org/planetlab/scriptroute-thttpd-0.4.9-1.i386.rpm sudo rpm -Uvh http://www.scriptroute.org/planetlab/scriptroute-0.4.9-1.i386.rpm sudo rpm -Uvh http://www.scriptroute.org/planetlab/scriptroute-server-0.4.9-1.i386.rpm http://www.scriptroute.org/planetlab/scriptroute-0.4.9-1.i386.rpm sudo rpm -Uvh http://www.scriptroute.org/planetlab/scriptroute-server-0.4.9-1.i386.rpm http://www.scriptroute.org/planetlab/scriptroute-0.4.9-1.i386.rpm http://www.scriptroute.org/planetlab/scriptroute-client-0.4.9-1.i386.rpm http://www.scriptroute.org/planetlab/scriptroute-thttpd-0.4.9-1.i386.rpm if rpm --quiet -q scriptroute-server-0.4.9-1; then echo "** scriptroute server installed" fi fi # we're done. rm $lockfile echo 'now run sr-rockettrace www.cs.washington.edu' echo 'you may have to type "rehash" first' echo 'to find other tools, type "sr" and hit a couple times' echo 'to see what your shell finds' echo "** scriptroute client installation complete on $my_host, assuming the above was ok"