Commit 573af413 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Minor change for new path layout (local nodes look more like remote

nodes, so path is consistent).
Also add jail support by looking to see if the node is a jailed node,
and passing that to the client side in the form of a -j option.
parent 482fb815
......@@ -31,6 +31,7 @@ my $TB = "@prefix@";
my $TESTMODE = @TESTMODE@;
my $TBOPS = "@TBOPSEMAIL@";
my $TBLOGS = "@TBLOGSEMAIL@";
my $CLIENT_BIN = "@CLIENT_BINDIR@";
my $ssh = "$TB/bin/sshtb -n";
my $debug = 0;
......@@ -158,8 +159,9 @@ if (! @nodes) {
# Just the vnodes mam.
foreach my $node (@nodes) {
my $pnode;
my $jailed;
if (! TBIsNodeVirtual($node)) {
if (! TBIsNodeVirtual($node, \$jailed)) {
next;
}
......@@ -171,12 +173,6 @@ foreach my $node (@nodes) {
print STDOUT "Doing $mode of vnode $node on $pnode ...\n";
#
# We need to know if its a remote or local node, so we know how
# to update it. This info needs to be in the DB at some point.
#
my $isremote = TBIsNodeRemote($pnode);
#
# Run an ssh command in a child process, protected by an alarm to
# ensure that the ssh is not hung up forever if the machine is in
......@@ -221,18 +217,14 @@ foreach my $node (@nodes) {
}
}
else {
my $args = ($killmode ? "-k" : "");
$args = "$args $node";
my $args = ($killmode ? "-k " : " ");
$args .= ($jailed ? "-j " : " ");
$args .= "$node ";
# Must change our real UID to root so that ssh will work.
$UID = 0;
if ($isremote) {
exec("$ssh -host $pnode /usr/local/etc/testbed/vnodesetup $args");
}
else {
exec("$ssh -host $pnode /etc/testbed/vnodesetup $args");
}
exec("$ssh -host $pnode $CLIENT_BIN/vnodesetup $args");
die("*** $0:\n".
" exec failed!\n");
}
......
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