diff --git a/tools/anvil-configure-host b/tools/anvil-configure-host index 583b8adc..18b25b76 100755 --- a/tools/anvil-configure-host +++ b/tools/anvil-configure-host @@ -112,6 +112,19 @@ sub do_reboot { my ($anvil) = @_; + # Mark that a reboot is needed, in case something kills us before we actually reboot. + my ($job_uuid) = $anvil->Database->insert_or_update_jobs({ + file => $THIS_FILE, + line => __LINE__, + job_command => $anvil->data->{path}{exe}{'anvil-manage-power'}." --reboot -y".$anvil->Log->switches, + job_data => "", + job_name => "reboot::system", + job_title => "job_0009", + job_description => "job_0006", + job_progress => 0, + }); + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { job_uuid => $job_uuid }}); + my $time_left = 60; while ($time_left) { diff --git a/tools/anvil-manage-power b/tools/anvil-manage-power index 4e53764a..e896c059 100755 --- a/tools/anvil-manage-power +++ b/tools/anvil-manage-power @@ -251,7 +251,7 @@ sub do_poweroff $anvil->Database->update_host_status({ debug => 2, host_uuid => $anvil->Get->host_uuid, - host_status => $task eq "poweroff" ? "rebooting" : "stopping";, + host_status => $task eq "poweroff" ? "rebooting" : "stopping", }); # Now do the deed. diff --git a/tools/anvil-update-states b/tools/anvil-update-states index 132a31c4..8de29695 100755 --- a/tools/anvil-update-states +++ b/tools/anvil-update-states @@ -2,6 +2,9 @@ # # This updates things like the current network configuration, shared file data and writes it out to a json file. # +# TODO: +# - Retire this once scan-network is finished. +# use strict; use warnings; use Anvil::Tools; @@ -25,7 +28,7 @@ $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure = # If there's no DB (or cached data isn't recorded to the database yet), this will store those records. $anvil->data->{cache}{new_file} = "# interface,timestamp,mac_address,speed,link_state,operational\n"; -$anvil->Database->connect({debug => 3}); +$anvil->Database->connect(); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0132"}); if (not $anvil->data->{sys}{database}{connections}) {