nseswap.in 1.14 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
#!/usr/bin/perl -wT

#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# All rights reserved.
#

use English;
use Getopt::Std;
use Socket;
    
#
# In an experiment with simulated nodes, if some instance of the
# simulator (nse) on a physical node is unable to track real time, the
# node requests that the experiment be re-mapped and run with a more
# conservative co-location factor. This script implements the above
# functionality.
#
sub usage()
{
    print STDOUT
	"Usage: nseswap pid eid\n";
 
    exit(-1);
}

#
# Configure variables
#
my $TB       = "@prefix@";
my $TBOPS    = "@TBOPSEMAIL@";
my $CONTROL  = "@USERNODE@";
my $TESTMODE = @TESTMODE@;

# Locals
my $pid;
my $eid;

#
# Turn off line buffering on output
#
$| = 1;

#
# Untaint the path
# 
$ENV{'PATH'} = "$TB/bin:$TB/sbin:/bin:/usr/bin:/sbin:/usr/sbin";
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};

#
# Testbed Support libraries
#
use lib "@prefix@/lib";
use libdb;
use libtestbed;

if (@ARGV != 2) {
    usage();
}

$pid   = $ARGV[0];
$eid   = $ARGV[1];

# Nothing to do right now. Code will be added when rest of the
# infrastructure is in place
exit(0);