+ dbg("DXCron::spawn: $line") if isdbg("cron");
+ my $fc = Mojo::IOLoop::Subprocess->new();
+ $fc->run(
+ sub {my @res = `$line`; return @res},
+ sub {
+ my ($fc, $err, @res) = @_;
+ if ($err) {
+ my $s = "DXCron::spawn: error $err";
+ dbg($s);
+ return;
+ }
+ for (@res) {
+ chomp;
+ dbg("DXCron::spawn: $_") if isdbg("cron");
+ }
+ }
+ );
+}
+
+sub spawn_cmd
+{
+ my $line = shift;
+
+ dbg("spawn_cmd run: $line") if isdbg('cron');
+ my $fc = Mojo::IOLoop::Subprocess->new();
+ $fc->run(
+ sub {
+ $main::me->{_nospawn} = 1;
+ my @res = $main::me->run_cmd($line);
+ delete $main::me->{_nospawn};
+ return @res;
+ },
+ sub {
+ my ($fc, $err, @res) = @_;
+ if ($err) {
+ my $s = "spawn_cmd: error $err";
+ dbg($s);
+ }
+ for (@res) {
+ chomp;
+ dbg("spawn_cmd: $_") if isdbg("cron");
+ }
+ }
+ );