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 #!/usr/bin/perl -wT
# #
# EMULAB-COPYRIGHT # 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. # All rights reserved.
# #
use English; use English;
...@@ -42,7 +42,6 @@ my $TB = "@prefix@"; ...@@ -42,7 +42,6 @@ my $TB = "@prefix@";
my $TBOPS = "@TBOPSEMAIL@"; my $TBOPS = "@TBOPSEMAIL@";
my $TBAUDIT = "@TBAUDITEMAIL@"; my $TBAUDIT = "@TBAUDITEMAIL@";
my $OURDOMAIN = "@OURDOMAIN@"; my $OURDOMAIN = "@OURDOMAIN@";
my $HOMEDIR = "/users";
my $KEYGEN = "/usr/bin/ssh-keygen"; my $KEYGEN = "/usr/bin/ssh-keygen";
my $USERUID; my $USERUID;
...@@ -71,6 +70,8 @@ sub InitUser(); ...@@ -71,6 +70,8 @@ sub InitUser();
sub GenerateKeyFile(); sub GenerateKeyFile();
sub fatal($); sub fatal($);
my $HOMEDIR = USERROOT();
# #
# Turn off line buffering on output # Turn off line buffering on output
# #
......
#!/usr/bin/perl -wT #!/usr/bin/perl -wT
# #
# EMULAB-COPYRIGHT # 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. # All rights reserved.
# #
use English; use English;
...@@ -34,7 +34,6 @@ my $nobody = 0; ...@@ -34,7 +34,6 @@ my $nobody = 0;
my $TB = "@prefix@"; my $TB = "@prefix@";
my $TBOPS = "@TBOPSEMAIL@"; my $TBOPS = "@TBOPSEMAIL@";
my $TBAUDIT = "@TBAUDITEMAIL@"; my $TBAUDIT = "@TBAUDITEMAIL@";
my $HOMEDIR = "/users";
my $SFSUPDATE = "$TB/sbin/sfskey_update"; my $SFSUPDATE = "$TB/sbin/sfskey_update";
# Locals # Locals
...@@ -54,6 +53,8 @@ use libtestbed; ...@@ -54,6 +53,8 @@ use libtestbed;
# #
sub fatal($); sub fatal($);
my $HOMEDIR = USERROOT();
# #
# Turn off line buffering on output # Turn off line buffering on output
# #
......
...@@ -16,6 +16,16 @@ ...@@ -16,6 +16,16 @@
# installation script/directions should take care of this now. # 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}'` for i in `/usr/sbin/repquota -v @FS_WITH_QUOTAS@ | awk '$2 ~ /\+/ {print $1}'`
do do
( (
...@@ -41,9 +51,10 @@ You can check your usage with the 'quota' command on @USERNODE@: ...@@ -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: The directory trees (on @USERNODE@) where you most likely have files are:
Project directory: @FSDIR_PROJ@ $PROJSTR
Group directory: @FSDIR_GROUPS@ $GROUPSSTR
User/Home directory: @FSDIR_USERS@ $USERSSTR
$SCRATCHSTR
PLEASE NOTE: just login to @USERNODE@ directly to do the cleanup! PLEASE NOTE: just login to @USERNODE@ directly to do the cleanup!
You will not be able to swapin an experiment to access these directories You will not be able to swapin an experiment to access these directories
......
...@@ -50,7 +50,6 @@ my $PROTOUSER = 'elabman'; ...@@ -50,7 +50,6 @@ my $PROTOUSER = 'elabman';
my $SAMBANODE = "fs"; # DNS makes this do the right thing in E-in-E. my $SAMBANODE = "fs"; # DNS makes this do the right thing in E-in-E.
my $SMBPASSWD = "/usr/local/bin/smbpasswd"; my $SMBPASSWD = "/usr/local/bin/smbpasswd";
my $HOMEDIR = "/users";
my $USERPATH = "$TB/bin"; my $USERPATH = "$TB/bin";
my $ADDKEY = "$TB/sbin/addpubkey"; my $ADDKEY = "$TB/sbin/addpubkey";
my $USERADD = "/usr/sbin/pw useradd"; my $USERADD = "/usr/sbin/pw useradd";
...@@ -137,6 +136,8 @@ sub CheckDotFiles(); ...@@ -137,6 +136,8 @@ sub CheckDotFiles();
sub GenerateSFSKey(); sub GenerateSFSKey();
sub fatal($); sub fatal($);
my $HOMEDIR = USERROOT();
# #
# Parse command arguments. Once we return from getopts, all that should be # Parse command arguments. Once we return from getopts, all that should be
# left are the required arguments. # left are the required arguments.
......
#!/usr/bin/perl -wT #!/usr/bin/perl -wT
# #
# EMULAB-COPYRIGHT # 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. # All rights reserved.
# #
use English; use English;
...@@ -30,8 +30,6 @@ my $TB = "@prefix@"; ...@@ -30,8 +30,6 @@ my $TB = "@prefix@";
my $FSNODE = "@FSNODE@"; my $FSNODE = "@FSNODE@";
my $TBOPS = "@TBOPSEMAIL@"; my $TBOPS = "@TBOPSEMAIL@";
my $TBAUDIT = "@TBAUDITEMAIL@"; my $TBAUDIT = "@TBAUDITEMAIL@";
my $PROJROOT = "/proj";
my $CVSREPOS = "$PROJROOT/cvsrepos";
my $CVSSUPPORT = @CVSSUPPORT@; my $CVSSUPPORT = @CVSSUPPORT@;
my $TESTMODE = @TESTMODE@; my $TESTMODE = @TESTMODE@;
...@@ -187,6 +185,8 @@ my $now = time; ...@@ -187,6 +185,8 @@ my $now = time;
utime $now, $now, $lockfile; utime $now, $now, $lockfile;
if (defined($pid)) { if (defined($pid)) {
my $CVSREPOS = PROJROOT() . "/cvsrepos";
# #
# Grab DB data. # Grab DB data.
# #
......
#!/usr/bin/perl -w #!/usr/bin/perl -w
# #
# EMULAB-COPYRIGHT # 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. # All rights reserved.
# #
use English; use English;
...@@ -32,8 +32,6 @@ my $CVSDCONFOLD = "/usr/local/etc/cvsd/cvsd.conf.backup"; ...@@ -32,8 +32,6 @@ my $CVSDCONFOLD = "/usr/local/etc/cvsd/cvsd.conf.backup";
my $HEADFILE = "$TB/lib/cvsd.conf.head"; my $HEADFILE = "$TB/lib/cvsd.conf.head";
my $STARTPROG = "/usr/local/etc/rc.d/cvsd.sh"; my $STARTPROG = "/usr/local/etc/rc.d/cvsd.sh";
my $REPODIR = "cvsrepos"; my $REPODIR = "cvsrepos";
my $PROJREPODIR = "/proj/$REPODIR";
my $JAILREPODIR = "/var/cvsjail/$REPODIR";
my $MOUNT = "/sbin/mount -o ro"; my $MOUNT = "/sbin/mount -o ro";
my $UNMOUNT = "/sbin/umount"; my $UNMOUNT = "/sbin/umount";
my %pubrepos = (); my %pubrepos = ();
...@@ -62,6 +60,9 @@ sub fatal($); ...@@ -62,6 +60,9 @@ sub fatal($);
use lib "@prefix@/lib"; use lib "@prefix@/lib";
use libtestbed; use libtestbed;
my $PROJREPODIR = PROJDIR() . "/$REPODIR";
my $JAILREPODIR = "/var/cvsjail/$REPODIR";
# #
# Parse command arguments. Once we return from getopts, all that should be # Parse command arguments. Once we return from getopts, all that should be
# left are the required arguments. # left are the required arguments.
......
...@@ -20,10 +20,16 @@ ...@@ -20,10 +20,16 @@
#undef CONTROL_ROUTER_IP #undef CONTROL_ROUTER_IP
#undef CONTROL_NETWORK #undef CONTROL_NETWORK
#undef CONTROL_NETMASK #undef CONTROL_NETMASK
#undef USERSROOT_DIR
#undef PROJROOT_DIR
#undef GROUPSROOT_DIR
#undef SCRATCHROOT_DIR
#undef SHAREROOT_DIR
#undef FSDIR_PROJ #undef FSDIR_PROJ
#undef FSDIR_GROUPS #undef FSDIR_GROUPS
#undef FSDIR_USERS #undef FSDIR_USERS
#undef FSDIR_SHARE #undef FSDIR_SHARE
#undef FSDIR_SCRATCH
#undef SFSSUPPORT #undef SFSSUPPORT
#undef ELABINELAB #undef ELABINELAB
#undef LOG_TESTBED #undef LOG_TESTBED
......
...@@ -1371,6 +1371,11 @@ done ...@@ -1371,6 +1371,11 @@ done
...@@ -1437,7 +1442,6 @@ CHATSUPPORT=0 ...@@ -1437,7 +1442,6 @@ CHATSUPPORT=0
ARCHIVESUPPORT=0 ARCHIVESUPPORT=0
NFSTRACESUPPORT=0 NFSTRACESUPPORT=0
TBLOGFACIL="local5" TBLOGFACIL="local5"
LINKTEST_NSPATH="/share/linktest-ns"
BOSSEVENTPORT=2927 BOSSEVENTPORT=2927
UNIFIED_BOSS_AND_OPS=0 UNIFIED_BOSS_AND_OPS=0
FRISEBEEMCASTADDR="234.5.6" FRISEBEEMCASTADDR="234.5.6"
...@@ -1447,6 +1451,16 @@ MIN_UNIX_GID=6000 ...@@ -1447,6 +1451,16 @@ MIN_UNIX_GID=6000
DELAYTHRESH=2 DELAYTHRESH=2
PELABSUPPORT=0 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. # Okay, I know this is improper usage of --with. Too bad.
# #
...@@ -1480,6 +1494,11 @@ else ...@@ -1480,6 +1494,11 @@ else
{ echo "configure: error: Definitions file $TBDEFS was not found." 1>&2; exit 1; } { echo "configure: error: Definitions file $TBDEFS was not found." 1>&2; exit 1; }
fi 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 # These must come after the "eval" above, since the variables are not
# defined until the defs file is taken in. # defined until the defs file is taken in.
...@@ -1560,6 +1579,26 @@ cat >> confdefs.h <<EOF ...@@ -1560,6 +1579,26 @@ cat >> confdefs.h <<EOF
#define CONTROL_NETMASK "$CONTROL_NETMASK" #define CONTROL_NETMASK "$CONTROL_NETMASK"
EOF 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 cat >> confdefs.h <<EOF
#define FSDIR_PROJ "$FSDIR_PROJ" #define FSDIR_PROJ "$FSDIR_PROJ"
EOF EOF
...@@ -1577,6 +1616,12 @@ if test -n "$FSDIR_SHARE"; then ...@@ -1577,6 +1616,12 @@ if test -n "$FSDIR_SHARE"; then
#define FSDIR_SHARE "$FSDIR_SHARE" #define FSDIR_SHARE "$FSDIR_SHARE"
EOF EOF
fi
if test -n "$FSDIR_SCRATCH"; then
cat >> confdefs.h <<EOF
#define FSDIR_SCRATCH "$FSDIR_SCRATCH"
EOF
fi fi
cat >> confdefs.h <<EOF cat >> confdefs.h <<EOF
#define BOSSEVENTPORT "$BOSSEVENTPORT" #define BOSSEVENTPORT "$BOSSEVENTPORT"
...@@ -1972,17 +2017,17 @@ for ac_hdr in ulxmlrpcpp/ulxr_config.h ...@@ -1972,17 +2017,17 @@ for ac_hdr in ulxmlrpcpp/ulxr_config.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1981 "configure" #line 2026 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2021,17 +2066,17 @@ for ac_hdr in linux/videodev.h ...@@ -2021,17 +2066,17 @@ for ac_hdr in linux/videodev.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2030 "configure" #line 2075 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2064,7 +2109,7 @@ done ...@@ -2064,7 +2109,7 @@ done
# Extract the first word of "gtk-config", so it can be a program name with args. # Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2 set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_prog_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -2143,7 +2188,7 @@ fi ...@@ -2143,7 +2188,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh. # ./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 $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 test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2204,7 +2249,7 @@ esac ...@@ -2204,7 +2249,7 @@ esac
# Extract the first word of "rsync", so it can be a program name with args. # Extract the first word of "rsync", so it can be a program name with args.
set dummy rsync; ac_word=$2 set dummy rsync; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_path_RSYNC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -2605,10 +2650,16 @@ s%@FSNODE@%$FSNODE%g ...@@ -2605,10 +2650,16 @@ s%@FSNODE@%$FSNODE%g
s%@EVENTSERVER@%$EVENTSERVER%g s%@EVENTSERVER@%$EVENTSERVER%g
s%@BOSSEVENTPORT@%$BOSSEVENTPORT%g s%@BOSSEVENTPORT@%$BOSSEVENTPORT%g
s%@OURDOMAIN@%$OURDOMAIN%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_PROJ@%$FSDIR_PROJ%g
s%@FSDIR_GROUPS@%$FSDIR_GROUPS%g s%@FSDIR_GROUPS@%$FSDIR_GROUPS%g
s%@FSDIR_USERS@%$FSDIR_USERS%g s%@FSDIR_USERS@%$FSDIR_USERS%g
s%@FSDIR_SHARE@%$FSDIR_SHARE%g s%@FSDIR_SHARE@%$FSDIR_SHARE%g
s%@FSDIR_SCRATCH@%$FSDIR_SCRATCH%g
s%@FS_WITH_QUOTAS@%$FS_WITH_QUOTAS%g s%@FS_WITH_QUOTAS@%$FS_WITH_QUOTAS%g
s%@TRACK_INTERSWITCH_BANDWIDTH@%$TRACK_INTERSWITCH_BANDWIDTH%g s%@TRACK_INTERSWITCH_BANDWIDTH@%$TRACK_INTERSWITCH_BANDWIDTH%g
s%@TIMESTAMPS@%$TIMESTAMPS%g s%@TIMESTAMPS@%$TIMESTAMPS%g
...@@ -2647,7 +2698,6 @@ s%@NFSTRACESUPPORT@%$NFSTRACESUPPORT%g ...@@ -2647,7 +2698,6 @@ s%@NFSTRACESUPPORT@%$NFSTRACESUPPORT%g
s%@TBLOGFACIL@%$TBLOGFACIL%g s%@TBLOGFACIL@%$TBLOGFACIL%g
s%@PLAB_ROOTBALL@%$PLAB_ROOTBALL%g s%@PLAB_ROOTBALL@%$PLAB_ROOTBALL%g
s%@PLAB_SLICEPREFIX@%$PLAB_SLICEPREFIX%g s%@PLAB_SLICEPREFIX@%$PLAB_SLICEPREFIX%g
s%@LINKTEST_NSPATH@%$LINKTEST_NSPATH%g
s%@TESTBED_NETWORK@%$TESTBED_NETWORK%g s%@TESTBED_NETWORK@%$TESTBED_NETWORK%g
s%@EXTERNAL_TESTBED_NETWORK@%$EXTERNAL_TESTBED_NETWORK%g s%@EXTERNAL_TESTBED_NETWORK@%$EXTERNAL_TESTBED_NETWORK%g
s%@TESTBED_NETMASK@%$TESTBED_NETMASK%g s%@TESTBED_NETMASK@%$TESTBED_NETMASK%g
......
...@@ -78,10 +78,16 @@ AC_SUBST(FSNODE) ...@@ -78,10 +78,16 @@ AC_SUBST(FSNODE)
AC_SUBST(EVENTSERVER) AC_SUBST(EVENTSERVER)
AC_SUBST(BOSSEVENTPORT) AC_SUBST(BOSSEVENTPORT)
AC_SUBST(OURDOMAIN) 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_PROJ)
AC_SUBST(FSDIR_GROUPS) AC_SUBST(FSDIR_GROUPS)
AC_SUBST(FSDIR_USERS) AC_SUBST(FSDIR_USERS)
AC_SUBST(FSDIR_SHARE) AC_SUBST(FSDIR_SHARE)
AC_SUBST(FSDIR_SCRATCH)
AC_SUBST(FS_WITH_QUOTAS) AC_SUBST(FS_WITH_QUOTAS)
AC_SUBST(TRACK_INTERSWITCH_BANDWIDTH) AC_SUBST(TRACK_INTERSWITCH_BANDWIDTH)
AC_SUBST(TIMESTAMPS) AC_SUBST(TIMESTAMPS)
...@@ -120,7 +126,6 @@ AC_SUBST(NFSTRACESUPPORT) ...@@ -120,7 +126,6 @@ AC_SUBST(NFSTRACESUPPORT)
AC_SUBST(TBLOGFACIL) AC_SUBST(TBLOGFACIL)
AC_SUBST(PLAB_ROOTBALL) AC_SUBST(PLAB_ROOTBALL)
AC_SUBST(PLAB_SLICEPREFIX) AC_SUBST(PLAB_SLICEPREFIX)
AC_SUBST(LINKTEST_NSPATH)
AC_SUBST(TESTBED_NETWORK) AC_SUBST(TESTBED_NETWORK)
AC_SUBST(EXTERNAL_TESTBED_NETWORK) AC_SUBST(EXTERNAL_TESTBED_NETWORK)
AC_SUBST(TESTBED_NETMASK) AC_SUBST(TESTBED_NETMASK)
...@@ -218,7 +223,6 @@ CHATSUPPORT=0 ...@@ -218,7 +223,6 @@ CHATSUPPORT=0
ARCHIVESUPPORT=0 ARCHIVESUPPORT=0
NFSTRACESUPPORT=0 NFSTRACESUPPORT=0
TBLOGFACIL="local5" TBLOGFACIL="local5"
LINKTEST_NSPATH="/share/linktest-ns"
BOSSEVENTPORT=2927 BOSSEVENTPORT=2927
UNIFIED_BOSS_AND_OPS=0 UNIFIED_BOSS_AND_OPS=0
FRISEBEEMCASTADDR="234.5.6" FRISEBEEMCASTADDR="234.5.6"
...@@ -228,6 +232,16 @@ MIN_UNIX_GID=6000 ...@@ -228,6 +232,16 @@ MIN_UNIX_GID=6000
DELAYTHRESH=2 DELAYTHRESH=2
PELABSUPPORT=0 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. # Okay, I know this is improper usage of --with. Too bad.
# #
...@@ -256,6 +270,11 @@ else ...@@ -256,6 +270,11 @@ else
AC_MSG_ERROR([Definitions file $TBDEFS was not found.]) AC_MSG_ERROR([Definitions file $TBDEFS was not found.])
fi 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 # These must come after the "eval" above, since the variables are not
# defined until the defs file is taken in. # defined until the defs file is taken in.
...@@ -285,12 +304,20 @@ fi ...@@ -285,12 +304,20 @@ fi
AC_DEFINE_UNQUOTED(CONTROL_ROUTER_IP, "$CONTROL_ROUTER_IP") AC_DEFINE_UNQUOTED(CONTROL_ROUTER_IP, "$CONTROL_ROUTER_IP")
AC_DEFINE_UNQUOTED(CONTROL_NETWORK, "$CONTROL_NETWORK") AC_DEFINE_UNQUOTED(CONTROL_NETWORK, "$CONTROL_NETWORK")
AC_DEFINE_UNQUOTED(CONTROL_NETMASK, "$CONTROL_NETMASK") 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_PROJ, "$FSDIR_PROJ")
AC_DEFINE_UNQUOTED(FSDIR_GROUPS, "$FSDIR_GROUPS") AC_DEFINE_UNQUOTED(FSDIR_GROUPS, "$FSDIR_GROUPS")
AC_DEFINE_UNQUOTED(FSDIR_USERS, "$FSDIR_USERS") AC_DEFINE_UNQUOTED(FSDIR_USERS, "$FSDIR_USERS")
if test -n "$FSDIR_SHARE"; then if test -n "$FSDIR_SHARE"; then
AC_DEFINE_UNQUOTED(FSDIR_SHARE, "$FSDIR_SHARE") AC_DEFINE_UNQUOTED(FSDIR_SHARE, "$FSDIR_SHARE")
fi fi
if test -n "$FSDIR_SCRATCH"; then
AC_DEFINE_UNQUOTED(FSDIR_SCRATCH, "$FSDIR_SCRATCH")
fi
AC_DEFINE_UNQUOTED(BOSSEVENTPORT, "$BOSSEVENTPORT") AC_DEFINE_UNQUOTED(BOSSEVENTPORT, "$BOSSEVENTPORT")
if test $OPSDBSUPPORT -eq 1; then if test $OPSDBSUPPORT -eq 1; then
......
...@@ -50,8 +50,6 @@ my $USERS = "@USERNODE@"; ...@@ -50,8 +50,6 @@ my $USERS = "@USERNODE@";
my $OURDOMAIN = "@OURDOMAIN@"; my $OURDOMAIN = "@OURDOMAIN@";
my $TBACTIVE = "@TBACTIVEARCHIVE@"; my $TBACTIVE = "@TBACTIVEARCHIVE@";
my $TBALL = "@TBUSERSARCHIVE@"; my $TBALL = "@TBUSERSARCHIVE@";
my $PROJROOT = "/proj";
my $GRPROOT = "/groups";
my $ELISTS = "$TB/lists"; my $ELISTS = "$TB/lists";
my $ELABINELAB = @ELABINELAB@; my $ELABINELAB = @ELABINELAB@;
my $MAILMANSUPPORT= @MAILMANSUPPORT@; my $MAILMANSUPPORT= @MAILMANSUPPORT@;
......
...@@ -30,7 +30,7 @@ use vars qw(@ISA @EXPORT); ...@@ -30,7 +30,7 @@ use vars qw(@ISA @EXPORT);
PROJMEMBERTRUST_ROOT PROJMEMBERTRUST_GROUPROOT PROJMEMBERTRUST_ROOT PROJMEMBERTRUST_GROUPROOT
PROJMEMBERTRUST_PROJROOT PROJMEMBERTRUST_LOCALROOT PROJMEMBERTRUST_PROJROOT PROJMEMBERTRUST_LOCALROOT
PROJROOT GROUPROOT USERROOT TBOPSPID EXPTLOGNAME TBOPSPID EXPTLOGNAME
PLABMOND_PID PLABMOND_EID PLABHOLDING_PID PLABHOLDING_EID PLABMOND_PID PLABMOND_EID PLABHOLDING_PID PLABHOLDING_EID
PLABTESTING_PID PLABTESTING_EID PLABDOWN_PID PLABDOWN_EID PLABTESTING_PID PLABTESTING_EID PLABDOWN_PID PLABDOWN_EID
...@@ -255,10 +255,8 @@ my $BOSSNODE = "@BOSSNODE@"; ...@@ -255,10 +255,8 @@ my $BOSSNODE = "@BOSSNODE@";
my $TESTMODE = @TESTMODE@; my $TESTMODE = @TESTMODE@;
my $TBOPSPID = "emulab-ops"; my $TBOPSPID = "emulab-ops";
my $SCRIPTNAME = "Unknown"; my $SCRIPTNAME = "Unknown";
my $PROJROOT = "/proj";
my $GROUPROOT = "/groups";
my $USERROOT = "/users";
my $EXPTLOGNAME = "activity.log"; my $EXPTLOGNAME = "activity.log";
my $PROJROOT = "@PROJROOT_DIR@";
if ($EVENTSYS) { if ($EVENTSYS) {
require event; require event;
...@@ -456,9 +454,6 @@ sub OLDRESERVED_PID() { $TBOPSPID; } ...@@ -456,9 +454,6 @@ sub OLDRESERVED_PID() { $TBOPSPID; }
sub OLDRESERVED_EID() { "oldreserved"; } sub OLDRESERVED_EID() { "oldreserved"; }
sub NFREELOCKED_PID() { $TBOPSPID; } sub NFREELOCKED_PID() { $TBOPSPID; }
sub NFREELOCKED_EID() { "nfree-locked"; } sub NFREELOCKED_EID() { "nfree-locked"; }
sub PROJROOT() { $PROJROOT; }
sub GROUPROOT() { $GROUPROOT; }
sub USERROOT() { $USERROOT; }
sub TBOPSPID() { $TBOPSPID; } sub TBOPSPID() { $TBOPSPID; }
sub EXPTLOGNAME() { $EXPTLOGNAME; } sub EXPTLOGNAME() { $EXPTLOGNAME; }
...@@ -3295,6 +3290,7 @@ sub TBExptDestroy($$) ...@@ -3295,6 +3290,7 @@ sub TBExptDestroy($$)
} }
# Yuck. # Yuck.
if ($pid ne $gid) { if ($pid ne $gid) {
# XXX note that this is not the same as TBExptUserDir
my $eidlink = "$PROJROOT/$pid/exp/$eid"; my $eidlink = "$PROJROOT/$pid/exp/$eid";
unlink($eidlink) unlink($eidlink)
if (-l $eidlink); if (-l $eidlink);
......
...@@ -30,6 +30,7 @@ FSDIR_GROUPS=/q/groups ...@@ -30,6 +30,7 @@ FSDIR_GROUPS=/q/groups
FSDIR_PROJ=/q/proj FSDIR_PROJ=/q/proj
FSDIR_USERS=/users FSDIR_USERS=/users
FSDIR_SHARE=/share FSDIR_SHARE=/share
FSDIR_SCRATCH=
FS_WITH_QUOTAS="/q /users" FS_WITH_QUOTAS="/q /users"
WWWHOST=www.emulab.net WWWHOST=www.emulab.net
TBMAINSITE=1 TBMAINSITE=1
......
...@@ -28,6 +28,7 @@ FSDIR_GROUPS=/q/groups ...@@ -28,6 +28,7 @@ FSDIR_GROUPS=/q/groups
FSDIR_PROJ=/q/proj FSDIR_PROJ=/q/proj
FSDIR_USERS=/q/users FSDIR_USERS=/q/users
FSDIR_SHARE=/share FSDIR_SHARE=/share
FSDIR_SCRATCH=changeme
WWWHOST=changeme WWWHOST=changeme
TBMAINSITE=0 TBMAINSITE=0
THISHOMEBASE=changeme THISHOMEBASE=changeme
......
...@@ -82,19 +82,27 @@ TBACTIVEARCHIVE=testbed-active-users-archive@example.emulab.net ...@@ -82,19 +82,27 @@ TBACTIVEARCHIVE=testbed-active-users-archive@example.emulab.net
# #
# Real paths (no symlinks) to the directories that get exported from ops # 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_PROJ=/q/proj
FSDIR_USERS=/users FSDIR_USERS=/users
FSDIR_SHARE=/share