#! /bin/csh -f # # script for setting up one of the "crush" cluster nodes # # # install RedHat 7.3 # configure BIOS to boot from first "MBA" device # plug in eth0 to the network # make sure hardware address is in /etc/dhcpd.conf on graphics1 # use "NFS image" from graphics1 as /home/programs/install/RedHat7.3/ # # use text mode # Mouse: Logitech MouseMan/FirstMouse # use IP 192.168.2.x # NM 255.255.0.0 # GW 192.168.1.1 # DNS 192.168.1.1 # Custom # use disk druid # Partition with "/boot"=100MB "/"=4.6GB, 8x2048 swaps, and the rest in "/local" # use LILO # NO firewall # NO graphical login # these are csh commands tcsh # doing this for the first time? # F-secure #ssh-keygen2 #echo "Key id_dsa_2048_a.pub" > .ssh2/authorization #echo "IdKey id_dsa_2048_a" > .ssh2/identification # OpenSSH #ssh-keygen #cp .ssh/id_dsa.pub .ssh/authorized_keys2 # copy global files from server cd / set files = ( /etc/hosts /etc/passwd /etc/shadow /etc/group /etc/resolv.conf /etc/mosix.map ) foreach file ( $files ) if(-e $file) cp -p $file ${file}.orig end ssh server "cd / ; tar cf - $files" | tar xvf - #yes pwconv # enable rsh, rlogin, rexec echo "+" >! /etc/hosts.equiv foreach file ( `grep -l rhosts /etc/pam.d/*` ) cp ${file} ${file}.orig awk '/rhosts/{$0=$0 " no_rhosts promiscuous"} {print}' ${file}.orig >! $file end # create needed directories for NFS ln -sf /home/programs /programs mkdir /data /data2 /data3 /data4 /share if (-e /local) then chmod a+rwxt /local mkdir /local/tmp chmod a+rwxt /local/tmp rm -rf /tmp ln -sf /local/tmp /tmp mkdir /local/data chmod a+rwxt /local/data endif tar cCf /usr - src | tar xvCf /local - cd /usr rm -rf src ln -sf /local/src . cp -p /etc/fstab /etc/fstab.orig grep -v cdrom /etc/fstab.orig >! /etc/fstab cat << EOF >> /etc/fstab /dev/cdrom /dvdrom auto noauto,users,ro,unhide 0 0 graphics1:/home /home nfs rw,rsize=8192,wsize=8192,async,soft,intr,bg,tcp,noatime,nodev,nolock server:/data /data nfs rw,rsize=8192,wsize=8192,async,soft,intr,bg,tcp,noatime,nodev,nolock server:/data2 /data2 nfs rw,rsize=8192,wsize=8192,async,soft,intr,bg,tcp,noatime,nodev,nolock server:/share /share nfs rw,rsize=8192,wsize=8192,async,soft,intr,bg,tcp,noatime,nodev,nolock EOF # make sure this works /etc/init.d/ipchains stop mount -a -t nfs cat << EOF >! /etc/exports /local 192.168.0.0/255.255.0.0(rw,insecure,no_root_squash) EOF # make sure we keep good time rdate -s cgsrv.als.lbl.gov ; hwclock -w cp -p /etc/ntp.conf /etc/ntp.conf.orig cat << EOF >> /etc/ntp.conf server cgsrv.als.lbl.gov server usno.pa-x.dec.com server time.nist.gov server tick.ucla.edu EOF cp -p /etc/rc.local /etc/rc.local.orig cat << EOF >> /etc/rc.local # fix the damn clock rdate -s cgsrv.als.lbl.gov hwclock -w EOF cat << EOF >! /etc/cron.daily/rdate #!/bin/sh /usr/bin/rdate -s server /usr/sbin/hwclock -w EOF # set up printer printconf-tui # make a printer called hp2100tn JETDIRECT with IP: "printer" (Postscript Printer) # set up runlevel # ntsysv # chkconfig --list | awk 'NF>5{print "chkconfig", $1, substr($7,3)} NF<3{print "chkconfig", substr($1,1,length($1)-1), $2}' | sort +1 chkconfig --level 35 aep1000 off chkconfig --level 35 amandaidx off chkconfig --level 35 amanda off chkconfig --level 35 amd off chkconfig --level 35 amidxtape off chkconfig --level 35 anacron on chkconfig --level 35 apmd off chkconfig --level 35 arpwatch off chkconfig --level 35 atalk off chkconfig --level 35 atd on chkconfig --level 35 autofs off chkconfig --level 35 bcm5820 off chkconfig --level 35 bgpd off chkconfig --level 35 bootparamd off chkconfig --level 35 chargen off chkconfig --level 35 chargen-udp off chkconfig --level 35 comsat off chkconfig --level 35 crond on chkconfig --level 35 daytime on chkconfig --level 35 daytime-udp on chkconfig --level 35 dbskkd-cdb off chkconfig --level 35 dhcpd off chkconfig --level 35 echo on chkconfig --level 35 echo-udp on chkconfig --level 35 eklogin off chkconfig --level 35 finger on chkconfig --level 35 gated off chkconfig --level 35 gpm on chkconfig --level 35 gssftp off chkconfig --level 35 httpd off chkconfig --level 35 identd on chkconfig --level 35 imap off chkconfig --level 35 imaps off chkconfig --level 35 innd off chkconfig --level 35 ip6tables on chkconfig --level 35 ipchains off chkconfig --level 35 ipop2 off chkconfig --level 35 ipop3 off chkconfig --level 35 iptables off chkconfig --level 35 irda off chkconfig --level 35 iscsi off chkconfig --level 35 isdn off chkconfig --level 35 isicom off chkconfig --level 35 junkbuster off chkconfig --level 35 kadmin off chkconfig --level 35 kdcrotate off chkconfig --level 35 keytable on chkconfig --level 35 klogin off chkconfig --level 35 kotalk off chkconfig --level 35 kprop off chkconfig --level 35 krb524 off chkconfig --level 35 krb5kdc off chkconfig --level 35 krb5-telnet off chkconfig --level 35 kshell off chkconfig --level 35 ktalk off chkconfig --level 35 kudzu on chkconfig --level 35 ldap off chkconfig --level 35 lpd on chkconfig --level 35 mars-nwe off chkconfig --level 35 microcode_ctl off chkconfig --level 35 mysqld off chkconfig --level 35 named off chkconfig --level 35 netdump off chkconfig --level 35 netdump-server off chkconfig --level 35 netfs on chkconfig --level 35 network on chkconfig --level 35 nfslock on chkconfig --level 35 nfs on chkconfig --level 35 nscd on chkconfig --level 35 ntalk on chkconfig --level 35 ntpd on chkconfig --level 35 ospf6d off chkconfig --level 35 ospfd off chkconfig --level 35 pcmcia off chkconfig --level 35 pop3s off chkconfig --level 35 portmap on chkconfig --level 35 postgresql off chkconfig --level 35 pxe off chkconfig --level 35 radvd off chkconfig --level 35 random on chkconfig --level 35 rarpd off chkconfig --level 35 rawdevices on chkconfig --level 35 reconfig on chkconfig --level 35 rexec on chkconfig --level 35 rhnsd off chkconfig --level 35 ripd off chkconfig --level 35 ripngd off chkconfig --level 35 rlogin on chkconfig --level 35 routed off chkconfig --level 35 rsh on chkconfig --level 35 rstatd on chkconfig --level 35 rsync on chkconfig --level 35 rusersd on chkconfig --level 35 rwalld on chkconfig --level 35 rwhod on chkconfig --level 35 sendmail on chkconfig --level 35 servers off chkconfig --level 35 services off chkconfig --level 35 sgi_fam on chkconfig --level 35 smartd off chkconfig --level 35 smb off chkconfig --level 35 snmpd off chkconfig --level 35 snmptrapd off chkconfig --level 35 squid off chkconfig --level 35 sshd on chkconfig --level 35 swat off chkconfig --level 35 syslog on chkconfig --level 35 talk on chkconfig --level 35 telnet on chkconfig --level 35 tftp on chkconfig --level 35 time on chkconfig --level 35 time-udp on chkconfig --level 35 tux off chkconfig --level 35 ups off chkconfig --level 35 vncserver off chkconfig --level 35 vsftpd off chkconfig --level 35 wine off chkconfig --level 35 wu-ftpd off chkconfig --level 35 xfs on chkconfig --level 35 xinetd on chkconfig --level 35 ypbind off chkconfig --level 35 yppasswdd off chkconfig --level 35 ypserv off chkconfig --level 35 ypxfrd off chkconfig --level 35 zebra off # downgrade gcc # upgrade the compiler #wget http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-3.2/gcc-3.2.tar.gz #cd /usr/src #tar xzvf /programs/install/gcc-2.95*.tar.gz #cd gcc-* #./configure --prefix /usr #make #make install # upgrade gcc # upgrade the compiler #wget http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-3.2/gcc-3.2.tar.gz cd /usr/src tar xzvf /programs/install/gcc-3.2*.tar.gz cd gcc-* ./configure --prefix /usr make make install # install F-secure SSH # cd /programs/install # wget ftp://ftp.ssh.com/pub/ssh/ssh-1.2.33.tar.gz # wget ftp://ftp.ssh.com/pub/ssh/ssh-3.2.5.tar.gz cd /usr/src rm -f ssh-1* tar xzvf /programs/install/ssh-1.2.33.tar.gz cd ssh-1* ./configure --prefix /usr make make install cd /usr/src rm -rf ssh-3* tar xzvf /programs/install/ssh-3.2.9.1.tar.gz cd ssh-3* ./configure --prefix /usr make make install # edit the config files echo "Ssh1Compatibility yes" >> /etc/ssh2/ssh2_config echo "Ssh1InternalEmulation no" >> /etc/ssh2/ssh2_config echo "Ssh1Path /usr/bin/ssh1" >> /etc/ssh2/ssh2_config echo "Ssh1Compatibility yes" >> /etc/ssh2/sshd2_config echo "Sshd1Path /usr/sbin/sshd1" >> /etc/ssh2/sshd2_config cd rehash ssh1 server "tar cf - .ssh .ssh2" | tar xvf - # upgrade openssh #cd /usr/src #tar xzvf /programs/install/openssh-*.tar.gz #cd openssh-* #./configure --prefix=/usr #make #make install #echo "CloseOnSIGCHLD yes" >> /etc/ssh/sshd_config # get Xdiff installed cp /programs/install/xdiff/xdiff /usr/X11R6/bin/ cp /programs/install/xdiff/XDiff /usr/X11R6/lib/X11/app-defaults/ # update nfstools cd /usr/src tar xvzf /programs/install/nfs-utils-* cd nfs-utils-* ./configure --prefix=/ --exec-prefix=/ --bindir=/usr/sbin --sbindir=/sbin --localstatedir=/var/lib/nfs --mandir=/usr/share/man ./configure --mandir=/usr/share/man make make install # update mozilla? mv /usr/bin/mozilla /usr/bin/mozilla.old ln -sf /programs/mozilla/mozilla /usr/bin/mozilla # upgrade the kernel set Version = 2.4.20 cp -p /etc/lilo.conf /etc/lilo.conf.orig set root = `awk -F "[=\t ]" '$1=="default"{label=$2} $2=="label" && $3==label{++default} default!="" && $2=="root"{print $3;exit}' /etc/lilo.conf.orig` awk '/default/{$0="default=mosix"} {print}' /etc/lilo.conf.orig >! /etc/lilo.conf echo "" >> /etc/lilo.conf echo "image=/boot/vmlinuz-${Version}-openmosix-3" >> /etc/lilo.conf echo "\tlabel=mosix" >> /etc/lilo.conf echo "\troot=$root" >> /etc/lilo.conf echo "" >> /etc/lilo.conf #vi /etc/lilo.conf #wget http://www.kernel.org/pub/linux/kernel/v2.4/linux-${version}.tar.gz cd /usr/src bunzip2 -c /programs/install/linux-${Version}*.tar.bz2 |\ tar xvf - rm -f linux-2.4 ln -sf linux-${Version} linux-2.4 cd linux-2.4 # patch samba for large-file support (DVD images) patch -p1 < /programs/install/samba/01-smbfs-2.4.18-lfs.patch # also need to update smbmount # do openMosix patch? gunzip -c /programs/install/openMosix-2.4.20-3.gz | patch -p1 cp /usr/src/linux-*/configs/kernel-*-athlon-smp.config .config # turn on TG3 gigabit card echo "CONFIG_TIGON3=m" >> .config # turn on intel gigabit card echo "CONFIG_E1000=m" >> .config # turn on TCP nfs echo "CONFIG_NFSD_TCP=y" >> .config # make sure these are not modules echo "CONFIG_EXT3_FS=y" >> .config # turn on a few mosix feature echo "CONFIG_MOSIX_FS=y" >> .config echo "CONFIG_MOSIX_DFSA=y" >> .config # turn off stuff mosix cannot handle echo "CONFIG_INTERMEZZO_FS=n" >> .config make menuconfig # just do "exit/save" thing to reformat the .config file make dep make make modules make modules_install make bzImage make install lilo # do samba upgrade for large-file support (DVD images) # wget http://us1.samba.org/samba/ftp/samba-latest.tar.bz2 cd /usr/src tar xjvf /programs/install/samba/samba-latest.tar.bz2 cd samba-* patch -p1 < /programs/install/samba/smbmount-2.2.3a-negotiate.patch cd source ./configure --prefix=/usr --with-smbmount --with-configdir=/etc/samba make make install if(0) then # fix the network card assignments lspci | grep -i ether | awk '{print "eth"NR-1, $0}' cd /etc/sysconfig/network-scripts awk '/eth0/{print "DEVICE=eth2";next} {print}' ifcfg-eth0 >! ifcfg-eth2 awk '/eth1/{print "DEVICE=eth0";next} {print}' ifcfg-eth1 >! ifcfg-eth0 cd /etc cp -p modules.conf modules.conf.orig awk '/eth2/{$NF="tg3"} {print}' modules.conf.orig >! modules.conf endif # install MOSIX #wget 'http://umn.dl.sourceforge.net/sourceforge/openmosix/openmosix-kernel-${Version}-openmosix2.athlon.rpm' #wget 'http://umn.dl.sourceforge.net/sourceforge/openmosix/openmosix-tools-0.3.5-1.i386.rpm' #set Version = `uname -a | awk '{print $3}'` #rpm -e --allmatches openmosix-kernel-smp #rpm -i /programs/install/openmosix-kernel-*${Version}*.rpm #lilo # do the openMosix userspace install rpm -e --allmatches openmosix-tools rpm -i /programs/install/openmosix-tools-0.2*.i386.rpm #rpm -i /programs/install/openmosix-tools-0.3*-RH73.i386.rpm echo "1 192.168.2.1 16" >> /etc/mosix.map echo "17 192.168.1.101 3" >> /etc/mosix.map if(0) then # do openMosix patch (now that we have a working kernel) cd /usr/src/linux-2.4 bzcat /programs/install/openMosix-2.4.22-2.bz2 | patch -p1 # recompile latest tools because the rpm stuff doesn't work cd /usr/src ln -sf linux-2.4 linux-openmosix tar xjvf /programs/install/openmosix-tools-0.3.5.tar.bz2 cd openmosix-tools* ./configure --bindir=/bin --sbindir=/sbin --includedir=/usr/include --mandir=/usr/share/man --libdir=/lib make make install echo "1 192.168.2.1 16" >> /etc/openmosix.map echo "17 192.168.1.101 3" >> /etc/openmosix.map ebduf lilo reboot # now plug in the gigabit card (eth2)