projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
doc/ Trigram Erweiterung als Musskriterium für das Upgrade genannt
[kivitendo-erp.git]
/
SL
/
System
/
TaskServer.pm
diff --git
a/SL/System/TaskServer.pm
b/SL/System/TaskServer.pm
index
57d0ba8
..
e410e73
100644
(file)
--- a/
SL/System/TaskServer.pm
+++ b/
SL/System/TaskServer.pm
@@
-10,7
+10,7
@@
use Rose::Object::MakeMethods::Generic (
use File::Slurp;
use File::Spec::Functions qw(:ALL);
use File::Slurp;
use File::Spec::Functions qw(:ALL);
-use File::Temp
qw(tempfile)
;
+use File::Temp;
use SL::System::Process;
use SL::System::Process;
@@
-43,6
+43,12
@@
sub start {
return $self->_run_script_command('start');
}
return $self->_run_script_command('start');
}
+sub start_if_not_running {
+ my ($self) = @_;
+
+ $self->start unless $self->is_running;
+}
+
sub stop {
my ($self) = @_;
sub stop {
my ($self) = @_;
@@
-76,12
+82,13
@@
sub _read_pid {
sub _run_script_command {
my ($self, $command) = @_;
sub _run_script_command {
my ($self, $command) = @_;
- my ($fh, $file_name) = tempfile();
my $exe = catfile(catdir(SL::System::Process->exe_dir, 'scripts'), 'task_server.pl');
my $exe = catfile(catdir(SL::System::Process->exe_dir, 'scripts'), 'task_server.pl');
+ my $temp_file = File::Temp->new;
+ my $file_name = $temp_file->filename;
-
system "${exe} ${command} >> ${file_name} 2>&1"
;
+
$temp_file->close
;
-
$fh->close
;
+
system "${exe} ${command} >> ${file_name} 2>&1"
;
$self->last_command_output(read_file($file_name));
$self->last_command_output(read_file($file_name));