All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit d1a9cb11 authored by Robert Ricci's avatar Robert Ricci

Don't report a state change if we sucesfully reboot a node with ssh,

since the nodes now do that themselves. This means that node_reboot
now only reports a state change if it uses IPOD to reboot the node.
parent a7160b9c
......@@ -266,7 +266,7 @@ exit $failed;
#
sub RebootNode {
local($pc) = @_;
local($status, $syspid, $mypid);
local($status, $syspid, $mypid,$setstate);
print STDOUT "Rebooting $pc ...\n";
......@@ -290,6 +290,13 @@ sub RebootNode {
exit(0);
}
#
# Keep track of whether or not we need to set the event state for the
# node. If we get to ssh and reboot it, the node should report the
# reboot, so we don't have to.
#
$setstate = 1;
#
# Machine is pingable at least. Try to reboot it gracefully,
# or power cycle anyway if that does not work.
......@@ -336,7 +343,14 @@ sub RebootNode {
print STDERR "Trying Ping-of-Death on $pc ...\n" if $debug;
system("$ipod $pc");
} else {
#
# OK, ssh worked, so the node should have reported the state
# transition itself.
#
$setstate = 0;
}
}
else {
exec("$ssh -host $pc /sbin/reboot");
......@@ -356,7 +370,9 @@ sub RebootNode {
# punch the power button.
#
if (WaitTillDead($pc) == 0) {
TBSetNodeEventState($pc,TBDB_NODESTATE_REBOOTING);
if ($setstate) {
TBSetNodeEventState($pc,TBDB_NODESTATE_REBOOTING);
}
exit(0);
}
......
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