|
|
@ -429,33 +429,17 @@ sub startup_tasks |
|
|
|
}); |
|
|
|
}); |
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { variable_uuid => $variable_uuid }}); |
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { variable_uuid => $variable_uuid }}); |
|
|
|
|
|
|
|
|
|
|
|
# If this is a node and we've been up for less than ten minutes, call anvil-safe-start as a |
|
|
|
# This used to call anvil-safe-start, which isn't done here anymore. |
|
|
|
# background process. It will exit if it is disabled. |
|
|
|
|
|
|
|
my $host_type = $anvil->Get->host_type(); |
|
|
|
my $host_type = $anvil->Get->host_type(); |
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { host_type => $host_type }}); |
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { host_type => $host_type }}); |
|
|
|
if ($host_type eq "node") |
|
|
|
if ($host_type eq "node") |
|
|
|
{ |
|
|
|
{ |
|
|
|
my $uptime = $anvil->Get->uptime; |
|
|
|
# For future use. |
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { uptime => $uptime }}); |
|
|
|
|
|
|
|
if ($uptime < 600) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
# Run it as a background task |
|
|
|
|
|
|
|
my $shell_call = $anvil->data->{path}{exe}{'anvil-safe-start'}.$anvil->Log->switches; |
|
|
|
|
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "log_0210", variables => { command => $shell_call }}); |
|
|
|
|
|
|
|
$anvil->System->call({shell_call => $shell_call, background => 1}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
# Log that we've been up too long to auto-start the cluster. |
|
|
|
|
|
|
|
my $say_uptime = $anvil->Convert->time({'time' => $uptime}); |
|
|
|
|
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "log_0620", variables => { uptime => $say_uptime }}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
elsif ($host_type eq "striker") |
|
|
|
elsif ($host_type eq "striker") |
|
|
|
{ |
|
|
|
{ |
|
|
|
# We're a striker, so we're going to check for / remove transient database records on tables |
|
|
|
# We're a striker, so we're going to check for / remove transient database records on tables |
|
|
|
# that always grow (temperature, power, etc) and whose data loses value as it ages. |
|
|
|
# that always grow (temperature, power, etc) and whose data loses value as it ages. |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return(0); |
|
|
|
return(0); |
|
|
|