rc.delayagent 747 Bytes
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
#!/usr/bin/perl -w
use English;

#
# Be nice to get this from libloc, but how do you get a package variable?
#
my $MAPFILE	= "/etc/testbed/delay_mapping";

#
# Untaint path
#
$ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/local/bin:/etc/testbed';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};

#
# Load the OS independent support library. It will load the OS dependent
# library and initialize itself. 
# 
use lib "/etc/testbed";
use libsetup;

if (! -s $MAPFILE) {
    exit(0);
}
print "Starting Delay Agent ...\n";

#
# We use the tmcc to figure out where the Testbed Event Daemon is running.
# Don't worry about the port for now.
#
my ($bossname) = split(" ", `tmcc bossinfo`);

33
system("delay-agent -s $bossname -d -f $MAPFILE &");
34
exit($? >> 0);