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

A wide array of little changes to improve the distribution of the

client software to widearea nodes. Most of these changes were to
reduce the embarrassment factor. At some point we need a proper
autoconf and such, but for now there is a makefile in the src dir for
creating the distribution.

I've tested it on a local linux node and mostly on a freebsd node, but
I've moved things around and so updating the RON nodes will require
some hand intervention by me at some point.
parent 08c49b6d
......@@ -128,7 +128,7 @@ my $VTUND = "/usr/local/sbin/vtund";
#
# This is a debugging thing for my home network.
#
#my $NODE = "REDIRECT=155.101.132.101";
#my $NODE = "-p 7778 REDIRECT=192.168.100.1";
$NODE = "";
# Locals
......
......@@ -54,7 +54,7 @@ my $runcmd;
my $login;
while (<CMD>) {
if ($_ =~ /CMD=\'([-\@\w.\/ ]+)\' UID=([0-9a-z]+)/) {
if ($_ =~ /CMD=\'([-\@\w.\/\+ ]+)\' UID=([0-9a-z]+)/) {
$runcmd = $1;
$login = $2;
}
......
......@@ -128,7 +128,7 @@ my $VTUND = "/usr/local/sbin/vtund";
#
# This is a debugging thing for my home network.
#
#my $NODE = "REDIRECT=155.101.132.101";
#my $NODE = "-p 7778 REDIRECT=192.168.100.1";
$NODE = "";
# Locals
......
#
# Testbed TMCD client program
#
CFLAGS += -O -g -Wall -DUDP -DSTANDALONE -DBOSSNODE='"boss.emulab.net"'
SRCDIR = .
DESTDIR =
INSTALL_DIR = $(DESTDIR)/usr/local/etc/emulab
INSTALL = /usr/bin/install -c
INSTALL_PROG = /usr/bin/install -c -m 755
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
DISTDIR = /tmp/emulab
#
# For SSL enabled tmcd/tmcc
#
SSLFLAGS = -DWITHSSL
TMLIBS += -lssl -lcrypto
SSLOBJ = ssl.o
tmcc: tmcc.c decls.h $(SSLOBJ)
$(CC) $(CFLAGS) $(SSLFLAGS) -static -g -o tmcc $< $(SSLOBJ) $(TMLIBS)
ssl.o: ssl.c ssl.h decls.h
clean:
rm -f *.o core tmcc
install: misc-install script-install bin-install
dir-install:
-mkdir -p $(INSTALL_DIR)
cp /dev/null $(INSTALL_DIR)/isrem
rm /usr/local/etc/testbed
ln -s emulab /usr/local/etc/testbed
misc-install: dir-install
bin-install: dir-install tmcc
$(INSTALL_PROG) tmcc $(INSTALL_DIR)/tmcc
script-install: dir-install
for file in $(WAFILES); 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
post-install:
for file in $(WAFILES); do \
chown emulabman $(INSTALL_DIR)/$$file; \
chgrp bin $(INSTALL_DIR)/$$file; \
done
chown emulabman $(INSTALL_DIR)/libsetup.pm
chgrp bin $(INSTALL_DIR)/libsetup.pm
chown root $(INSTALL_DIR)/update
chmod u+s $(INSTALL_DIR)/update
chown root $(INSTALL_DIR)/vnodesetup
chmod u+s $(INSTALL_DIR)/vnodesetup
chown root /usr/bin/suidperl
chmod u+s /usr/bin/suidperl
chown emulabman $(INSTALL_DIR)/client.pem $(INSTALL_DIR)/emulab.pem
chmod 640 $(INSTALL_DIR)/client.pem $(INSTALL_DIR)/emulab.pem
dist:
rm -rf $(DISTDIR)
mkdir $(DISTDIR)
cp -p $(DISTFILES) $(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
rm -f $(DISTDIR).tar
tar cf $(DISTDIR).tar -C $(DISTDIR) .
......@@ -23,7 +23,7 @@ all: bossnode
include $(TESTBED_SRCDIR)/GNUmakerules
DESTDIR =
INSTALL_DIR = $(DESTDIR)/usr/local/etc/testbed
INSTALL_DIR = $(DESTDIR)/usr/local/etc/emulab
INSTALL = /usr/bin/install -c
INSTALL_PROG = /usr/bin/install -c -m 755
......@@ -44,11 +44,14 @@ script-install: dir-install
$(INSTALL_PROG) $(SRCDIR)/vnodesetup $(INSTALL_DIR)/vnodesetup
$(INSTALL_PROG) $(SRCDIR)/watchdog $(INSTALL_DIR)/watchdog
$(INSTALL_PROG) $(SRCDIR)/../libsetup.pm $(INSTALL_DIR)/libsetup.pm
$(INSTALL_PROG) $(SRCDIR)/liblocsetup.pm $(INSTALL_DIR)/liblocsetup.pm
$(INSTALL_PROG) $(SRCDIR)/liblocsetup-freebsd.pm \
$(INSTALL_DIR)/liblocsetup-freebsd.pm
$(INSTALL_PROG) $(SRCDIR)/liblocsetup-linux.pm \
$(INSTALL_DIR)/liblocsetup-linux.pm
$(INSTALL_PROG) $(SRCDIR)/rc.testbed $(INSTALL_DIR)/rc.testbed
$(INSTALL_PROG) $(SRCDIR)/rc.setup $(INSTALL_DIR)/rc.setup
$(INSTALL_PROG) $(SRCDIR)/mkemuman.sh $(INSTALL_DIR)/mkemuman.sh
$(INSTALL_PROG) $(SRCDIR)/upemuman.sh $(INSTALL_DIR)/upemuman.sh
$(INSTALL_PROG) $(SRCDIR)/emulabctl $(INSTALL_DIR)/emulabctl
$(INSTALL_PROG) $(SRCDIR)/install.sh $(INSTALL_DIR)/install.sh
$(INSTALL_PROG) $(SRCDIR)/reinstall $(INSTALL_DIR)/reinstall.sh
post-install:
chown root $(INSTALL_DIR)/update
......
The installation process is quite simplistic at the moment. After you
unpack the tar file:
make
make install
/usr/local/etc/emulab/install.sh
Then you should reboot the node.
......@@ -6,8 +6,18 @@
#
#
# Start the watchdog daemon
# Boottime initialization.
#
echo "Starting the Emulab watchdog ..."
/usr/local/etc/testbed/watchdog
case "$1" in
start)
/usr/local/etc/emulab/watchdog > /dev/null 2>&1 && echo -n ' Emulab'
;;
stop)
(killall watchdog; sleep 5) > /dev/null 2>&1 && echo -n ' Emulab'
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
;;
esac
exit 0
1024 37 168728947415883137658395816497236019932357443574364998989351516015013006429180411438552594116282442938932702706360430451154958992295988097967662214818020771421328881173382895214540694120581207714991274873698590147743427181599852480329442016838781882554809552882295931111276319070960396053057987057937216750401 root@paper.cs.utah.edu
#!/bin/csh
set path = ( /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin )
setenv OSTYPE `uname -s`
if ($OSTYPE == "FreeBSD") then
setenv USERADD "pw useradd";
......@@ -12,9 +14,22 @@ endif
$USERADD emulabman -u 65520 -g bin -m -s /bin/tcsh -c "Emulab Man"
cd /usr/local/etc/testbed
cd /usr/local/etc/emulab
if ($OSTYPE == "FreeBSD") then
cp rc.testbed /usr/local/etc/rc.d/testbed.sh
ln -s liblocsetup-freebsd.pm liblocsetup.pm
rm -f /usr/local/etc/rc.d/testbed.sh
rm -f /usr/local/etc/rc.d/emulab.sh
cp -f rc.testbed /usr/local/etc/rc.d/emulab.sh
else
ln -s liblocsetup-linux.pm liblocsetup.pm
rm -f /etc/init.d/emulab
cp rc.testbed /etc/init.d/emulab
rm -f /etc/rc3.d/S99emulab
ln -s ../init.d/emulab /etc/rc3.d/S99emulab
rm -f /etc/rc2.d/S99emulab
ln -s ../init.d/emulab /etc/rc2.d/S99emulab
rm -f /etc/rc5.d/S99emulab
ln -s ../init.d/emulab /etc/rc5.d/S99emulab
endif
chown emulabman . *
chgrp bin . *
......@@ -24,23 +39,26 @@ chown root /usr/bin/suidperl
chmod u+s /usr/bin/suidperl
chown emulabman client.pem emulab.pem
chmod 640 client.pem emulab.pem
mkdir /var/testbed
cp vtund /usr/local/sbin
/usr/bin/install -c -o root -g wheel -d -m 755 -o root -g 0 /var/log/vtund
/usr/bin/install -c -o root -g wheel -d -m 755 -o root -g 0 /var/lock/vtund
/usr/bin/install -c -o root -g wheel -d -m 755 -o root -g 0 /var/emulab
cd ~emulabman
chmod 755 .
mkdir .ssh
chown emulabman .ssh
chgrp bin .ssh
chmod 700 .ssh
cd .ssh
if ( -e vtund ) then
cp vtund /usr/local/sbin
/usr/bin/install -c -o root -g wheel -d -m 755 -o root -g 0 /var/log/vtund
/usr/bin/install -c -o root -g wheel -d -m 755 -o root -g 0 /var/lock/vtund
endif
echo "1024 37 168728947415883137658395816497236019932357443574364998989351516015013006429180411438552594116282442938932702706360430451154958992295988097967662214818020771421328881173382895214540694120581207714991274873698590147743427181599852480329442016838781882554809552882295931111276319070960396053057987057937216750401 root@paper.cs.utah.edu" > authorized_keys
if (! -d ~emulabman/.ssh) then
cd ~emulabman
chmod 755 .
mkdir .ssh
chown emulabman .ssh
chgrp bin .ssh
chmod 700 .ssh
cd .ssh
cp /usr/local/etc/emulab/emulabkey authorized_keys
chown emulabman authorized_keys
chgrp bin authorized_keys
chmod 644 authorized_keys
endif
chown emulabman authorized_keys
chgrp bin authorized_keys
chmod 644 authorized_keys
......@@ -26,7 +26,7 @@ use English;
#
# This is the FreeBSD dependent part of the setup library.
#
my $SETUPDIR = "/usr/local/etc/testbed";
my $SETUPDIR = "/usr/local/etc/emulab";
libsetup::libsetup_init($SETUPDIR);
#
......
......@@ -25,7 +25,7 @@ use English;
#
# This is the Linux dependent part of the setup library.
#
my $SETUPDIR = "/usr/local/etc/testbed";
my $SETUPDIR = "/usr/local/etc/emulab";
libsetup::libsetup_init($SETUPDIR);
#
......
......@@ -8,8 +8,20 @@
#
# Boottime initialization.
#
case "$1" in
start)
if [ -f /usr/local/etc/emulab/emulabctl ]; then
/usr/local/etc/emulab/emulabctl start
fi
;;
stop)
if [ -f /usr/local/etc/emulab/emulabctl ]; then
/usr/local/etc/emulab/emulabctl stop
fi
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
;;
esac
if [ -f /usr/local/etc/testbed/rc.setup ]; then
echo "Joining Emulab ..."
/usr/local/etc/testbed/rc.setup
fi
exit 0
#!/bin/csh
cd /usr/local/etc/emulab
setenv OSTYPE `uname -s`
#
# Insert stuff here to fix things up
#
if ($OSTYPE == "FreeBSD") then
echo "Updating Freebsd";
else if ($OSTYPE == "Linux") then
echo "Updating Linux";
else
echo "Unsupported OS: $OSTYPE";
exit 1;
endif
#
# Then restart the watchdog.
#
if ($OSTYPE == "FreeBSD") then
/usr/local/etc/rc.d/emulab.sh stop
sleep 1
/usr/local/etc/rc.d/emulab.sh start
else
/etc/init.d/emulab stop
sleep 1
/etc/init.d/emulab start
endif
......@@ -26,14 +26,14 @@ my $immediate = 0;
#
# Untaint path
#
$ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/local/bin:/usr/local/etc/testbed';
$ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/local/bin:/usr/local/etc/emulab';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
#
# Load the OS independent support library. It will load the OS dependent
# library and initialize itself.
#
use lib "/usr/local/etc/testbed";
use lib "/usr/local/etc/emulab";
use libsetup;
#
......
#!/bin/csh
cd /usr/local/etc/testbed
chown root update vnodesetup
chmod u+s update vnodesetup
chown root /usr/bin/suidperl
chmod u+s /usr/bin/suidperl
chown emulabman client.pem emulab.pem ronnode.pem
chmod 640 client.pem emulab.pem ronnode.pem
/usr/bin/install -c -o root -g wheel -d -m 755 -o root -g 0 /var/testbed
cp rc.testbed /usr/local/etc/rc.d/testbed.sh
if ( -e /var/run/emulab-watchdog.pid ) then
kill `cat /var/run/emulab-watchdog.pid`
sleep 10
endif
rm -f /tmp/emulab-watchdog.debug
/usr/local/etc/testbed/watchdog -n
......@@ -36,7 +36,7 @@ $| = 1;
#
# Untaint path
#
$ENV{'PATH'} = "/usr/local/etc/testbed:/bin:/sbin:/usr/bin:/usr/local/bin:" .
$ENV{'PATH'} = "/usr/local/etc/emulab:/bin:/sbin:/usr/bin:/usr/local/bin:" .
"/usr/local/sbin";
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
......@@ -44,7 +44,7 @@ delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
# Load the OS independent support library. It will load the OS dependent
# library and initialize itself.
#
use lib "/usr/local/etc/testbed";
use lib "/usr/local/etc/emulab";
use libsetup;
#
......@@ -80,7 +80,7 @@ else {
#
my $logname = "/tmp/tbvnode-${vnodeid}.debug";
my $pidfile = "/var/run/tbvnode-${vnodeid}.pid";
my $vnodedir = "/var/testbed/$vnodeid";
my $vnodedir = "/var/emulab/$vnodeid";
#
# If killing the virtual node, then kill the manager process. We use
......
......@@ -31,7 +31,7 @@ $| = 1;
#
# Untaint path
#
$ENV{'PATH'} = "/usr/local/etc/testbed:/bin:/sbin:/usr/bin:/usr/local/bin:" .
$ENV{'PATH'} = "/usr/local/etc/emulab:/bin:/sbin:/usr/bin:/usr/local/bin:" .
"/usr/local/sbin";
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
......@@ -39,13 +39,13 @@ delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
# Load the OS independent support library. It will load the OS dependent
# library and initialize itself.
#
use lib "/usr/local/etc/testbed";
use lib "/usr/local/etc/emulab";
use libsetup;
# Locals
my $timeout = (60 * 30); # In seconds of course.
my $logname = "/tmp/emulab-watchdog.debug";
my $vndir = "/var/testbed";
my $vndir = "/var/emulab";
my $pidfile = "/var/run/emulab-watchdog.pid";
my $noboot = 0;
......@@ -72,6 +72,24 @@ if (@ARGV) {
usage();
}
#
# Must be setuid root.
#
if ($UID != 0) {
die("*** $0:\n".
" Must be root to run this script!\n");
}
#
# XXX
# Do not run the vnode startup on Linux nodes yet.
#
my $sysname = `uname -s`;
chomp($sysname);
if ($sysname eq "Linux") {
$noboot = 1;
}
#
# Put this into the background and log its output. We *must* do this cause
# we do not want to halt the boot if the testbed is down!
......@@ -147,6 +165,7 @@ if (! $mypid) {
my $retries = 3;
while ($retries) {
# my $options = "-p 7778 REDIRECT=192.168.100.1";
my $options = "";
if (REMOTE()) {
$options .= " -u -t 3";
......
......@@ -30,8 +30,12 @@
#include <openssl/err.h>
#include "decls.h"
#include "ssl.h"
#ifndef STANDALONE
#include "log.h"
#include "config.h"
#else
#define error printf
#endif
/* Passed in from the makefile */
#ifndef ETCDIR
......
......@@ -23,10 +23,14 @@
#include <arpa/inet.h>
#include <netdb.h>
#include "decls.h"
#include "config.h"
#include "ssl.h"
#ifndef STANDALONE
#include "config.h"
#endif
#ifndef STANDALONE
#undef BOSSNODE
#endif
#ifdef BOSSNODE
#define DEFAULT_BOSSNODE BOSSNODE
#else
......
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