# Is 'libvirtd' running? We'll wait up to half the timeout for it to start (in case it _just_ started)
# libvirtd lists as disabled / stopped, but "starts" when called. So checking the daemon doesn't make
# before timing out.
# sense. Given virsh might fail, if we don't find the server, we'll also look for it in 'ps'.
my $wait_until = time + ($anvil->data->{environment}{OCF_RESKEY_CRM_meta_timeout} / 2000); # Devide by 2000 to convert to seconds and total second halved.
my $loop = 1;
my $look_for_pid = 0;
while($loop)
my $libvirtd_wait = 1;
my $warning_shown = 0;
while($libvirtd_wait)
{
{
my $running = $anvil->System->check_daemon({daemon => "libvirtd.service"});
$loop = 0;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { running => $running }});
my $found = 0;
if ($running)
my $shell_call = $anvil->data->{path}{exe}{setsid}." --wait ".$anvil->data->{path}{exe}{virsh}." list --all";
{
$libvirtd_wait = 0;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { libvirtd_wait => $libvirtd_wait }});
}
else
{
# On EL8 and above, libvirtd starts on demand, so this error isn't
@ -2377,10 +2377,10 @@ The file: [#!variable!file!#] needs to be updated. The difference is:
<keyname="log_0520">The server: [#!variable!server!#] is indeed running. It will be shut down now.</key>
<keyname="log_0520">The server: [#!variable!server!#] is indeed running. It will be shut down now.</key>
<keyname="log_0521">Checking the status of the server: [#!variable!server!#].</key>
<keyname="log_0521">Checking the status of the server: [#!variable!server!#].</key>
<keyname="log_0522">The 'libvirtd' daemon is not running. It may be starting up, will wait: [#!variable!wait_time!#] seconds...</key>
<keyname="log_0522">The 'libvirtd' daemon is not running. It may be starting up, will wait: [#!variable!wait_time!#] seconds...</key>
<keyname="log_0523">Found the server to be running using it's PID. The state of the server can't be determined, however. Please start the 'libvirtd' daemon!</key>
<keyname="log_0523">Found the server to be running using it's PID. The state of the server can't be determined, however. There appears to be a problem with 'virsh'!</key>
<keyname="log_0524">No PID for the server was found. It is not running on this host.</key>
<keyname="log_0524">No PID for the server was found. It is not running on this host.</key>
<keyname="log_0525">The server: [#!variable!server_name!#] is shutting down. Will wait for it to finish...</key>
<keyname="log_0525">The server: [#!variable!server_name!#] is shutting down. Will wait for it to finish...</key>
<keyname="log_0526">The server: [#!variable!server_name!#] is off.</key>
<keyname="log_0526">The server: [#!variable!server_name!#] is off (not found in virsh or by PID).</key>
<keyname="log_0527">The server: [#!variable!server_name!#] is running (state is: [#!variable!state!#]).</key>
<keyname="log_0527">The server: [#!variable!server_name!#] is running (state is: [#!variable!state!#]).</key>
<keyname="log_0528">We've been asked to migrating the server: [#!variable!server!#] to: [#!variable!target_host!#].</key>
<keyname="log_0528">We've been asked to migrating the server: [#!variable!server!#] to: [#!variable!target_host!#].</key>
<keyname="log_0529">Checking server state after: [#!variable!server!#] was migrated to this host.</key>
<keyname="log_0529">Checking server state after: [#!variable!server!#] was migrated to this host.</key>