Commit 66db6a35 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Minor reorg to work on the MFS filesystem. Basically, look for ismfs

file in /etc/testbed, and if there such a file, take a different path
through the setup code that is a lot shorter (mounts, accounts,
startupcmd).  All the other stuff is bypassed. There are no
differences though between what you install on the MFS and what you
install on a regular node.  Just run the mfs-install target instead,
which creates the little ismfs file for you.
parent c2024213
......@@ -12,10 +12,10 @@ use Exporter;
doaccounts dorpms dotarballs dostartupcmd install_deltas
bootsetup nodeupdate startcmdstatus whatsmynickname
OPENTMCC RUNTMCC
OPENTMCC RUNTMCC MFS
TMCC TMIFC TMDELAY TMRPM TMTARBALLS TMHOSTS
TMNICKNAME HOSTSFILE TMSTARTUPCMD FINDIF
TMNICKNAME HOSTSFILE TMSTARTUPCMD FINDIF
TMCCCMD_REBOOT TMCCCMD_STATUS TMCCCMD_IFC TMCCCMD_ACCT TMCCCMD_DELAY
TMCCCMD_HOSTS TMCCCMD_RPM TMCCCMD_TARBALL TMCCCMD_STARTUP
......@@ -106,9 +106,14 @@ my $DELTAINSTALL= "/usr/local/bin/install-delta %s";
$NODE = "";
# Locals
my $pid = "";
my $eid = "";
my $vname = "";
my $pid = "";
my $eid = "";
my $vname = "";
# When on the MFS, we do a much smaller set of stuff.
# Cause of the way the packages are loaded (which I do not understand),
# this is computed on the fly instead of once.
sub MFS() { if (-e "$SETUPDIR/ismfs") { return 1; } else { return 0; } }
#
# Open a TMCC connection and return the "stream pointer". Caller is
......@@ -248,7 +253,7 @@ sub domounts()
# The MFS version does not support (or need) this DB stuff. Just mount
# them up.
#
if (-e "$SETUPDIR/ismfs") {
if (MFS()) {
while (($remote, $local) = each %mounts) {
if (! -e $local) {
if (! os_mkdir($local, 0770)) {
......@@ -751,8 +756,6 @@ sub dostartupcmd ()
return 0;
}
use Socket;
sub dotrafficconfig()
{
my $didopen = 0;
......@@ -760,6 +763,16 @@ sub dotrafficconfig()
my $TM;
my $boss;
my $startnse = 0;
#
# Kinda ugly, but there is too much perl goo included by Socket to put it
# on the MFS.
#
if (MFS()) {
return 1;
}
require Socket;
import Socket;
$TM = OPENTMCC(TMCCCMD_BOSSINFO);
($boss) = split(" ", <$TM>);
......@@ -884,47 +897,49 @@ sub bootsetup()
print STDOUT "Mounting project and home directories ... \n";
domounts();
#
# Okay, lets find out about interfaces.
#
print STDOUT "Checking Testbed interface configuration ... \n";
doifconfig();
#
# Host names configuration (/etc/hosts).
#
print STDOUT "Checking Testbed hostnames configuration ... \n";
dohostnames();
#
# Do account stuff.
#
print STDOUT "Checking Testbed group/user configuration ... \n";
doaccounts();
#
# Router Configuration.
#
print STDOUT "Checking Testbed routing configuration ... \n";
dorouterconfig();
if (! MFS()) {
#
# Okay, lets find out about interfaces.
#
print STDOUT "Checking Testbed interface configuration ... \n";
doifconfig();
#
# Traffic generator Configuration.
#
print STDOUT "Checking Testbed traffic generation configuration ... \n";
dotrafficconfig();
#
# Host names configuration (/etc/hosts).
#
print STDOUT "Checking Testbed hostnames configuration ... \n";
dohostnames();
#
# RPMS
#
print STDOUT "Checking Testbed RPM configuration ... \n";
dorpms();
#
# Router Configuration.
#
print STDOUT "Checking Testbed routing configuration ... \n";
dorouterconfig();
#
# Tar Balls
#
print STDOUT "Checking Testbed Tarball configuration ... \n";
dotarballs();
#
# Traffic generator Configuration.
#
print STDOUT "Checking Testbed traffic generation configuration ...\n";
dotrafficconfig();
#
# RPMS
#
print STDOUT "Checking Testbed RPM configuration ... \n";
dorpms();
#
# Tar Balls
#
print STDOUT "Checking Testbed Tarball configuration ... \n";
dotarballs();
}
#
# Experiment startup Command.
......
......@@ -16,11 +16,16 @@ all:
include $(TESTBED_SRCDIR)/GNUmakerules
INSTALL_DIR = /etc/testbed
DESTDIR =
ETCDIR = $(DESTDIR)/etc
INSTALL_DIR = $(ETCDIR)/testbed
ISMFS = $(INSTALL_DIR)/ismfs
INSTALL_FILES = group master.passwd setup
INSTALL = /usr/bin/install -c
install: misc-install script-install bin-install
mfs-install: script-install bin-install
echo >$(ISMFS) "This file indicates its the MFS. DO NOT DELETE!"
dir-install:
-mkdir -p $(INSTALL_DIR)
......@@ -52,19 +57,21 @@ script-install: dir-install
$(INSTALL) -m 755 $(SRCDIR)/rc.delayagent $(INSTALL_DIR)/rc.delayagent
$(INSTALL) -m 755 $(SRCDIR)/rc.delta $(INSTALL_DIR)/rc.delta
$(INSTALL) -m 755 $(SRCDIR)/rc.healthd $(INSTALL_DIR)/rc.healthd
$(INSTALL) -m 755 $(SRCDIR)/rc.mfs $(INSTALL_DIR)/rc.mfs
$(INSTALL) -m 755 $(SRCDIR)/setipod $(INSTALL_DIR)/setipod
$(INSTALL) -m 755 $(SRCDIR)/runstartup $(INSTALL_DIR)/runstartup
$(INSTALL) -m 755 $(SRCDIR)/sethostname $(INSTALL_DIR)/sethostname
$(INSTALL) -m 644 $(SRCDIR)/hosts $(INSTALL_DIR)/hosts
$(INSTALL) -m 755 $(SRCDIR)/dhclient-exit-hooks \
/etc/dhclient-exit-hooks
$(ETCDIR)/dhclient-exit-hooks
$(INSTALL) -m 755 $(SRCDIR)/nodetype $(INSTALL_DIR)/nodetype
$(INSTALL) -m 755 $(SRCDIR)/chipset.awk $(INSTALL_DIR)/chipset.awk
$(INSTALL) -m 755 $(SRCDIR)/cpuspeed.awk $(INSTALL_DIR)/cpuspeed.awk
$(INSTALL) -m 755 $(SRCDIR)/control_interface $(INSTALL_DIR)/control_interface
$(INSTALL) -m 755 $(SRCDIR)/start_if.fxp0 /etc/start_if.fxp0
$(INSTALL) -m 755 $(SRCDIR)/start_if.fxp1 /etc/start_if.fxp1
$(INSTALL) -m 755 $(SRCDIR)/start_if.fxp4 /etc/start_if.fxp4
$(INSTALL) -m 755 $(SRCDIR)/start_if.xl0 /etc/start_if.xl0
$(INSTALL) -m 755 $(SRCDIR)/start_if.fxp0 $(ETCDIR)/start_if.fxp0
$(INSTALL) -m 755 $(SRCDIR)/start_if.fxp1 $(ETCDIR)/start_if.fxp1
$(INSTALL) -m 755 $(SRCDIR)/start_if.fxp4 $(ETCDIR)/start_if.fxp4
$(INSTALL) -m 755 $(SRCDIR)/start_if.xl0 $(ETCDIR)/start_if.xl0
$(INSTALL) -m 755 $(SRCDIR)/rc.route $(INSTALL_DIR)/rc.route
$(INSTALL) -m 644 $(SRCDIR)/gated_fxp0.conf $(INSTALL_DIR)/gated_fxp0.conf
$(INSTALL) -m 644 $(SRCDIR)/gated_fxp1.conf $(INSTALL_DIR)/gated_fxp1.conf
......
......@@ -236,8 +236,10 @@ sub os_mkdir($$)
#
sub os_setup()
{
print STDOUT "Checking Testbed delay configuration ... \n";
dodelays();
if (! libsetup::MFS()) {
print STDOUT "Checking Testbed delay configuration ... \n";
dodelays();
}
}
#
......@@ -245,8 +247,10 @@ sub os_setup()
#
sub update_delays()
{
dodelays();
system($TMDELAY);
if (! libsetup::MFS()) {
dodelays();
system($TMDELAY);
}
}
sub dodelays ()
......@@ -515,34 +519,4 @@ sub dodelays ()
return 0;
}
use Socket;
sub enable_ipod()
{
if (system("sysctl net.inet.icmp.ipod_host")) {
warn "*** WARNING: IPOD sysctls not supported in the kernel\n";
return -1;
}
my ($bname, $bip) = split(/ /, `/etc/testbed/tmcc bossinfo`);
if (!defined($bip)) {
warn "*** WARNING: could not determine boss node, IPOD not enabled\n";
return -1;
}
my $ipuint = unpack("N", inet_aton($bip));
# XXX arg to sysctl must be a signed 32-bit int, so we must "cast"
my $sysctlcmd = sprintf("sysctl -w net.inet.icmp.ipod_host=%d", $ipuint);
if (system($sysctlcmd)) {
warn "*** WARNING: could not set IPOD host to $bip ($ipuint)\n";
return -1;
}
if (system("sysctl -w net.inet.icmp.ipod_enabled=1")) {
warn "*** WARNING: could not enable IPOD\n";
return -1;
}
return 0;
}
1;
#!/bin/sh
#
# The MFS does a very restricted set of operations.
#
echo "Doing Testbed Setup on an MFS ... "
#
# Inform TMCD that we've rebooted, and are starting testbed setup
#
if [ -x /etc/testbed/tmcc ]; then
echo "Informing the testbed that we've rebooted ..."
/etc/testbed/tmcc state REBOOTED
fi
if [ -x /etc/testbed/setup ]; then
echo "Doing Testbed setup configuration ..."
/etc/testbed/setup
fi
/bin/rm -f /var/at/jobs/S*
if [ -s /etc/testbed/startupcmd ]; then
echo "Scheduling startup command to run in a little bit ..."
echo "/etc/testbed/runstartup" | at -q S 'now + 2 minutes'
fi
#
# Inform TMCD that we're up and running
#
if [ -x /etc/testbed/tmcc ]; then
echo "Informing the testbed that we're up and running ..."
/etc/testbed/tmcc state ISUP
fi
......@@ -13,6 +13,11 @@ if [ -x /etc/testbed/setup ]; then
/etc/testbed/setup
fi
if [ -x /etc/testbed/setipod ]; then
echo "Setting up IPOD ... "
/etc/testbed/setipod
fi
if [ -x /etc/testbed/rc.ifc ]; then
echo "Setting up Testbed interfaces ..."
/etc/testbed/rc.ifc
......
......@@ -5,6 +5,14 @@
# if you sup this file, it won't take effect till the next reboot.
#
#
# If on the MFS, skip this stuff and just do the MFS setup stuff.
#
if [ -e /etc/testbed/ismfs ]; then
/etc/testbed/rc.mfs
exit 0
fi
echo "Checking for file updates ..."
export HOME=/root
......@@ -14,8 +22,8 @@ if [ -f /etc/testbed/supfile ]; then
fi
if [ -x /etc/testbed/rc.healthd ]; then
echo "Starting node health monitoring ..."
/etc/testbed/rc.healthd start
echo "Starting node health monitoring ..."
/etc/testbed/rc.healthd start
fi
if [ -x /etc/testbed/rc.setup ]; then
......
#!/usr/bin/perl -wT
use English;
use Socket;
#
# This is in its own file cause its a pain on the MFS, which does not
# have all the that perl library stuff that Socket needs.
#
#
# Untaint path
#
$ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/local/bin:/etc/testbed';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
#
# Enable ICMP ping-of-death
#
if (system("sysctl net.inet.icmp.ipod_host")) {
warn "*** WARNING: IPOD sysctls not supported in the kernel\n";
exit -1;
}
my ($bname, $bip) = split(/ /, `tmcc bossinfo`);
if (!defined($bip)) {
warn "*** WARNING: could not determine boss node, IPOD not enabled\n";
exit -1;
}
my $ipuint = unpack("N", inet_aton($bip));
# XXX arg to sysctl must be a signed 32-bit int, so we must "cast"
my $sysctlcmd = sprintf("sysctl -w net.inet.icmp.ipod_host=%d", $ipuint);
if (system($sysctlcmd)) {
warn "*** WARNING: could not set IPOD host to $bip ($ipuint)\n";
exit -1;
}
if (system("sysctl -w net.inet.icmp.ipod_enabled=1")) {
warn "*** WARNING: could not enable IPOD\n";
exit -1;
}
exit 0;
......@@ -20,9 +20,4 @@ use libsetup;
#
bootsetup();
#
# Enable ICMP ping-of-death
#
liblocsetup::enable_ipod();
exit 0;
......@@ -12,10 +12,10 @@ use Exporter;
doaccounts dorpms dotarballs dostartupcmd install_deltas
bootsetup nodeupdate startcmdstatus whatsmynickname
OPENTMCC RUNTMCC
OPENTMCC RUNTMCC MFS
TMCC TMIFC TMDELAY TMRPM TMTARBALLS TMHOSTS
TMNICKNAME HOSTSFILE TMSTARTUPCMD FINDIF
TMNICKNAME HOSTSFILE TMSTARTUPCMD FINDIF
TMCCCMD_REBOOT TMCCCMD_STATUS TMCCCMD_IFC TMCCCMD_ACCT TMCCCMD_DELAY
TMCCCMD_HOSTS TMCCCMD_RPM TMCCCMD_TARBALL TMCCCMD_STARTUP
......@@ -106,9 +106,14 @@ my $DELTAINSTALL= "/usr/local/bin/install-delta %s";
$NODE = "";
# Locals
my $pid = "";
my $eid = "";
my $vname = "";
my $pid = "";
my $eid = "";
my $vname = "";
# When on the MFS, we do a much smaller set of stuff.
# Cause of the way the packages are loaded (which I do not understand),
# this is computed on the fly instead of once.
sub MFS() { if (-e "$SETUPDIR/ismfs") { return 1; } else { return 0; } }
#
# Open a TMCC connection and return the "stream pointer". Caller is
......@@ -248,7 +253,7 @@ sub domounts()
# The MFS version does not support (or need) this DB stuff. Just mount
# them up.
#
if (-e "$SETUPDIR/ismfs") {
if (MFS()) {
while (($remote, $local) = each %mounts) {
if (! -e $local) {
if (! os_mkdir($local, 0770)) {
......@@ -751,8 +756,6 @@ sub dostartupcmd ()
return 0;
}
use Socket;
sub dotrafficconfig()
{
my $didopen = 0;
......@@ -760,6 +763,16 @@ sub dotrafficconfig()
my $TM;
my $boss;
my $startnse = 0;
#
# Kinda ugly, but there is too much perl goo included by Socket to put it
# on the MFS.
#
if (MFS()) {
return 1;
}
require Socket;
import Socket;
$TM = OPENTMCC(TMCCCMD_BOSSINFO);
($boss) = split(" ", <$TM>);
......@@ -884,47 +897,49 @@ sub bootsetup()
print STDOUT "Mounting project and home directories ... \n";
domounts();
#
# Okay, lets find out about interfaces.
#
print STDOUT "Checking Testbed interface configuration ... \n";
doifconfig();
#
# Host names configuration (/etc/hosts).
#
print STDOUT "Checking Testbed hostnames configuration ... \n";
dohostnames();
#
# Do account stuff.
#
print STDOUT "Checking Testbed group/user configuration ... \n";
doaccounts();
#
# Router Configuration.
#
print STDOUT "Checking Testbed routing configuration ... \n";
dorouterconfig();
if (! MFS()) {
#
# Okay, lets find out about interfaces.
#
print STDOUT "Checking Testbed interface configuration ... \n";
doifconfig();
#
# Traffic generator Configuration.
#
print STDOUT "Checking Testbed traffic generation configuration ... \n";
dotrafficconfig();
#
# Host names configuration (/etc/hosts).
#
print STDOUT "Checking Testbed hostnames configuration ... \n";
dohostnames();
#
# RPMS
#
print STDOUT "Checking Testbed RPM configuration ... \n";
dorpms();
#
# Router Configuration.
#
print STDOUT "Checking Testbed routing configuration ... \n";
dorouterconfig();
#
# Tar Balls
#
print STDOUT "Checking Testbed Tarball configuration ... \n";
dotarballs();
#
# Traffic generator Configuration.
#
print STDOUT "Checking Testbed traffic generation configuration ...\n";
dotrafficconfig();
#
# RPMS
#
print STDOUT "Checking Testbed RPM configuration ... \n";
dorpms();
#
# Tar Balls
#
print STDOUT "Checking Testbed Tarball configuration ... \n";
dotarballs();
}
#
# Experiment startup Command.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment