mirror of
git://git.proxmox.com/git/pve-ha-manager.git
synced 2025-01-06 17:18:00 +03:00
improve LRM log messages
This commit is contained in:
parent
a875fbe8b4
commit
0f70400dad
@ -343,12 +343,11 @@ sub resource_command_finished {
|
||||
my $exit_code = -1;
|
||||
|
||||
if ($status == -1) {
|
||||
print "RA $sid finished - failed to execute\n";
|
||||
$haenv->log('err', "resource agent $sid finished - failed to execute");
|
||||
} elsif (my $sig = ($status & 127)) {
|
||||
print "RA $sid finished - got signal $sig\n";
|
||||
$haenv->log('err', "resource agent $sid finished - got signal $sig");
|
||||
} else {
|
||||
$exit_code = ($status >> 8);
|
||||
print "RA $sid finished - exit code ${exit_code}\n";
|
||||
}
|
||||
|
||||
$self->{results}->{$uid} = {
|
||||
|
@ -89,34 +89,34 @@ sub exec_resource_agent {
|
||||
if ($cmd eq 'started') {
|
||||
|
||||
if ($ss->{$sid}) {
|
||||
print "WORKER status $sid: running\n";
|
||||
$self->log("info", "service status $sid: running");
|
||||
return 0;
|
||||
}
|
||||
print "START WORKER $sid\n";
|
||||
$self->log("info", "starting service $sid");
|
||||
|
||||
$self->sleep(2);
|
||||
|
||||
$ss->{$sid} = 1;
|
||||
$hardware->write_service_status($nodename, $ss);
|
||||
|
||||
print "END WORKER $sid\n";
|
||||
$self->log("info", "service $sid started");
|
||||
|
||||
return 0;
|
||||
|
||||
} elsif ($cmd eq 'request_stop' || $cmd eq 'stopped') {
|
||||
|
||||
if (!$ss->{$sid}) {
|
||||
print "WORKER status $sid: stopped\n";
|
||||
$self->log("info", "service status $sid: stopped");
|
||||
return 0;
|
||||
}
|
||||
print "STOP WORKER $sid\n";
|
||||
$self->log("info", "stopping service $sid");
|
||||
|
||||
$self->sleep(2);
|
||||
|
||||
$ss->{$sid} = 0;
|
||||
$hardware->write_service_status($nodename, $ss);
|
||||
|
||||
print "END WORKER $sid\n";
|
||||
$self->log("info", "service $sid stopped");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user