Commit 5182a02a authored by Leigh B. Stoller's avatar Leigh B. Stoller

Kill the daemon if os_load fails. Not supposed to happen when the

node is in the reloadpending EID. Typically means a bad image ID, but
maybe some other problem.
parent 9f10a704
......@@ -143,10 +143,12 @@ while (1) {
# EID was when nfree noticed an entry in the table.
#
$query_result =
DBQueryWarn("select image_id from scheduled_reloads where node_id='$node'");
DBQueryWarn("select image_id from scheduled_reloads where ".
"node_id='$node'");
if (! $query_result) {
print "DB Error getting imageid from scheduled_reloads. Waiting a bit.\n";
print "DB Error getting imageid from scheduled_reloads. ".
"Waiting a bit.\n";
next;
}
@row = $query_result->fetchrow_array();
......@@ -165,10 +167,10 @@ while (1) {
}
if (system("$os_load $imageid $node")) {
#
# Could not get it. Wait and go around again.
# This should not fail!
#
print "$os_load failed on $node. Waiting a bit.\n";
next;
fatal("$os_load failed on $node. Thats not supposed to happen.\n".
"Please check the reload daemon log before restarting!");
}
}
else {
......@@ -255,13 +257,22 @@ while (1) {
sleep(20);
}
sub fatal {
sub fatal($)
{
local($msg) = $_[0];
SENDMAIL($TBOPS, "TESTBED: Reload Daemon Died", $msg);
die($msg);
}
sub notify($)
{
my($mesg) = $_[0];
print "$mesg\n";
SENDMAIL($TBOPS, "TESTBED: Reload Daemon Message", $msg);
}
#
# Become a daemon.
#
......
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