Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
de7ba859
Commit
de7ba859
authored
Jun 05, 2003
by
Leigh B. Stoller
Browse files
Merge a few little things in from the jail watchdog, and now use this
script both inside and outside the jail.
parent
c659b284
Changes
1
Hide whitespace changes
Inline
Side-by-side
tmcd/common/watchdog
View file @
de7ba859
...
...
@@ -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
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment