Commit b73aee17 authored by Mac Newbold's avatar Mac Newbold
Browse files

New slothd change:

node_reboot reports node activity into the "last_ext_act" column of
node_activity. (Ie activity that is external to the node.)

This means that swapin, swapout, reload, etc etc, anything that reboots
the node from boss/ops, will count as activity.
parent 5c25ad9c
......@@ -125,6 +125,8 @@ use Exporter;
TBDB_WIDEAREA_LOCALNODE
TBWideareaNodeID TBTipServers
TBActivityReport
);
# Must come after package declaration!
......@@ -2660,5 +2662,24 @@ sub TBTipServers()
return @tipservers;
}
#
# Report some activity for a node
#
# usage: TBActivityReport(char *node)
# Returns 1 if okay.
# Returns 0 if failed.
#
sub TBActivityReport($)
{
my ($node) = @_;
# Set last_ext_act to now(), but don't update the last_report
return DBQueryFatal("update node_activity set last_ext_act= now() " .
"where node_id='$node'");
}
# _Always_ make sure that this 1 is at the end of the file...
1;
......@@ -346,6 +346,9 @@ sub RebootNode {
print STDOUT "Rebooting $pc ...\n";
# Report some activity into last_ext_act
TBActivityReport($pc);
$mypid = fork();
if ($mypid) {
return $mypid;
......
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