Commit 4bffc409 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

[#66] ping is enough if pid file is there

parent c053c2c3
...@@ -25,6 +25,8 @@ our $args_manage = { name => 1 , uid => 1 }; ...@@ -25,6 +25,8 @@ our $args_manage = { name => 1 , uid => 1 };
our $args_prepare = { id_domain => 1 , uid => 1 }; our $args_prepare = { id_domain => 1 , uid => 1 };
our $args_remove_base = { domain => 1 , uid => 1 }; our $args_remove_base = { domain => 1 , uid => 1 };
our $PID_FILE_BACKEND = '/var/run/rvd_back.pl.pid';
our %VALID_ARG = ( our %VALID_ARG = (
create_domain => { create_domain => {
vm => 1 vm => 1
...@@ -351,7 +353,15 @@ sub ping_backend { ...@@ -351,7 +353,15 @@ sub ping_backend {
my $self = {}; my $self = {};
bless ($self, $class); bless ($self, $class);
return $self->_new_request( command => 'ping_backend' ); return ( $self->_ping_backend_localhost()
or $self->_new_request( command => 'ping_backend' ));
}
sub _ping_backend_localhost {
my $self = shift;
return 1 if -e $PID_FILE_BACKEND;
# TODO check the process with pid $PID_FILE_BACKEND is really alive
return;
} }
=head2 domdisplay =head2 domdisplay
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment