Commit 7d67d6bd authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Random tweaks I made while getting things going for pcwa nodes.

parent 4f575080
#!/usr/bin/perl -wT
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2002 University of Utah and the Flux Group.
......@@ -21,7 +21,8 @@ use Socket;
#
# Untaint path
#
$ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/local/bin:/etc/testbed';
$ENV{'PATH'} = "/bin:/sbin:/usr/bin:/usr/local/bin";
$ENV{'PATH'} .= ":/usr/local/etc/emulab:/etc/testbed";
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
#
......
#
# Testbed TMCD client program
#
CFLAGS += -O -g -Wall -DUDP -DSTANDALONE -DBOSSNODE='"boss.emulab.net"'
BOSSNODE = boss.emulab.net
#BOSSNODE = golden-gw.ballmoss.com
CFLAGS += -O -g -Wall -DUDP -DSTANDALONE -DBOSSNODE='"$(BOSSNODE)"'
SRCDIR = .
DESTDIR =
INSTALL_DIR = $(DESTDIR)/usr/local/etc/emulab
......@@ -11,6 +13,7 @@ DISTFILES = makefile decls.h libsetup.pm ssl.c ssl.h tmcc.c
WAFILES = liblocsetup-linux.pm liblocsetup-freebsd.pm install.sh \
emulabctl rc.testbed update vnodesetup watchdog \
reinstall.sh emulabkey
BSDFILES = setipod
DISTDIR = /tmp/emulab
#
......@@ -28,7 +31,7 @@ ssl.o: ssl.c ssl.h decls.h
clean:
rm -f *.o core tmcc
install: misc-install script-install bin-install
force-install: misc-install script-install bin-install
dir-install:
-mkdir -p $(INSTALL_DIR)
......@@ -45,6 +48,9 @@ script-install: dir-install
for file in $(WAFILES); do \
$(INSTALL_PROG) $(SRCDIR)/$$file $(INSTALL_DIR)/$$file; \
done
for file in $(BSDFILES); do \
$(INSTALL_PROG) $(SRCDIR)/$$file $(INSTALL_DIR)/$$file; \
done
$(INSTALL_PROG) $(SRCDIR)/libsetup.pm $(INSTALL_DIR)/libsetup.pm
$(INSTALL) -m 440 $(SRCDIR)/client.pem $(INSTALL_DIR)/client.pem
$(INSTALL) -m 440 $(SRCDIR)/emulab.pem $(INSTALL_DIR)/emulab.pem
......@@ -65,13 +71,28 @@ post-install:
chown emulabman $(INSTALL_DIR)/client.pem $(INSTALL_DIR)/emulab.pem
chmod 640 $(INSTALL_DIR)/client.pem $(INSTALL_DIR)/emulab.pem
dist:
dist: trafgen pemfile
rm -rf $(DISTDIR)
mkdir $(DISTDIR)
cp -p $(DISTFILES) $(DISTDIR)
cp -p $(BSDFILES) $(DISTDIR)
for file in $(WAFILES); do cp ron/$$file $(DISTDIR); done
cp /usr/testbed/etc/emulab.pem $(DISTDIR)
cp /usr/testbed/etc/pcplab.pem $(DISTDIR)/client.pem
cp /usr/testbed/etc/$(PEMFILE) $(DISTDIR)/client.pem
cp /usr/local/sbin/vtund $(DISTDIR)
cp $(TRAFGEN) $(DISTDIR)
rm -f $(DISTDIR).tar
tar cf $(DISTDIR).tar -C $(DISTDIR) .
trafgen:
ifndef TRAFGEN
@echo "You must define TRAFGEN (path to trafgen binary)."
@false
endif
pemfile:
ifndef PEMFILE
@echo "You must define PEMFILE (name of the pem file)."
@false
endif
......@@ -31,6 +31,7 @@ else
rm -f /etc/rc5.d/S99emulab
ln -s ../init.d/emulab /etc/rc5.d/S99emulab
endif
cp /dev/null isrem
chown emulabman . *
chgrp bin . *
chown root update vnodesetup
......
......@@ -43,7 +43,7 @@ use lib "/usr/local/etc/emulab";
use libsetup;
# Locals
my $timeout = (60 * 30); # In seconds of course.
my $timeout = (60 * 60); # In seconds of course.
my $logname = "/tmp/emulab-watchdog.debug";
my $vndir = "/var/emulab";
my $pidfile = "/var/run/emulab-watchdog.pid";
......@@ -132,6 +132,14 @@ close(PFILE);
print "Informing Emulab Operations that we've rebooted ...\n";
system("tmcc state REBOOTED");
#
# Do Apod.
#
if (-x "/usr/local/etc/emulab/setipod") {
print "Setting up APOD ... \n";
system("/usr/local/etc/emulab/setipod");
}
# At bootup, look for new accounts.
print "Looking for new Emulab accounts ...\n";
system("update -i");
......@@ -221,6 +229,15 @@ sub bootvnodes() {
my %curvnodelist;
my @vnodes;
#
# Don't want tmcc errors to really kill us.
#
my $newpid = fork();
if ($newpid) {
waitpid($newpid, 0);
return ($? >> 8);
}
#
# Get the current set of vnodes that are supposed to be running on
# this node.
......@@ -256,6 +273,7 @@ sub bootvnodes() {
system("vnodesetup $vnode");
sleep(5);
}
exit(0);
}
exit(0);
......@@ -61,6 +61,7 @@ static char *clientcertdirs[] = {
"/etc/testbed",
"/etc/rc.d/testbed",
"/usr/local/etc/testbed",
"/usr/local/etc/emulab",
ETCDIR,
0
};
......
Supports Markdown
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