Commit 56acaee5 authored by Mike Hibler's avatar Mike Hibler

Added config option DISABLE_EXPORTS_SETUP for sites without proper control

of their file server (aero)

Extend DISABLE_NAMED_SETUP: when set, we don't set a nodes hostname to
<name>.<eid>.<pid>.<domain> since that won't resolve.  Just stick with
pc<XXX>.<domain> in those cases.  The various sethostname* scripts are
now .in so that they get preprocessed to check for the option.
parent 1c4a613c
......@@ -869,6 +869,7 @@ fi
#
......@@ -1315,7 +1316,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:1319: checking for a BSD compatible install" >&5
echo "configure:1320: 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
......@@ -1450,10 +1451,14 @@ outfiles="$outfiles Makeconf GNUmakefile \
tbsetup/ipassign/GNUmakefile tbsetup/ipassign/src/GNUmakefile \
tbsetup/ipassign/ipassign_wrapper tbsetup/assign_prepass \
tip/GNUmakefile \
tmcd/GNUmakefile tmcd/freebsd/GNUmakefile tmcd/freebsd5/GNUmakefile \
tmcd/openbsd/GNUmakefile \
tmcd/linux/GNUmakefile tmcd/ron/GNUmakefile tmcd/common/GNUmakefile \
tmcd/tmcd.restart tmcd/plab/GNUmakefile tmcd/common/config/GNUmakefile \
tmcd/GNUmakefile tmcd/tmcd.restart \
tmcd/common/GNUmakefile tmcd/common/config/GNUmakefile \
tmcd/freebsd/GNUmakefile \
tmcd/freebsd/supfile tmcd/freebsd/sethostname \
tmcd/linux/GNUmakefile tmcd/linux/supfile tmcd/linux/pump.conf \
tmcd/linux/sethostname tmcd/linux/sethostname.dhclient \
tmcd/freebsd5/GNUmakefile tmcd/openbsd/GNUmakefile \
tmcd/ron/GNUmakefile tmcd/plab/GNUmakefile \
utils/GNUmakefile utils/vlandiff utils/vlansync utils/delay_config \
utils/sshtb utils/create_image utils/node_admin utils/webcreateimage \
utils/firstuser utils/export_tables utils/eventping \
......@@ -1652,6 +1657,7 @@ s%@TIMESTAMPS@%$TIMESTAMPS%g
s%@UNIFIED_BOSS_AND_OPS@%$UNIFIED_BOSS_AND_OPS%g
s%@DISABLE_NSE@%$DISABLE_NSE%g
s%@DISABLE_NAMED_SETUP@%$DISABLE_NAMED_SETUP%g
s%@DISABLE_EXPORTS_SETUP@%$DISABLE_EXPORTS_SETUP%g
s%@DISABLE_EVENT_SCHED@%$DISABLE_EVENT_SCHED%g
s%@CLIENT_ETCDIR@%$CLIENT_ETCDIR%g
s%@CLIENT_BINDIR@%$CLIENT_BINDIR%g
......
......@@ -39,6 +39,7 @@ AC_SUBST(TIMESTAMPS)
AC_SUBST(UNIFIED_BOSS_AND_OPS)
AC_SUBST(DISABLE_NSE)
AC_SUBST(DISABLE_NAMED_SETUP)
AC_SUBST(DISABLE_EXPORTS_SETUP)
AC_SUBST(DISABLE_EVENT_SCHED)
AC_SUBST(CLIENT_ETCDIR)
AC_SUBST(CLIENT_BINDIR)
......@@ -495,10 +496,14 @@ outfiles="$outfiles Makeconf GNUmakefile \
tbsetup/ipassign/GNUmakefile tbsetup/ipassign/src/GNUmakefile \
tbsetup/ipassign/ipassign_wrapper tbsetup/assign_prepass \
tip/GNUmakefile \
tmcd/GNUmakefile tmcd/freebsd/GNUmakefile tmcd/freebsd5/GNUmakefile \
tmcd/openbsd/GNUmakefile \
tmcd/linux/GNUmakefile tmcd/ron/GNUmakefile tmcd/common/GNUmakefile \
tmcd/tmcd.restart tmcd/plab/GNUmakefile tmcd/common/config/GNUmakefile \
tmcd/GNUmakefile tmcd/tmcd.restart \
tmcd/common/GNUmakefile tmcd/common/config/GNUmakefile \
tmcd/freebsd/GNUmakefile \
tmcd/freebsd/supfile tmcd/freebsd/sethostname \
tmcd/linux/GNUmakefile tmcd/linux/supfile tmcd/linux/pump.conf \
tmcd/linux/sethostname tmcd/linux/sethostname.dhclient \
tmcd/freebsd5/GNUmakefile tmcd/openbsd/GNUmakefile \
tmcd/ron/GNUmakefile tmcd/plab/GNUmakefile \
utils/GNUmakefile utils/vlandiff utils/vlansync utils/delay_config \
utils/sshtb utils/create_image utils/node_admin utils/webcreateimage \
utils/firstuser utils/export_tables utils/eventping \
......
......@@ -29,6 +29,7 @@ my $FSNODE = "@FSNODE@";
my $projdir = "@FSDIR_PROJ@";
my $usersdir = "@FSDIR_USERS@";
my $groupdir = "@FSDIR_GROUPS@";
my $DISABLED = "@DISABLE_EXPORTS_SETUP@";
# Note no -n option. We redirect stdin from the new exports file below.
my $SSH = "$TB/bin/sshtb -l root -host $FSNODE";
......@@ -42,6 +43,13 @@ my @row;
my $MOUNTPROG = "/sbin/mount";
my $EXPORT_PAT = q(on ([\S]+)\s\(.*NFS exported.*\));
#
# Testbed doesn't support changing exports file
#
if ($DISABLED) {
exit(0);
}
#
# We don't want to run this script unless its the real version.
#
......
......@@ -18,7 +18,13 @@ SUBDIR = tmcd/freebsd
include $(OBJDIR)/Makeconf
all: supfile injail
SCRIPTS = sethostname
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
#
all: supfile injail $(SCRIPTS)
include $(TESTBED_SRCDIR)/GNUmakerules
......@@ -105,7 +111,7 @@ sysetc-install: dir-install
$(INSTALL) -m 755 $(SRCDIR)/testbed.sh $(RCDIR)/testbed.sh
$(INSTALL) -m 755 $(SRCDIR)/elvind.sh $(RCDIR)/elvind.sh
script-install: dir-install
script-install: dir-install $(SCRIPTS)
$(INSTALL) -m 755 $(SRCDIR)/prepare $(BINDIR)/prepare
$(INSTALL) -m 755 $(SRCDIR)/liblocsetup.pm $(BINDIR)/liblocsetup.pm
$(INSTALL) -m 755 $(SRCDIR)/rc.delayagent $(BINDIR)/rc/rc.delayagent
......@@ -114,7 +120,7 @@ script-install: dir-install
$(INSTALL) -m 755 $(SRCDIR)/rc.ipod $(BINDIR)/rc/rc.ipod
$(INSTALL) -m 755 $(SRCDIR)/rc.kname $(BINDIR)/rc/rc.kname
$(INSTALL) -m 755 $(SRCDIR)/rc.mfs $(BINDIR)/rc/rc.mfs
$(INSTALL) -m 755 $(SRCDIR)/sethostname $(BINDIR)/sethostname
$(INSTALL) -m 755 ./sethostname $(BINDIR)/sethostname
$(INSTALL) -m 755 $(SRCDIR)/nodetype $(BINDIR)/nodetype
$(INSTALL) -m 755 $(SRCDIR)/chipset.awk $(BINDIR)/chipset.awk
$(INSTALL) -m 755 $(SRCDIR)/cpuspeed.awk $(BINDIR)/cpuspeed.awk
......@@ -167,4 +173,4 @@ locrem-install:
$(BINDIR)/control_interface
clean:
/bin/rm -f supfile injail
/bin/rm -f injail
......@@ -25,7 +25,7 @@ fi
#
if [ -x $BINDIR/sethostname ]
then
$BINDIR/sethostname $new_domain_name
$BINDIR/sethostname $new_domain_name >$LOGDIR/dhclient.log 2>&1
fi
#
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2002 University of Utah and the Flux Group.
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
#
# Configure variables
#
my $USEPNAME = "@DISABLE_NAMED_SETUP@";
#
# Set the hostname for the node according to the current experiment.
# Run from /etc/dhclient-exit-hooks.
......@@ -53,23 +58,29 @@ else {
$domain = ".foo.net";
}
my $nickname = whatsmynickname();
#
# If testbed is not maintaining DNS aliases, we had better not
# use the nickname for the hostname as it will not resolve.
#
my $nickname;
if ($USEPNAME) {
chomp($curname);
$nickname = $curname;
} else {
$nickname = whatsmynickname();
}
if (! $nickname) {
print STDOUT "No Testbed nickname available!\n";
print STDERR "No Testbed nickname available!\n";
exit(0);
}
$nickname = lc($nickname);
#
# No prints. Something screwy in dhclient causes these prints
# to go into resolv.conf!
#
#print STDOUT "Resetting hostname to ${nickname}${domain} ... ";
print STDERR "Resetting hostname to ${nickname}${domain} ... ";
if (system("hostname", "${nickname}${domain}")) {
# print STDOUT "*** FAILED!\n";
print STDERR "*** FAILED!\n";
exit 1;
}
#print STDOUT "Done!\n";
print STDERR "Done!\n";
exit 0;
......@@ -18,7 +18,13 @@ SUBDIR = tmcd/linux
include $(OBJDIR)/Makeconf
all: pump.conf supfile
SCRIPTS = sethostname sethostname.dhclient
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
#
all: pump.conf supfile $(SCRIPTS)
include $(TESTBED_SRCDIR)/GNUmakerules
......@@ -110,16 +116,15 @@ sysetc-install: dir-install
sysetc-remove:
-rm -f $(RCDIR)/*/S95anacron $(RCDIR)/*/K05anacron
script-install: dir-install
script-install: dir-install $(SCRIPTS)
$(INSTALL) -m 755 $(SRCDIR)/liblocsetup.pm $(BINDIR)/liblocsetup.pm
$(INSTALL) -m 755 $(SRCDIR)/rc.linux $(BINDIR)/rc/rc.linux
$(INSTALL) -m 755 $(SRCDIR)/rc.ipod $(BINDIR)/rc/rc.ipod
$(INSTALL) -m 755 $(SRCDIR)/prepare $(BINDIR)/prepare
$(INSTALL) -m 755 $(SRCDIR)/ixpboot $(BINDIR)/ixpboot
$(INSTALL) -m 755 $(SRCDIR)/rc.ixp $(BINDIR)/rc/rc.ixp
$(INSTALL) -m 755 $(SRCDIR)/sethostname $(BINDIR)/sethostname
$(INSTALL) -m 755 $(SRCDIR)/sethostname.dhclient \
$(BINDIR)/sethostname.dhclient
$(INSTALL) -m 755 ./sethostname $(BINDIR)/sethostname
$(INSTALL) -m 755 ./sethostname.dhclient $(BINDIR)/sethostname.dhclient
$(INSTALL) -m 755 $(SRCDIR)/rc.healthd $(BINDIR)/rc/rc.healthd
$(INSTALL) -m 755 $(SRCDIR)/healthd.conf $(BINDIR)/healthd.conf
$(INSTALL) -m 755 $(SRCDIR)/chipset.awk $(BINDIR)/chipset.awk
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2002, 2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
#
# Configure variables
#
my $USEPNAME = "@DISABLE_NAMED_SETUP@";
#
# Set the hostname for the node according to the current experiment.
# Run from /etc/dhclient-exit-hooks.
......@@ -42,9 +47,19 @@ else {
$domain = ".foo.net";
}
my $nickname = whatsmynickname();
#
# If testbed is not maintaining DNS aliases, we had better not
# use the nickname for the hostname as it will not resolve.
#
my $nickname;
if ($USEPNAME) {
$nickname = `hostname -s`;
chomp($nickname);
} else {
$nickname = whatsmynickname();
}
if (! $nickname) {
print STDOUT "No Testbed nickname available!\n";
print STDERR "No Testbed nickname available!\n";
exit(0);
}
$nickname = lc($nickname);
......@@ -66,13 +81,13 @@ else {
#
# Set hostname. This output is redirected to log file by caller.
#
print STDOUT "Resetting hostname to ${nickname}${domain} ... ";
print STDERR "Resetting hostname to ${nickname}${domain} ... ";
system("/bin/hostname ${nickname}${domain}");
if ($?) {
print STDOUT "*** FAILED!\n";
print STDERR "*** FAILED!\n";
exit 1;
}
print STDOUT "Done!\n";
print STDERR "Done!\n";
exit 0;
......@@ -6,6 +6,11 @@
#
use English;
#
# Configure variables
#
my $USEPNAME = "@DISABLE_NAMED_SETUP@";
#
# Set the hostname for the node according to the current experiment.
#
......@@ -34,14 +39,52 @@ $| = 1;
use libsetup;
use libtmcc;
if (@ARGV) {
my $token = shift;
my ($action,$iface,$ip) = @ARGV;
if (defined($action)) {
if ($token ne "up" && $token ne "renewal") {
exit 0;
}
}
#
# If testbed is not maintaining DNS aliases, we had better not
# use the nickname for the hostname as it will not resolve.
#
my $nickname;
if ($USEPNAME) {
# Taint check
if ($ip =~ /^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)$/) {
$ip = $1;
} else {
die("Bad data in IP address: '$ip'\n");
}
#
# XXX use of the link, e.g., for DNS lookups, may still be flaky
# (some autonegotiation thing?) so if ipcalc fails, try again
# a couple of times.
#
$nickname = "";
for (my $i = 0; $i < 3; $i++) {
$nickname = `/bin/ipcalc --silent --hostname $ip`;
last if ($? == 0);
sleep($i) if ($i > 0);
}
if ($nickname =~ /^HOSTNAME=([^\.]+)\..*$/) {
$nickname = $1;
} else {
$nickname = "";
}
} else {
$nickname = whatsmynickname();
}
if (! $nickname) {
print STDERR "No Testbed nickname available!\n";
exit(0);
}
$nickname = lc($nickname);
#
# We assume that we are in the same domain as our boss node
#
......@@ -53,13 +96,6 @@ else {
$domain = ".foo.net";
}
my $nickname = whatsmynickname();
if (! $nickname) {
print STDOUT "No Testbed nickname available!\n";
exit(0);
}
$nickname = lc($nickname);
# Taint check to make perl happy
if ($nickname =~ /^([-\w\.]+)$/) {
$nickname = $1;
......@@ -74,12 +110,12 @@ else {
die("Bad data in nickname: '$domain'\n");
}
print STDOUT "Resetting hostname to ${nickname}${domain} ... ";
print STDERR "Resetting hostname to ${nickname}${domain} ... ";
if (system("hostname", "${nickname}${domain}")) {
print STDOUT "*** FAILED!\n";
print STDERR "*** FAILED!\n";
exit 1;
}
print STDOUT "Done!\n";
print STDERR "Done!\n";
exit 0;
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