Commit de7ba859 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Merge a few little things in from the jail watchdog, and now use this

script both inside and outside the jail.
parent c659b284
......@@ -42,6 +42,7 @@ my $pidfile = "/var/run/emulab-watchdog.pid";
my $debug = 0;
my $isalivewait = ((REMOTE() == 1) ? 60 : 180); # Seconds to wait.
my $driftfile;
my $vnodeid;
#
# Forward declarations for prototype checking
......@@ -125,6 +126,13 @@ sub handler () {
$SIG{TERM} = \&handler;
$SIG{INT} = \&handler;
#
# If jailed, get our jailname.
#
if (JAILED()) {
$vnodeid = libsetup_getvnodeid();
}
#
# Start isalive daemon.
#
......@@ -157,6 +165,10 @@ while (1) {
print "Looking for new Emulab accounts ...\n";
system("update -i");
# Skip all this stuff in jail.
next
if (JAILED());
#
# Send back ntpdrift info. Should move elsewhere.
#
......@@ -198,8 +210,10 @@ sub startisalive()
my $retries = 3;
while ($retries) {
# my $options = "-p 7778 REDIRECT=192.168.100.1";
my $options = "-u -t 3";
if (defined($vnodeid)) {
$options .= " -n $vnodeid";
}
my $result = `tmcc $options isalive`;
if (! $?) {
my $date = POSIX::strftime("20%y/%m/%d %H:%M:%S", localtime());
......
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