From de7ba8597ff868d5cd2c7208a9d9d2fb5a9d4ea9 Mon Sep 17 00:00:00 2001 From: "Leigh B. Stoller" Date: Thu, 5 Jun 2003 23:27:01 +0000 Subject: [PATCH] Merge a few little things in from the jail watchdog, and now use this script both inside and outside the jail. --- tmcd/common/watchdog | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tmcd/common/watchdog b/tmcd/common/watchdog index 3238ca49e..066a2a3d4 100755 --- a/tmcd/common/watchdog +++ b/tmcd/common/watchdog @@ -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()); -- GitLab