Commit bab96378 authored by David Johnson's avatar David Johnson

Client side changes for "dedicated" remote nodes -- basically, add yet

another bit (/etc/emulab/isremded) that controls whether remote nodes are
fully reserved to a single experiment (should behave just like local
nodes, except they talk to Emulab like remote nodes).  Corresponding
changes in the rc scripts...
parent b5e208e2
......@@ -135,7 +135,7 @@ sub doboot()
$gname = lc($gname)
if (PLAB());
if (REMOTE() && !JAILED() && !PLAB()) {
if (REMOTE() && !REMOTEDED() && !JAILED() && !PLAB()) {
$gname = "emu-${gname}";
}
$newgroups{"$gname"} = $2
......
......@@ -50,7 +50,7 @@ my $pathname = $HOSTSFILE; # Default path from liblocsetup.
# Not all clients support this.
#
exit(0)
if (MFS() || (REMOTE() && !(PLAB() || JAILED())));
if (MFS() || (REMOTE() && !(REMOTEDED() || PLAB() || JAILED())));
# Protos.
sub doboot();
......
......@@ -46,7 +46,8 @@ use librc;
# Not all clients support this.
#
exit(0)
if (MFS() || (JAILED() && !LINUXJAILED()) || REMOTE() || PLAB());
if (MFS() || (JAILED() && !LINUXJAILED()) || (REMOTE() && !REMOTEDED())
|| PLAB());
# Protos.
sub doboot();
......
......@@ -45,7 +45,7 @@ use librc;
# Not all clients support this.
#
exit(0)
if (MFS() || JAILED() || REMOTE());
if (MFS() || JAILED() || (REMOTE() && !REMOTEDED()));
# Protos.
sub doboot();
......
......@@ -45,7 +45,8 @@ if ($EUID != 0) {
# Not all clients support this.
#
exit(0)
if (MFS() || (REMOTE() && !(PLAB() || FAKEJAILED() || JAILED())));
if (MFS() || (REMOTE() && !(REMOTEDED() || PLAB() || FAKEJAILED()
|| JAILED())));
# Script specific goo.
my $LOGFILE = LOGDIR() . "/progagent.debug";
......
......@@ -44,7 +44,7 @@ use librc;
# Not all clients support this.
#
exit(0)
if (MFS() || (REMOTE() && !(JAILED() || PLAB())));
if (MFS() || (REMOTE() && !(REMOTEDED() || JAILED() || PLAB())));
# Protos.
sub doboot();
......
......@@ -45,7 +45,7 @@ use librc;
# Not all clients support this.
#
exit(0)
if (MFS() || REMOTE() && !PLAB());
if (MFS() || (REMOTE() && !(REMOTEDED() || PLAB())));
# Protos.
sub doboot();
......
......@@ -44,7 +44,7 @@ use librc;
# Not all clients support this.
#
exit(0)
if (MFS() || (REMOTE() && !(JAILED() || PLAB())));
if (MFS() || (REMOTE() && !(REMOTEDED() || JAILED() || PLAB())));
# Protos.
sub doboot();
......
......@@ -41,7 +41,7 @@ if ($EUID != 0 && !WINDOWS()) {
# Not all clients support this.
#
exit(0)
if (MFS() || (REMOTE() && !(PLAB() || JAILED())));
if (MFS() || (REMOTE() && !(REMOTEDED() || PLAB() || JAILED())));
# Protos.
sub doboot($);
......@@ -154,7 +154,7 @@ sub dotopomap()
# Should probably have our own version of cp that retries at the block
# level?
#
if (! (USESFS() || WINDOWS())) {
if (! (USESFS() || WINDOWS() || REMOTEDED())) {
for (my $i = 0; $i < 5; $i++) {
last
if (system("cp -fp $topomap $tempmap") == 0);
......
......@@ -46,7 +46,7 @@ use librc;
# Not all clients support this.
#
exit(0)
if (MFS() || REMOTE());
if (MFS() || (REMOTE() && !REMOTEDED()));
# Now safe to do this since MFS does not have full perl install.
require Socket;
......
......@@ -25,7 +25,7 @@ use Exporter;
TBDebugTimeStamp TBDebugTimeStampsOn
MFS REMOTE CONTROL WINDOWS JAILED PLAB LOCALROOTFS IXP USESFS
MFS REMOTE REMOTEDED CONTROL WINDOWS JAILED PLAB LOCALROOTFS IXP USESFS
SIMTRAFGEN SIMHOST ISDELAYNODEPATH JAILHOST DELAYHOST STARGATE
ISFW FAKEJAILED LINUXJAILED
......@@ -282,6 +282,11 @@ sub MFS() { if (-e "$ETCDIR/ismfs") { return 1; } else { return 0; } }
#
sub REMOTE() { if (-e "$ETCDIR/isrem") { return 1; } else { return 0; } }
#
# Same for a dedicated remote node.
#
sub REMOTEDED() { if (-e "$ETCDIR/isremded") { return 1; } else { return 0; } }
#
# Same for a control node.
#
......
......@@ -40,6 +40,7 @@ if ($EUID != 0) {
use libsetup;
use libtmcc;
use librc;
use libtestbed;
# Script specific goo.
my $RCDIR = "$BINDIR/rc";
......@@ -332,9 +333,13 @@ sub doboot()
#
# Start the elvin proxy.
#
if (-x "$BINDIR/evproxy" && !REMOTE()) {
if (-x "$BINDIR/evproxy" && !(REMOTE() && !REMOTEDED())) {
my $eventserver = "event-server";
if (REMOTE()) {
$eventserver = TB_EVENTSERVER();
}
print("Starting elvin proxy daemon\n");
system("$BINDIR/evproxy -s event-server -e $pid/$eid");
system("$BINDIR/evproxy -s $eventserver -e $pid/$eid");
if ($?) {
fatal("Error running $BINDIR/evproxy");
}
......
......@@ -86,7 +86,7 @@ my $RMMOD = "/sbin/rmmod";
my $BRCTL = "/usr/sbin/brctl";
# This should never happen!
if (REMOTE() || MFS()) {
if ((REMOTE() && !REMOTEDED()) || MFS()) {
print "Skipping delay configuration on remote/MFS node!\n";
return 0;
}
......
......@@ -129,7 +129,7 @@ $KERNELLDELAYHZ = 1000;
$KERNELJAILHZ = 1000;
# This should never happen!
if (REMOTE() || MFS()) {
if ((REMOTE() && !REMOTEDED()) || MFS()) {
print "Skipping delay configuration on remote/MFS node!\n";
exit(0);
}
......
......@@ -44,6 +44,7 @@ BEGIN
}
# Convenience.
sub REMOTE() { return libsetup::REMOTE(); }
sub REMOTEDED() { return libsetup::REMOTEDED(); }
sub MFS() { return libsetup::MFS(); }
sub JAILED() { return libsetup::JAILED(); }
......@@ -481,7 +482,7 @@ sub os_mkdir($$)
sub os_setup()
{
# This should never happen!
if (REMOTE() || MFS()) {
if ((REMOTE() && !REMOTEDED()) || MFS()) {
print "Ignoring os setup on remote/MFS node!\n";
return 0;
}
......@@ -495,7 +496,7 @@ sub os_routing_enable_forward()
my $cmd;
my $fname = libsetup::ISDELAYNODEPATH();
if (REMOTE()) {
if (REMOTE() && !REMOTEDED()) {
$cmd = "echo 'IP forwarding not turned on!'";
}
elsif (JAILED()) {
......@@ -515,7 +516,7 @@ sub os_routing_enable_gated($)
my ($conffile) = @_;
my $cmd;
if (REMOTE()) {
if (REMOTE() && !REMOTEDED()) {
$cmd = "echo 'GATED IS NOT ALLOWED!'";
}
else {
......
......@@ -91,7 +91,7 @@ my $TC = "/usr/local/sbin/tc"; # This is the working vers
my $IPTABLES = "/usr/local/sbin/iptables"; # This is the working version!
# This should never happen!
if (REMOTE() || MFS()) {
if ((REMOTE() && !REMOTEDED()) || MFS()) {
print "Skipping delay configuration on remote/MFS node!\n";
return 0;
}
......
......@@ -44,6 +44,7 @@ BEGIN
# Convenience.
sub REMOTE() { return libsetup::REMOTE(); }
sub REMOTEDED() { return libsetup::REMOTEDED(); }
sub PLAB() { return libsetup::PLAB(); }
sub LINUXJAILED(){ return libsetup::LINUXJAILED(); }
......
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