Added more logging to track when and how reboots happen in systems.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 3 years ago
parent ec3b3d2ac9
commit dc989f0950
  1. 3
      cgi-bin/striker
  2. 27
      notes
  3. 10
      share/words.xml
  4. 3
      tools/anvil-manage-power
  5. 2
      tools/anvil-safe-stop
  6. 3
      tools/anvil-update-system

@ -6451,6 +6451,7 @@ sub process_power
my $job_description = "job_0006";
my $say_title = "#!string!job_0005!#";
my $say_description = "#!string!job_0006!#";
my $say_reason = "log_0199";
if ($task eq "poweroff")
{
$job_command = $anvil->data->{path}{exe}{'anvil-manage-power'}." --poweroff -y".$anvil->Log->switches;
@ -6458,7 +6459,9 @@ sub process_power
$job_description = "job_0008";
$say_title = "#!string!job_0007!#";
$say_description = "#!string!job_0008!#";
$say_reason = "log_0200";
}
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "log_0687", variables => { reason => $say_reason }});
my ($job_uuid) = $anvil->Database->insert_or_update_jobs({
file => $THIS_FILE,
line => __LINE__,

27
notes

@ -1291,6 +1291,33 @@ rs-striker03(config-if)#switchport access vlan 100
rs-striker03(config-if)#no shutdown
rs-striker03(config-if)#exit
#### NOTE: Put IP on VID 1!
rs-switch03(config)#show vlan
VLAN Name Ports Type
----- --------------- ------------- --------------
1 default Po1-128, Default
Gi1/0/1-12,
Te1/0/1-4,
Gi2/0/1-12,
Te2/0/1-4
300 IFN1 Gi1/0/13-24, Static
Gi2/0/13-24
rs-switch03(config)#interface vlan 1
rs-switch03(config-if-vlan1)#ip address 10.201.1.3 255.255.0.0
rs-switch03(config-if-vlan1)#exit
rs-switch03(config)#exit
rs-switch03#copy running-config startup-config
###########################
rs-striker03#show vlan

@ -1523,8 +1523,8 @@ The database connection error was:
<key name="log_0196">Failed to reconnect to the database, and now no connections remail. Exiting.</key>
<key name="log_0197"><![CDATA[System->maintenance_mode() was passed an invalid 'set' value: [#!variable!set!#]. No action taken.]]></key>
<key name="log_0198">The user: [#!variable!user!#] logged out successfully.</key>
<key name="log_0199">A system reboot is required, setting the database flag.</key>
<key name="log_0200">A system reboot is required, setting the database flag.</key>
<key name="log_0199">A system reboot has been requested via the Striker UI.</key>
<key name="log_0200">A system power-off has been requested via the Striker UI.</key>
<key name="log_0201">Unable to connect to any database. Will try to initialize the local system and then try again.</key>
<key name="log_0202">Failed to connect to any databases. Skipping the loop of the daemon.</key>
<key name="log_0203">Disconnected from all databases. Will reconnect when entering the main loop.</key>
@ -2079,6 +2079,12 @@ The file: [#!variable!file!#] needs to be updated. The difference is:
<key name="log_0684">The network interface: [#!variable!nic!#] on the host: [#!variable!host!#] is recorded in the 'history.network_interfaces' table, but has not corresponding entry in the public table. Removing it.</key>
<key name="log_0685">[ Note ] - The network bridge: [#!variable!name!#] with 'bridge_uuid': [#!variable!uuid!#] is a duplicate, removing it from the database(s).</key>
<key name="log_0686">Skipping resync, not a Striker dashboard.</key>
<key name="log_0687">### REBOOT REQUESTED ### - [#!variable!reason!#]</key>
<key name="log_0688">Reboot flag set by command line switch to 'anvil-manage-power'.</key>
<key name="log_0689">Poweroff flag set by command line switch to 'anvil-manage-power'.</key>
<key name="log_0690">Kernel updated, reboot queued.</key>
<key name="log_0691">Requested to power-off as part of the anvil-safe-stop job.</key>
<key name="log_0692">The anvil-safe-stop job has completed and will now power off.</key>
<!-- Messages for users (less technical than log entries), though sometimes used for logs, too. -->
<key name="message_0001">The host name: [#!variable!target!#] does not resolve to an IP address.</key>

@ -130,6 +130,7 @@ if ($anvil->data->{switches}{'reboot-needed'} eq "1")
# Enable
if (not $reboot_needed)
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "log_0687", variables => { reason => "log_0688" }});
$reboot_needed = $anvil->System->reboot_needed({debug => 2, set => 1});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { reboot_needed => $reboot_needed }});
print $anvil->Words->string({key => "message_0048"})."\n";
@ -246,6 +247,8 @@ sub do_poweroff
# Make sure the 'reboot needed' flag is set. When 'anvil-daemon' starts, it will use this to confirm
# that it is starting post-reboot and clear it.
my $say_reason = $task eq "poweroff" ? "log_0689" : "log_0688";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "log_0687", variables => { reason => $say_reason }});
$reboot_needed = $anvil->System->reboot_needed({debug => 2, set => 1});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { reboot_needed => $reboot_needed }});

@ -101,6 +101,7 @@ if ($anvil->data->{switches}{'job-uuid'})
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
'switches::power-off' => $anvil->data->{switches}{'power-off'},
}});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "log_0687", variables => { reason => "log_0691" }});
}
if ($line =~ /stop-reason=(.*?)$/)
{
@ -156,6 +157,7 @@ if ($anvil->data->{switches}{'power-off'})
host_status => "stopping",
});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "log_0687", variables => { reason => "log_0692" }});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "job_0325"});
$anvil->Job->update_progress({progress => 100, message => "job_0325"});

@ -173,8 +173,7 @@ sub run_os_update
if ($line =~ /^kernel /)
{
# Reboot will be needed.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, secure => 0, key => "log_0199"});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "log_0687", variables => { reason => "log_0690" }});
my $reboot_needed = $anvil->System->reboot_needed({set => 1});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { reboot_needed => $reboot_needed }});
}

Loading…
Cancel
Save