X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/a63be3ade409baf428160656cbdbd876486c7278..22e5a8bb243f6d390940450d2ea21d2ff47cfadc:/SL/System/TaskServer.pm diff --git a/SL/System/TaskServer.pm b/SL/System/TaskServer.pm index 17be8edac..df67523ec 100644 --- a/SL/System/TaskServer.pm +++ b/SL/System/TaskServer.pm @@ -10,6 +10,7 @@ use Rose::Object::MakeMethods::Generic ( use File::Slurp; use File::Spec::Functions qw(:ALL); +use File::Temp qw(tempfile); use SL::System::Process; @@ -74,8 +75,14 @@ sub _read_pid { sub _run_script_command { my ($self, $command) = @_; - my $exe = catfile(catdir(SL::System::Process->exe_dir, 'scripts'), 'task_server.pl'); - $self->last_command_output(`${exe} ${command}`); + my ($fh, $file_name) = tempfile(); + my $exe = catfile(catdir(SL::System::Process->exe_dir, 'scripts'), 'task_server.pl'); + + system "${exe} ${command} >> ${file_name} 2>&1"; + + $fh->close; + + $self->last_command_output(read_file($file_name)); return $? == 0 ? 1 : undef; }