Commit afa5e919 authored by Mike Hibler's avatar Mike Hibler

Wow, this should make me look important!

Two-day boondoggle to support "/scratch", an optional large, shared filesystem
for users.  To do this, I needed to find all the instances where /proj is used
and behave accordingly.  The boondoggle part was the decision to gather up all
the hardwired instances of shared directory names ("/proj", "/users", etc.)
so that they are set in a common place (via unexposed configure variables).
This is a boondoggle because:

1. I didn't change the client-side scripts.  They need a different mechanism
   (e.g., tmcd) to get the info, configure is the wrong way.

2. Even if I had done #1 it is likely--no, certain--that something would
   fail if you tried to rename "/proj" to be "/mike".  These names are just
   too ingrained.

3. We may not even use "/scratch" as it turns out.

Note, I also didn't fix any of the .html documentation.  Anyway, it is done.
To maintain my illusion in the future you should:

1. Have perl scripts include "use libtestbed" and use the defined PROJROOT(),
   et.al. functions where possible.  If not possible, make sure they run
   through configure and use @PROJROOT_DIR@, etc.

2. Use the configure method for python, C, php and other languages.

3. There are perl (TBValidUserDir) and php (VALIDUSERPATH) functions which
   you should call to determine if an NS, template parameter, tarball or
   other file are in "an acceptable location."  Use these functions where
   possible.  They know about the optional "scratch" filesystem.  Note that
   the perl function is over-engineered to handles cases that don't occur
   in nature.
parent 2819fca8
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# Copyright (c) 2000-2006 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -42,7 +42,6 @@ my $TB = "@prefix@";
my $TBOPS = "@TBOPSEMAIL@";
my $TBAUDIT = "@TBAUDITEMAIL@";
my $OURDOMAIN = "@OURDOMAIN@";
my $HOMEDIR = "/users";
my $KEYGEN = "/usr/bin/ssh-keygen";
my $USERUID;
......@@ -71,6 +70,8 @@ sub InitUser();
sub GenerateKeyFile();
sub fatal($);
my $HOMEDIR = USERROOT();
#
# Turn off line buffering on output
#
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2004, 2006 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -34,7 +34,6 @@ my $nobody = 0;
my $TB = "@prefix@";
my $TBOPS = "@TBOPSEMAIL@";
my $TBAUDIT = "@TBAUDITEMAIL@";
my $HOMEDIR = "/users";
my $SFSUPDATE = "$TB/sbin/sfskey_update";
# Locals
......@@ -54,6 +53,8 @@ use libtestbed;
#
sub fatal($);
my $HOMEDIR = USERROOT();
#
# Turn off line buffering on output
#
......
......@@ -16,6 +16,16 @@
# installation script/directions should take care of this now.
#
PROJSTR="Project directory: @FSDIR_PROJ@"
GROUPSSTR="Group directory: @FSDIR_GROUPS@"
USERSSTR="User/Home directory: @FSDIR_USERS@"
if [ -n "@FSDIR_SCRATCH@" ]; then
SCRATCHSTR="Project scratch directory: @FSDIR_SCRATCH@"
else
SCRATCHSTR=""
fi
for i in `/usr/sbin/repquota -v @FS_WITH_QUOTAS@ | awk '$2 ~ /\+/ {print $1}'`
do
(
......@@ -41,9 +51,10 @@ You can check your usage with the 'quota' command on @USERNODE@:
The directory trees (on @USERNODE@) where you most likely have files are:
Project directory: @FSDIR_PROJ@
Group directory: @FSDIR_GROUPS@
User/Home directory: @FSDIR_USERS@
$PROJSTR
$GROUPSSTR
$USERSSTR
$SCRATCHSTR
PLEASE NOTE: just login to @USERNODE@ directly to do the cleanup!
You will not be able to swapin an experiment to access these directories
......
......@@ -50,7 +50,6 @@ my $PROTOUSER = 'elabman';
my $SAMBANODE = "fs"; # DNS makes this do the right thing in E-in-E.
my $SMBPASSWD = "/usr/local/bin/smbpasswd";
my $HOMEDIR = "/users";
my $USERPATH = "$TB/bin";
my $ADDKEY = "$TB/sbin/addpubkey";
my $USERADD = "/usr/sbin/pw useradd";
......@@ -137,6 +136,8 @@ sub CheckDotFiles();
sub GenerateSFSKey();
sub fatal($);
my $HOMEDIR = USERROOT();
#
# Parse command arguments. Once we return from getopts, all that should be
# left are the required arguments.
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2005 University of Utah and the Flux Group.
# Copyright (c) 2005, 2006 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -30,8 +30,6 @@ my $TB = "@prefix@";
my $FSNODE = "@FSNODE@";
my $TBOPS = "@TBOPSEMAIL@";
my $TBAUDIT = "@TBAUDITEMAIL@";
my $PROJROOT = "/proj";
my $CVSREPOS = "$PROJROOT/cvsrepos";
my $CVSSUPPORT = @CVSSUPPORT@;
my $TESTMODE = @TESTMODE@;
......@@ -187,6 +185,8 @@ my $now = time;
utime $now, $now, $lockfile;
if (defined($pid)) {
my $CVSREPOS = PROJROOT() . "/cvsrepos";
#
# Grab DB data.
#
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2005 University of Utah and the Flux Group.
# Copyright (c) 2005, 2006 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -32,8 +32,6 @@ my $CVSDCONFOLD = "/usr/local/etc/cvsd/cvsd.conf.backup";
my $HEADFILE = "$TB/lib/cvsd.conf.head";
my $STARTPROG = "/usr/local/etc/rc.d/cvsd.sh";
my $REPODIR = "cvsrepos";
my $PROJREPODIR = "/proj/$REPODIR";
my $JAILREPODIR = "/var/cvsjail/$REPODIR";
my $MOUNT = "/sbin/mount -o ro";
my $UNMOUNT = "/sbin/umount";
my %pubrepos = ();
......@@ -62,6 +60,9 @@ sub fatal($);
use lib "@prefix@/lib";
use libtestbed;
my $PROJREPODIR = PROJDIR() . "/$REPODIR";
my $JAILREPODIR = "/var/cvsjail/$REPODIR";
#
# Parse command arguments. Once we return from getopts, all that should be
# left are the required arguments.
......
......@@ -20,10 +20,16 @@
#undef CONTROL_ROUTER_IP
#undef CONTROL_NETWORK
#undef CONTROL_NETMASK
#undef USERSROOT_DIR
#undef PROJROOT_DIR
#undef GROUPSROOT_DIR
#undef SCRATCHROOT_DIR
#undef SHAREROOT_DIR
#undef FSDIR_PROJ
#undef FSDIR_GROUPS
#undef FSDIR_USERS
#undef FSDIR_SHARE
#undef FSDIR_SCRATCH
#undef SFSSUPPORT
#undef ELABINELAB
#undef LOG_TESTBED
......
......@@ -1371,6 +1371,11 @@ done
......@@ -1437,7 +1442,6 @@ CHATSUPPORT=0
ARCHIVESUPPORT=0
NFSTRACESUPPORT=0
TBLOGFACIL="local5"
LINKTEST_NSPATH="/share/linktest-ns"
BOSSEVENTPORT=2927
UNIFIED_BOSS_AND_OPS=0
FRISEBEEMCASTADDR="234.5.6"
......@@ -1447,6 +1451,16 @@ MIN_UNIX_GID=6000
DELAYTHRESH=2
PELABSUPPORT=0
#
# XXX You really don't want to change these!
# They are ingrained and who knows what might break if you change them.
#
USERSROOT_DIR="/users"
PROJROOT_DIR="/proj"
GROUPSROOT_DIR="/groups"
SHAREROOT_DIR="/share"
SCRATCHROOT_DIR=""
#
# Okay, I know this is improper usage of --with. Too bad.
#
......@@ -1480,6 +1494,11 @@ else
{ echo "configure: error: Definitions file $TBDEFS was not found." 1>&2; exit 1; }
fi
# XXX this can optionally be set in the defs file
if test -n "$FSDIR_SCRATCH"; then
SCRATCHROOT_DIR="/scratch"
fi
#
# These must come after the "eval" above, since the variables are not
# defined until the defs file is taken in.
......@@ -1560,6 +1579,26 @@ cat >> confdefs.h <<EOF
#define CONTROL_NETMASK "$CONTROL_NETMASK"
EOF
cat >> confdefs.h <<EOF
#define USERSROOT_DIR "$USERSROOT_DIR"
EOF
cat >> confdefs.h <<EOF
#define PROJROOT_DIR "$PROJROOT_DIR"
EOF
cat >> confdefs.h <<EOF
#define GROUPSROOT_DIR "$GROUPSROOT_DIR"
EOF
cat >> confdefs.h <<EOF
#define SCRATCHROOT_DIR "$SCRATCHROOT_DIR"
EOF
cat >> confdefs.h <<EOF
#define SHAREROOT_DIR "$SHAREROOT_DIR"
EOF
cat >> confdefs.h <<EOF
#define FSDIR_PROJ "$FSDIR_PROJ"
EOF
......@@ -1577,6 +1616,12 @@ if test -n "$FSDIR_SHARE"; then
#define FSDIR_SHARE "$FSDIR_SHARE"
EOF
fi
if test -n "$FSDIR_SCRATCH"; then
cat >> confdefs.h <<EOF
#define FSDIR_SCRATCH "$FSDIR_SCRATCH"
EOF
fi
cat >> confdefs.h <<EOF
#define BOSSEVENTPORT "$BOSSEVENTPORT"
......@@ -1972,17 +2017,17 @@ for ac_hdr in ulxmlrpcpp/ulxr_config.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:1976: checking for $ac_hdr" >&5
echo "configure:2021: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1981 "configure"
#line 2026 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1986: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2021,17 +2066,17 @@ for ac_hdr in linux/videodev.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2025: checking for $ac_hdr" >&5
echo "configure:2070: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2030 "configure"
#line 2075 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2064,7 +2109,7 @@ done
# Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2068: checking for $ac_word" >&5
echo "configure:2113: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -2143,7 +2188,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:2147: checking for a BSD compatible install" >&5
echo "configure:2192: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
......@@ -2204,7 +2249,7 @@ esac
# Extract the first word of "rsync", so it can be a program name with args.
set dummy rsync; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2208: checking for $ac_word" >&5
echo "configure:2253: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_RSYNC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -2605,10 +2650,16 @@ s%@FSNODE@%$FSNODE%g
s%@EVENTSERVER@%$EVENTSERVER%g
s%@BOSSEVENTPORT@%$BOSSEVENTPORT%g
s%@OURDOMAIN@%$OURDOMAIN%g
s%@USERSROOT_DIR@%$USERSROOT_DIR%g
s%@PROJROOT_DIR@%$PROJROOT_DIR%g
s%@GROUPSROOT_DIR@%$GROUPSROOT_DIR%g
s%@SCRATCHROOT_DIR@%$SCRATCHROOT_DIR%g
s%@SHAREROOT_DIR@%$SHAREROOT_DIR%g
s%@FSDIR_PROJ@%$FSDIR_PROJ%g
s%@FSDIR_GROUPS@%$FSDIR_GROUPS%g
s%@FSDIR_USERS@%$FSDIR_USERS%g
s%@FSDIR_SHARE@%$FSDIR_SHARE%g
s%@FSDIR_SCRATCH@%$FSDIR_SCRATCH%g
s%@FS_WITH_QUOTAS@%$FS_WITH_QUOTAS%g
s%@TRACK_INTERSWITCH_BANDWIDTH@%$TRACK_INTERSWITCH_BANDWIDTH%g
s%@TIMESTAMPS@%$TIMESTAMPS%g
......@@ -2647,7 +2698,6 @@ s%@NFSTRACESUPPORT@%$NFSTRACESUPPORT%g
s%@TBLOGFACIL@%$TBLOGFACIL%g
s%@PLAB_ROOTBALL@%$PLAB_ROOTBALL%g
s%@PLAB_SLICEPREFIX@%$PLAB_SLICEPREFIX%g
s%@LINKTEST_NSPATH@%$LINKTEST_NSPATH%g
s%@TESTBED_NETWORK@%$TESTBED_NETWORK%g
s%@EXTERNAL_TESTBED_NETWORK@%$EXTERNAL_TESTBED_NETWORK%g
s%@TESTBED_NETMASK@%$TESTBED_NETMASK%g
......
......@@ -78,10 +78,16 @@ AC_SUBST(FSNODE)
AC_SUBST(EVENTSERVER)
AC_SUBST(BOSSEVENTPORT)
AC_SUBST(OURDOMAIN)
AC_SUBST(USERSROOT_DIR)
AC_SUBST(PROJROOT_DIR)
AC_SUBST(GROUPSROOT_DIR)
AC_SUBST(SCRATCHROOT_DIR)
AC_SUBST(SHAREROOT_DIR)
AC_SUBST(FSDIR_PROJ)
AC_SUBST(FSDIR_GROUPS)
AC_SUBST(FSDIR_USERS)
AC_SUBST(FSDIR_SHARE)
AC_SUBST(FSDIR_SCRATCH)
AC_SUBST(FS_WITH_QUOTAS)
AC_SUBST(TRACK_INTERSWITCH_BANDWIDTH)
AC_SUBST(TIMESTAMPS)
......@@ -120,7 +126,6 @@ AC_SUBST(NFSTRACESUPPORT)
AC_SUBST(TBLOGFACIL)
AC_SUBST(PLAB_ROOTBALL)
AC_SUBST(PLAB_SLICEPREFIX)
AC_SUBST(LINKTEST_NSPATH)
AC_SUBST(TESTBED_NETWORK)
AC_SUBST(EXTERNAL_TESTBED_NETWORK)
AC_SUBST(TESTBED_NETMASK)
......@@ -218,7 +223,6 @@ CHATSUPPORT=0
ARCHIVESUPPORT=0
NFSTRACESUPPORT=0
TBLOGFACIL="local5"
LINKTEST_NSPATH="/share/linktest-ns"
BOSSEVENTPORT=2927
UNIFIED_BOSS_AND_OPS=0
FRISEBEEMCASTADDR="234.5.6"
......@@ -228,6 +232,16 @@ MIN_UNIX_GID=6000
DELAYTHRESH=2
PELABSUPPORT=0
#
# XXX You really don't want to change these!
# They are ingrained and who knows what might break if you change them.
#
USERSROOT_DIR="/users"
PROJROOT_DIR="/proj"
GROUPSROOT_DIR="/groups"
SHAREROOT_DIR="/share"
SCRATCHROOT_DIR=""
#
# Okay, I know this is improper usage of --with. Too bad.
#
......@@ -256,6 +270,11 @@ else
AC_MSG_ERROR([Definitions file $TBDEFS was not found.])
fi
# XXX this can optionally be set in the defs file
if test -n "$FSDIR_SCRATCH"; then
SCRATCHROOT_DIR="/scratch"
fi
#
# These must come after the "eval" above, since the variables are not
# defined until the defs file is taken in.
......@@ -285,12 +304,20 @@ fi
AC_DEFINE_UNQUOTED(CONTROL_ROUTER_IP, "$CONTROL_ROUTER_IP")
AC_DEFINE_UNQUOTED(CONTROL_NETWORK, "$CONTROL_NETWORK")
AC_DEFINE_UNQUOTED(CONTROL_NETMASK, "$CONTROL_NETMASK")
AC_DEFINE_UNQUOTED(USERSROOT_DIR, "$USERSROOT_DIR")
AC_DEFINE_UNQUOTED(PROJROOT_DIR, "$PROJROOT_DIR")
AC_DEFINE_UNQUOTED(GROUPSROOT_DIR, "$GROUPSROOT_DIR")
AC_DEFINE_UNQUOTED(SCRATCHROOT_DIR, "$SCRATCHROOT_DIR")
AC_DEFINE_UNQUOTED(SHAREROOT_DIR, "$SHAREROOT_DIR")
AC_DEFINE_UNQUOTED(FSDIR_PROJ, "$FSDIR_PROJ")
AC_DEFINE_UNQUOTED(FSDIR_GROUPS, "$FSDIR_GROUPS")
AC_DEFINE_UNQUOTED(FSDIR_USERS, "$FSDIR_USERS")
if test -n "$FSDIR_SHARE"; then
AC_DEFINE_UNQUOTED(FSDIR_SHARE, "$FSDIR_SHARE")
fi
if test -n "$FSDIR_SCRATCH"; then
AC_DEFINE_UNQUOTED(FSDIR_SCRATCH, "$FSDIR_SCRATCH")
fi
AC_DEFINE_UNQUOTED(BOSSEVENTPORT, "$BOSSEVENTPORT")
if test $OPSDBSUPPORT -eq 1; then
......
......@@ -50,8 +50,6 @@ my $USERS = "@USERNODE@";
my $OURDOMAIN = "@OURDOMAIN@";
my $TBACTIVE = "@TBACTIVEARCHIVE@";
my $TBALL = "@TBUSERSARCHIVE@";
my $PROJROOT = "/proj";
my $GRPROOT = "/groups";
my $ELISTS = "$TB/lists";
my $ELABINELAB = @ELABINELAB@;
my $MAILMANSUPPORT= @MAILMANSUPPORT@;
......
......@@ -30,7 +30,7 @@ use vars qw(@ISA @EXPORT);
PROJMEMBERTRUST_ROOT PROJMEMBERTRUST_GROUPROOT
PROJMEMBERTRUST_PROJROOT PROJMEMBERTRUST_LOCALROOT
PROJROOT GROUPROOT USERROOT TBOPSPID EXPTLOGNAME
TBOPSPID EXPTLOGNAME
PLABMOND_PID PLABMOND_EID PLABHOLDING_PID PLABHOLDING_EID
PLABTESTING_PID PLABTESTING_EID PLABDOWN_PID PLABDOWN_EID
......@@ -255,10 +255,8 @@ my $BOSSNODE = "@BOSSNODE@";
my $TESTMODE = @TESTMODE@;
my $TBOPSPID = "emulab-ops";
my $SCRIPTNAME = "Unknown";
my $PROJROOT = "/proj";
my $GROUPROOT = "/groups";
my $USERROOT = "/users";
my $EXPTLOGNAME = "activity.log";
my $PROJROOT = "@PROJROOT_DIR@";
if ($EVENTSYS) {
require event;
......@@ -456,9 +454,6 @@ sub OLDRESERVED_PID() { $TBOPSPID; }
sub OLDRESERVED_EID() { "oldreserved"; }
sub NFREELOCKED_PID() { $TBOPSPID; }
sub NFREELOCKED_EID() { "nfree-locked"; }
sub PROJROOT() { $PROJROOT; }
sub GROUPROOT() { $GROUPROOT; }
sub USERROOT() { $USERROOT; }
sub TBOPSPID() { $TBOPSPID; }
sub EXPTLOGNAME() { $EXPTLOGNAME; }
......@@ -3295,6 +3290,7 @@ sub TBExptDestroy($$)
}
# Yuck.
if ($pid ne $gid) {
# XXX note that this is not the same as TBExptUserDir
my $eidlink = "$PROJROOT/$pid/exp/$eid";
unlink($eidlink)
if (-l $eidlink);
......
......@@ -30,6 +30,7 @@ FSDIR_GROUPS=/q/groups
FSDIR_PROJ=/q/proj
FSDIR_USERS=/users
FSDIR_SHARE=/share
FSDIR_SCRATCH=
FS_WITH_QUOTAS="/q /users"
WWWHOST=www.emulab.net
TBMAINSITE=1
......
......@@ -28,6 +28,7 @@ FSDIR_GROUPS=/q/groups
FSDIR_PROJ=/q/proj
FSDIR_USERS=/q/users
FSDIR_SHARE=/share
FSDIR_SCRATCH=changeme
WWWHOST=changeme
TBMAINSITE=0
THISHOMEBASE=changeme
......
......@@ -82,19 +82,27 @@ TBACTIVEARCHIVE=testbed-active-users-archive@example.emulab.net
#
# Real paths (no symlinks) to the directories that get exported from ops
#
FSDIR_GROUPS=/groups
# FSDIR_SCRATCH is optional. The intent is that it provides per-project
# space that is not "guaranteed" (for the Utah Emulab that means we do
# not back it up to tape). If defined, you would either set no quotas,
# or higher quotas than for FSDIR_PROJ, on this filesystem. If you are
# not providing guarantees and are not doing quotas, you might as well
# just put all your space in /proj and leave FSDIR_SCRATCH= blank.
#
FSDIR_GROUPS=/q/groups
FSDIR_PROJ=/q/proj
FSDIR_USERS=/users
FSDIR_SHARE=/share
FSDIR_SCRATCH=
#
# Filesystems on which quotas should be enforced.
# Note that if multiple of the FSDIR_* vars above are on the same filesystem
# (e.g., /q/proj and /q/users) then you should only specify the base of the
# (e.g., /q/proj and /q/groups) then you should only specify the base of the
# common filesystem on which they all reside here (e.g., /q).
# Set to the empty string to turn off quota checking.
#
FS_WITH_QUOTAS="/q /groups /users"
FS_WITH_QUOTAS="/q /users"
#
# SSL Certificate stuff. Used to customize config files in ssl directory.
......
......@@ -94,19 +94,27 @@ TBACTIVEARCHIVE=testbed-active-users-archive@example.emulab.net
#
# Real paths (no symlinks) to the directories that get exported from ops
#
FSDIR_GROUPS=/groups
# FSDIR_SCRATCH is optional. The intent is that it provides per-project
# space that is not "guaranteed" (for the Utah Emulab that means we do
# not back it up to tape). If defined, you would either set no quotas,
# or higher quotas than for FSDIR_PROJ, on this filesystem. If you are
# not providing guarantees and are not doing quotas, you might as well
# just put all your space in /proj and leave FSDIR_SCRATCH= blank.
#
FSDIR_GROUPS=/q/groups
FSDIR_PROJ=/q/proj
FSDIR_USERS=/users
FSDIR_SHARE=/share
FSDIR_SCRATCH=
#
# Filesystems on which quotas should be enforced.
# Note that if multiple of the FSDIR_* vars above are on the same filesystem
# (e.g., /q/proj and /q/users) then you should only specify the base of the
# (e.g., /q/proj and /q/groups) then you should only specify the base of the
# common filesystem on which they all reside here (e.g., /q).
# Set to the empty string to turn off quota checking.
#
FS_WITH_QUOTAS="/q /groups /users"
FS_WITH_QUOTAS="/q /users"
#
# SSL Certificate stuff. Used to customize config files in ssl directory.
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2002-2005 University of Utah and the Flux Group.
# Copyright (c) 2002-2006 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -63,6 +63,12 @@ space to hold them:
which aids per-project accountability.
/groups/ - Needs enough space for files shared by the sub-groups of
projects. These are primarily used by classes, if any.
/scratch/ - Optional, large filesystem of "scratch" space. The intent
is that this filesystem provides per-project space
that is not "guaranteed" (for the Utah Emulab that
means we do not back it up to tape). If used,
you would either set no quotas, or higher quotas
than for /proj.
/share/ - Exported read-only to all nodes, we use it for providing to
experimenters the source for the FreeBSD and Linux
versions we run as well as common packages and RPMs.
......@@ -75,6 +81,11 @@ can have different /users/ and /proj/ quotas.) If you do not think you will
ever use quotas, then you could make /users and /proj part of the same
filesystem.
As mentioned /scratch is optional. If you are not providing "guarantees"
such as filesaved or RAIDed disk space and you are not using quotas, you
might as well just put all your space in /proj and not define FSDIR_SCRATCH
in the defs file.
Note also since /share is exported read-only, FreeBSD requires that it be on
a separate filesystem from anything that is exported read-write. So while
/users, /proj and /groups can be on the same filesystem, /share cannot.
......@@ -87,7 +98,8 @@ symlinks to the appropriate places. ie., if you make one big filesystem called
ln -s /z/proj /proj
... etc.
In other words, we assume the existence of /users, /proj, /group and /share.
In other words, we assume the existence of /users, /proj, /group and /share
(but not /scratch).
Do *not* create any user accounts, Emulab does not require that its users
have login accounts on the fileserver. For the purposes of this setup, just
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2002-2005 University of Utah and the Flux Group.
# Copyright (c) 2002-2006 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -52,6 +52,12 @@ server, you will also need:
which aids per-project accountability.
/groups/ - Needs enough space for files shared by the sub-groups of
projects. These are primarily used by classes, if any.
/scratch/ - Optional, large filesystem of "scratch" space. The intent
is that this filesystem provides per-project space
that is not "guaranteed" (for the Utah Emulab that
means we do not back it up to tape). If used,
you would either set no quotas, or higher quotas
than for /proj.
/share/ - Exported read-only to all nodes, we use it for providing to
experimenters the source for the FreeBSD and Linux
versions we run as well as common packages and RPMs.
......@@ -64,6 +70,11 @@ can have different /users/ and /proj/ quotas.) If you do not think you will
ever use quotas, then you could make /users and /proj part of the same
filesystem.
As mentioned /scratch is optional. If you are not providing "guarantees"
such as filesaved or RAIDed disk space and you are not using quotas, you
might as well just put all your space in /proj and not define FSDIR_SCRATCH
in the defs file.
Note also since /share is exported read-only, FreeBSD requires that it be on
a separate filesystem from anything that is exported read-write. So while
/users, /proj and /groups can be on the same filesystem, /share cannot.
......@@ -76,8 +87,8 @@ symlinks to the appropriate places. ie., if you make one big filesystem called
ln -s /z/proj /proj
... etc.
In other words, we assume the existence of /users, /proj, /group and /share.
In other words, we assume the existence of /users, /proj, /group and /share
(but not /scratch).
##### Step 2 - Installing packages
......
......@@ -15,6 +15,14 @@ use Socket;
my $LINKTEST_VERSION = "1.2";
#
# XXX config stuff that does not belong on the client-side
#
my $CLIENT_BINDIR = "@CLIENT_BINDIR@";
my $CLIENT_VARDIR = "@CLIENT_VARDIR@";
my $EVENTSERVER = "@EVENTSERVER";
my $PROJROOT = "@PROJROOT_DIR@";
#
# Linktest test script. This script is set up to run as root on
# experiment nodes. It is invoked by the Linktest daemon after the
......@@ -49,19 +57,18 @@ sub usage()
##############################################################################
# path to applications and files
use constant LINKTEST_NSPATH => "@LINKTEST_NSPATH@";
use constant PATH_NICKNAME => "@CLIENT_VARDIR@/boot/nickname";
use constant PATH_KEYFILE => "@CLIENT_VARDIR@/boot/eventkey";
use constant PATH_RUDE => "@CLIENT_BINDIR@/emulab-rude";
use constant PATH_CRUDE => "@CLIENT_BINDIR@/emulab-crude";
use constant PATH_IPERF => "@CLIENT_BINDIR@/emulab-iperf";
use constant PATH_RCTOPO => "@CLIENT_BINDIR@/rc/rc.topomap";
use constant PATH_EMULAB_SYNC => "@CLIENT_BINDIR@/emulab-sync";
use constant PATH_LTEVENT => "@CLIENT_BINDIR@/ltevent";
use constant PATH_TEVC => "@CLIENT_BINDIR@/tevc";
use constant RUN_PATH => "@CLIENT_BINDIR@"; # where the linktest-ns runs.
use constant EVENTSERVER => "@EVENTSERVER@";
use constant PATH_SCHEDFILE => "@CLIENT_VARDIR@/logs/linktest.sched";
use constant PATH_NICKNAME => "$CLIENT_VARDIR/boot/nickname";
use constant PATH_KEYFILE => "$CLIENT_VARDIR/boot/eventkey";
use constant PATH_RUDE => "$CLIENT_BINDIR/emulab-rude";
use constant PATH_CRUDE => "$CLIENT_BINDIR/emulab-crude";
use constant PATH_IPERF => "$CLIENT_BINDIR/emulab-iperf";
use constant PATH_RCTOPO => "$CLIENT_BINDIR/rc/rc.topomap";
use constant PATH_EMULAB_SYNC => "$CLIENT_BINDIR/emulab-sync";
use constant PATH_LTEVENT => "$CLIENT_BINDIR/ltevent";
use constant PATH_TEVC => "$CLIENT_BINDIR/tevc";
use constant RUN_PATH => "$CLIENT_BINDIR"; # where the linktest-ns runs.
use constant EVENTSERVER => "$EVENTSERVER";
use constant PATH_SCHEDFILE => "$CLIENT_VARDIR/logs/linktest.sched";
# log files used by tests.
use constant CRUDE_DAT => "/tmp/crude.dat"; # binary data
......@@ -312,10 +319,10 @@ $gid = $proj_id;
# Set path variables storing the experiment logging path,
# the current ns file and the output file for topology info.
#
$expt_path = "/proj/$proj_id/exp/$exp_id/tbdata";
$expt_path = "$PROJROOT/$proj_id/exp/$exp_id/tbdata";
$linktest_path = "$expt_path/linktest";
$topology_file = "@CLIENT_VARDIR@/boot/ltmap";
$ptopology_file = "@CLIENT_VARDIR@/boot/ltpmap";
$topology_file = "$CLIENT_VARDIR/boot/ltmap";
$ptopology_file = "$CLIENT_VARDIR/boot/ltpmap";
#
# Determine what OS we are. Used for handling the occasional difference
......@@ -340,7 +347,7 @@ sleep(int(rand(5)));
# is not participating, we choose the first node on the host list.
#
$synserv = "";
my $ssname = "@CLIENT_VARDIR@/boot/syncserver";
my $ssname = "$CLIENT_VARDIR/boot/syncserver";
if ($ssname) {
@results = &read_file($ssname);
($synserv) = split/\./, $results[0];
......
......@@ -9,6 +9,13 @@ use Getopt::Std;
use English;
use POSIX;
#
# XXX config stuff that does not belong on the client-side
#
my $TB = "@prefix@";
my $CLIENT_BINDIR = "@CLIENT_BINDIR@";
my $EVENTSERVER = "@EVENTSERVER";
my $PROJROOT = "@PROJROOT_DIR@";
#
# Wrapper for running the linktest daemon. This script is currently
......@@ -41,9 +48,8 @@ my $startAt = 1; # default start level
my $stopAt = 4 ; # default stop level
# Local goo
my $TB = "@prefix@";
my $TMCC = "@CLIENT_BINDIR@/tmcc";
my $LTEVENT = "@CLIENT_BINDIR@/ltevent";
my $TMCC = "$CLIENT_BINDIR/tmcc";
my $LTEVENT = "$CLIENT_BINDIR/ltevent";
my $LOGHOLE = "$TB/bin/loghole";
my $LTEVENTOPS = "$TB/libexec/ltevent";
my $STOPEVENT = "STOP"; # XXX Left in here for backwards compat.
......@@ -206,18 +212,18 @@ else {
# Default to the standard event server.
#
if (!defined($server)) {
$server = "@EVENTSERVER@";
$server = "$EVENTSERVER";
}
#
# These days, must use a keyfile!