get '/edit' => sub {my $c = shift;my $result = `/usr/bin/gvim $filename 2>&1`;$c->redirect_to('/');};
#!/usr/bin/perluse warnings;use strict;use Daemon::Control;exit Daemon::Control->new(name => "My Application",lsb_start => '$syslog $remote_fs',lsb_stop => '$syslog',lsb_sdesc => 'My App',lsb_desc => 'Controls the time tracker service.',#path => '/home/symkat/etc/init.d/program',program => '/usr/bin/morbo',program_args => [ '/path/to/mojolicious/app.pl' ],pid_file => '/tmp/myapp.pid',stderr_file => '/var/log/myapp/myapp.log',stdout_file => '/var/log/myapp/myapp.log',user => 'myuser',group => 'myuser',fork => 2,)->run;
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mojolicious/8930b24b-4e37-4b56-82ed-fad82031fe44%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mojolicious/CAG2_C8CwMLwBXwVDdEicwpMYX1fvc3MHSo_CML_4Q7i%3DEHhwgg%40mail.gmail.com.
Using Mojo::IOLoop->subprocess is working for me. Here's what I have now (adapted from the example):
get '/edit' => sub {
my $c = shift;
Mojo::IOLoop->subprocess(
sub {
my $subprocess = shift;
my $result = `/usr/bin/gvim
$tc_file 2>&1`;
return;
},
sub {
my ($subprocess, $err, @results)
= @_;
say "Subprocess error: $err" and
return if $err;
}
);
$c->redirect_to('/');
};
Thank you!
To view this discussion on the web visit https://groups.google.com/d/msgid/mojolicious/CACyQ%2BFTkKXBF2xyCH2MZpywMEiqW1mxK9FdpfK0DGapR%2B26pbw%40mail.gmail.com.
-- Matthew